Free Online Storage

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Tuesday, 11 May 2010

What’s different about the new Google Docs?

Posted on 08:00 by Unknown
Editor’s Note: This post is more technical than most posts on the Google Docs blog.

A month ago we introduced the latest version of the Google document editor. The new editor comes with features like a ruler, tabs stops, and floating images. Those features might seem pretty basic, but they’re nearly impossible to support in a regular online text editor. This post unwraps some of the core technical changes with the new editor to make this new functionality possible.

The old Google documents

As background, most online text editors (including the old Google documents) use an editable HTML element, which means the application tells the browser to make a certain string of text editable, and the browser takes care of letting the user edit that text. So when you type in the old Google document editor, the browser inserts the characters you type into the page’s HTML. Likewise, when you bold a word, the browser changes the HTML so that the word displays as bold.

Relying on the browser like this has several advantages:
  1. Easy implementation -- Browsers know when a user triple clicks, they want to select an entire paragraph. The application doesn’t need to think about these basic text behaviors.

  2. Easy to make it fast -- The browser (not the app) handles the most computationally intensive task: text layout. Since layout is a core component of browser functionality, you can trust that layout performance has already been heavily optimized.
But using the browser’s native text editing means less control over how the document behaves: if one browser has a bug in its list behavior, people using that browser will have trouble working with lists in Google Docs and we won’t be able to fix the behavior for them. It also means we can support only the least common denominator of features: if inserting tabs works in some browsers but not others, we can’t really support it because the doc won’t look right if you open it in a browser that doesn’t understand tabs.

The new Google documents

To get around these problems, the new Google document editor doesn’t use the browser to handle editable text. We wrote a brand new editing surface and layout engine, entirely in JavaScript.

A new editing surface

Let’s start by talking about the editing surface, which processes all user input and makes the application feel like a regular editor. To you, the new editor looks like a fairly normal text box. But from the browser’s perspective, it’s a webpage with JavaScript that responds to any user action by dynamically changing what to display on each line. For example, the cursor you see is actually a thin, 2 pixel-wide div element that we manually place on the screen. When you click somewhere, we find the x and y coordinates of your click and draw the cursor at that position. This lets us do basic things like slanting the cursor for italicized text, and it also allows more powerful capabilities like showing multiple collaborators’ cursors simultaneously, in the same document.

Multiple users editing in the same paragraph

A new layout engine

By far the most difficult thing the editor does is figure out where to draw text. For this, we built a new layout engine. Here’s an example of how the new engine works: say you type the letter ‘a’. We notice you pressed the ‘a’ key and respond by drawing a single ‘a’ off-screen. We then measure the width and height of that ‘a’, combine those measurements with the x and y position of your cursor, and place the ‘a’ at the correct spot on the screen. If you’re in the middle of a word, we push the characters after your cursor over. If you’re at the end of a line, the editor moves your word to the next line and pushes any overflow to the lines after it.

Tab stops and other basic features are impossible to support if you’re using the browser’s HTML layout engine for your text. That’s why we wrote our own engine: once we tell our layout engine how to draw a feature, we don’t have to worry about which features browsers support.

The formatting in this basic menu couldn’t be supported without writing a new layout engine

Improved collaboration

What I’ve just described is pretty standard architecture for a desktop word processor. But the new Google Docs isn’t just an online version of existing desktop software: it’s designed specifically for character-by-character real time collaboration. That kind of collaboration is only possible because we built the editor around a technology called operational transformation. It’s what lets multiple people edit the same area of a document at the same time without needing to wait for the server to say a particular edit is okay.

Building an extensible, fully collaborative online word processor required rewriting every part of the document editor from scratch. We’re still adding more features and polish before turning it on for everyone, but for an early peek, you can opt-in by visiting the Editing tab in the Google Docs settings.

Posted by: Jeff Harris, Product Manager, Google Docs
Email ThisBlogThis!Share to XShare to Facebook
Posted in documents, Google Apps Blog | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • More Google Experiments That Hide Results URLs
    There are at least two other versions of the Google experiment that removes search results URLs . The first alternate version places site na...
  • Add a Keyboard Shortcut for Chrome's App Launcher
    I'm not sure why Chrome's app launcher doesn't have a keyboard shortcut, but it's pretty easy to add one. For Windows XP, r...
  • Merge cells vertically in Google spreadsheets
    There are many times when you want to format your spreadsheets in a certain way to make your data easier to read and understand. Starting to...
  • Docs on the iPhone with Chris Pirillo
    Posted by: Meredith Whittaker, Program Manager Chris Pirillo , Gnomedex Conference founder, CNN.com Live technology contributor, and one of ...
  • Posting to a blog is a bit too easy
    Posted by: Andrew Chang, Marketing Manager Oops. As many of you have noticed, yesterday I accidentally posted my personal to-do list onto t...
  • Google Now for Google's Homepage in Testing
    It looks like Google Now won't be limited to Android, iOS and Chrome , it will also be added to Google's homepage. Some code from a...
  • The End of This Internet
    "Congratulations, you've reached the end of this internet. Look for another?" That's the message you see when you use the ...
  • Google Docs welcomes DocVerse
    (Cross-posted from the Google Enterprise Blog ) The future of productivity applications is in the cloud. We've always believed the web ...
  • Speakout gears up
    Posted by: Jen We now have lots of schools participating in our Global Warming Student Speakout from each of the locations listed below. We...
  • Google Play Music Offers Tag Suggestions
    Google's online music service started to suggest better tag values for the songs you've uploaded. If you right-click a song or an a...

Categories

  • Acquisitions
  • Ads
  • Android
  • Annoyances
  • April Fools Day
  • attachments
  • back to school
  • Blogger
  • charts
  • chat
  • Chrome
  • Chrome extensions
  • chrome web apps
  • Cloud Connect
  • collaboration
  • comments
  • community
  • discussions
  • DMCA
  • docs
  • document list
  • documents
  • documents list
  • drawings
  • drivebacktoschool
  • Easter Egg
  • education
  • Faces of Docs
  • forms
  • gmail
  • gone google
  • Google Alerts
  • Google Analytics
  • Google Apps Blog
  • Google Apps Script
  • Google Calendar
  • Google Cast
  • Google Checkout
  • Google Chrome
  • Google Chrome OS
  • Google Cloud Connect
  • Google Contacts
  • Google Dictionary
  • Google Docs
  • Google Docs Viewer
  • google documents
  • google drive
  • Google Earth
  • Google Goggles
  • Google Hangouts
  • Google Instant
  • Google Keep
  • Google Latitude
  • Google Local
  • Google Maps
  • Google Music
  • Google News
  • Google Notebook
  • Google Now
  • Google Pack
  • Google Photos
  • Google Play
  • Google Plus
  • Google Reader
  • Google Sites
  • Google Suggest
  • Google Takeout
  • Google Talk
  • Google Toolbar
  • Google Translate
  • Google Trends
  • Google Voice
  • Google Wallet
  • Google+
  • googlenew
  • Greasemonkey
  • Guest Post
  • holiday
  • iGoogle
  • Image Search
  • images
  • InOut
  • iOS
  • Keep
  • Knowledge
  • mobile
  • OCR
  • offline
  • OneBox
  • paperless
  • pdfs
  • photo
  • photos
  • Picasa Web Albums
  • presentations
  • product ideas
  • profiles
  • quickoffice
  • Reddit
  • research
  • save to drive
  • scripts
  • Security
  • sharing
  • sheets
  • shortcut
  • slides
  • spell check
  • spreadsheets
  • stock photos
  • storage
  • students
  • tables
  • teachers
  • templates
  • Tips
  • User interface
  • videos
  • Viewer
  • Visualization
  • Voice Search
  • Web Search
  • Yahoo
  • YouTube

Blog Archive

  • ►  2013 (519)
    • ►  December (33)
    • ►  November (44)
    • ►  October (64)
    • ►  September (50)
    • ►  August (63)
    • ►  July (60)
    • ►  June (57)
    • ►  May (62)
    • ►  April (49)
    • ►  March (33)
    • ►  February (1)
    • ►  January (3)
  • ►  2012 (34)
    • ►  December (4)
    • ►  November (4)
    • ►  October (5)
    • ►  September (4)
    • ►  August (2)
    • ►  July (1)
    • ►  June (3)
    • ►  May (2)
    • ►  April (2)
    • ►  March (2)
    • ►  February (5)
  • ►  2011 (80)
    • ►  December (4)
    • ►  November (1)
    • ►  October (7)
    • ►  September (10)
    • ►  August (11)
    • ►  July (8)
    • ►  June (9)
    • ►  May (1)
    • ►  April (8)
    • ►  March (8)
    • ►  February (8)
    • ►  January (5)
  • ▼  2010 (118)
    • ►  December (11)
    • ►  November (16)
    • ►  October (6)
    • ►  September (13)
    • ►  August (13)
    • ►  July (7)
    • ►  June (15)
    • ▼  May (11)
      • Formula highlighting in spreadsheets
      • Tips & Tricks: Comments in Google documents
      • Faster finding and other document tweaks
      • Advanced sorting rules in spreadsheets
      • New themes in Google forms
      • Dictionary, improved comments and more in the new ...
      • Google drawings enhancements
      • What’s different about the new Google Docs?
      • Rapid wireframe sketching in Google Docs
      • Answering your FAQs about the New Google Docs
      • Copy sheets from one spreadsheet to another
    • ►  April (7)
    • ►  March (7)
    • ►  February (6)
    • ►  January (6)
  • ►  2009 (82)
    • ►  December (14)
    • ►  November (4)
    • ►  October (10)
    • ►  September (10)
    • ►  August (4)
    • ►  July (6)
    • ►  June (6)
    • ►  May (5)
    • ►  April (4)
    • ►  March (8)
    • ►  February (7)
    • ►  January (4)
  • ►  2008 (97)
    • ►  December (6)
    • ►  November (4)
    • ►  October (6)
    • ►  September (8)
    • ►  August (5)
    • ►  July (7)
    • ►  June (11)
    • ►  May (20)
    • ►  April (13)
    • ►  March (6)
    • ►  February (6)
    • ►  January (5)
  • ►  2007 (25)
    • ►  December (1)
    • ►  November (1)
    • ►  October (2)
    • ►  September (3)
    • ►  August (3)
    • ►  July (4)
    • ►  June (3)
    • ►  May (2)
    • ►  April (2)
    • ►  March (1)
    • ►  February (2)
    • ►  January (1)
  • ►  2006 (10)
    • ►  December (2)
    • ►  November (4)
    • ►  October (4)
Powered by Blogger.

About Me

Unknown
View my complete profile