Merge MC -> JM
authorBrian Hackett <bhackett1024@gmail.com>
Fri, 26 Aug 2011 11:23:35 -0700
changeset 77463 65562c596db33e91274748eb76e9686de63a29bc
parent 77462 407e7bdbedac52b4233aa0dea7262339531e9898 (current diff)
parent 77258 e8af0a8c36322909f2371f637f965da67d03a95a (diff)
child 77464 907c553b698f26dbc36eafe25216e579e9f6e9d4
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge MC -> JM
browser/base/content/browser.js
content/canvas/test/webgl/conformance/gl-min-textures-unroll.html
content/canvas/test/webgl/delete-quickCheckAPI.patch
content/canvas/test/webgl/disable-gl-min-textures.patch
content/canvas/test/webgl/increase-timeout-delays.patch
content/html/content/test/test_bug345624-1.html
content/html/content/test/test_bug345624-2.html
content/html/content/test/test_bug555840.html
content/html/content/test/test_bug556007.html
content/html/content/test/test_bug595457.html
dom/base/nsDOMClassInfo.cpp
dom/base/nsGlobalWindow.cpp
dom/base/nsJSEnvironment.cpp
dom/interfaces/events/nsIDOMNSMouseEvent.idl
dom/interfaces/events/nsIDOMNSUIEvent.idl
dom/plugins/ipc/NPEventX11.h
js/src/Makefile.in
js/src/configure.in
js/src/jit-test/tests/basic/bug657975.js
js/src/jsapi.cpp
js/src/jscntxt.cpp
js/src/jscntxt.h
js/src/jscompartment.cpp
js/src/jscompartment.h
js/src/jsdbgapi.cpp
js/src/jsfun.cpp
js/src/jsgc.cpp
js/src/jsgcinlines.h
js/src/jsgcmark.cpp
js/src/jsinfer.cpp
js/src/jsinterp.cpp
js/src/jsinterp.h
js/src/jsnum.cpp
js/src/jsscript.cpp
js/src/jsscript.h
js/src/jsstr.cpp
js/src/jstracer.cpp
js/src/jstracer.h
js/src/methodjit/Compiler.cpp
js/src/methodjit/PolyIC.cpp
js/src/methodjit/StubCalls.cpp
js/src/tracejit/Writer.cpp
js/src/vm/Debugger.cpp
memory/jemalloc/apply-ed-patches.pl
memory/jemalloc/build-crt.py
memory/jemalloc/crtvc8sp1-amd64.diff
memory/jemalloc/crtvc8sp1-intel.diff
memory/jemalloc/crtvc9sp1-amd64.diff
memory/jemalloc/crtvc9sp1-intel.diff
memory/jemalloc/ed.exe
memory/mozalloc/ld_malloc_wrappers.c
modules/libpref/src/init/all.js
--- a/Makefile.in
+++ b/Makefile.in
@@ -60,23 +60,25 @@ TIERS += base
 #
 tier_base_dirs = \
 	config \
 	build \
 	probes \
 	$(NULL)
 
 ifndef LIBXUL_SDK
-tier_base_dirs += \
-	memory \
-	$(NULL)
+ifdef MOZ_MEMORY
+tier_base_dirs += memory/jemalloc
+endif
+
 ifeq ($(OS_TARGET),Android)
 tier_base_dirs += other-licenses/android
 endif
 
+tier_base_dirs += memory/mozalloc
 endif
 
 ifdef COMPILE_ENVIRONMENT
 include $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk
 endif
 
 
 include $(topsrcdir)/config/config.mk
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -379,17 +379,17 @@ nsAccessibilityService::CreateHTMLObject
       return socketAccessible;
     }
 #endif
   }
 #endif
 
   // 3) for images and imagemaps, or anything else with a child frame
   // we have the object frame, get the image frame
-  nsIFrame* frame = aFrame->GetFirstChild(nsnull);
+  nsIFrame* frame = aFrame->GetFirstPrincipalChild();
   return frame ? frame->CreateAccessible() : nsnull;
 }
 
 already_AddRefed<nsAccessible>
 nsAccessibilityService::CreateHTMLRadioButtonAccessible(nsIContent* aContent,
                                                         nsIPresShell* aPresShell)
 {
   nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
--- a/accessible/src/base/nsAccessible.cpp
+++ b/accessible/src/base/nsAccessible.cpp
@@ -940,17 +940,17 @@ void nsAccessible::GetBoundsRect(nsRect&
     aTotalBounds.UnionRect(aTotalBounds, currFrameBounds);
 
     nsIFrame *iterNextFrame = nsnull;
 
     if (nsCoreUtils::IsCorrectFrameType(iterFrame,
                                         nsAccessibilityAtoms::inlineFrame)) {
       // Only do deeper bounds search if we're on an inline frame
       // Inline frames can contain larger frames inside of them
-      iterNextFrame = iterFrame->GetFirstChild(nsnull);
+      iterNextFrame = iterFrame->GetFirstPrincipalChild();
     }
 
     if (iterNextFrame) 
       ++depth;  // Child was found in code above this: We are going deeper in this iteration of the loop
     else {  
       // Use next sibling if it exists, or go back up the tree to get the first next-in-flow or next-sibling 
       // within our search
       while (iterFrame) {
--- a/accessible/src/html/nsHyperTextAccessible.cpp
+++ b/accessible/src/html/nsHyperTextAccessible.cpp
@@ -1702,17 +1702,17 @@ PRInt32 nsHyperTextAccessible::GetCaretL
     if (hyperTextContent == caretFrame->GetContent()) {
       return lineNumber; // Must be in a single line hyper text, there is no line iterator
     }
     nsIFrame *parentFrame = caretFrame->GetParent();
     if (!parentFrame)
       break;
 
     // Add lines for the sibling frames before the caret
-    nsIFrame *sibling = parentFrame->GetFirstChild(nsnull);
+    nsIFrame *sibling = parentFrame->GetFirstPrincipalChild();
     while (sibling && sibling != caretFrame) {
       nsAutoLineIterator lineIterForSibling = sibling->GetLineIterator();
       if (lineIterForSibling) {
         // For the frames before that grab all the lines
         PRInt32 addLines = lineIterForSibling->GetNumLines();
         lineNumber += addLines;
       }
       sibling = sibling->GetNextSibling();
--- a/browser/base/content/aboutDialog.js
+++ b/browser/base/content/aboutDialog.js
@@ -81,21 +81,21 @@ function init(aEvent)
   let currentLocale = chromeRegistry.getSelectedLocale("global");
   if (currentLocale != "en-US" && currentLocale != "en-GB") {
     document.getElementById("extra-trademark").hidden = true;
   }
 #endif
 
 #ifdef MOZ_UPDATER
   gAppUpdater = new appUpdater();
-#endif
 
   let defaults = Services.prefs.getDefaultBranch("");
   let channelLabel = document.getElementById("currentChannel");
   channelLabel.value = defaults.getCharPref("app.update.channel");
+#endif
 
 #ifdef XP_MACOSX
   // it may not be sized at this point, and we need its width to calculate its position
   window.sizeToContent();
   window.moveTo((screen.availWidth / 2) - (window.outerWidth / 2), screen.availHeight / 5);
 #endif
 }
 
--- a/browser/base/content/aboutDialog.xul
+++ b/browser/base/content/aboutDialog.xul
@@ -109,19 +109,21 @@
               </hbox>
               <hbox id="manualUpdate" align="center">
                 <label>&update.manual.start;</label><label id="manualLink" class="text-link"/><label>&update.manual.end;</label>
               </hbox>
             </deck>
 #endif
           </vbox>
 
+#ifdef MOZ_UPDATER
           <description class="text-blurb" id="currentChannelText">
             &channel.description.start;<label id="currentChannel"/>&channel.description.end;
           </description>
+#endif
           <description class="text-blurb" id="communityDesc">
             &community.start2;<label class="text-link" href="http://www.mozilla.org/">&community.mozillaLink;</label>&community.middle2;<label class="text-link" href="about:credits">&community.creditsLink;</label>&community.end2;
           </description>
           <description class="text-blurb" id="contributeDesc">
             &contribute.start;<label class="text-link" href="http://www.mozilla.org/contribute/">&contribute.getInvolvedLink;</label>&contribute.end;
           </description>
         </vbox>
       </vbox>
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -6280,24 +6280,25 @@ var IndexedDBPromptHelper = {
     }
 
     var requestor = subject.QueryInterface(Ci.nsIInterfaceRequestor);
 
     var contentWindow = requestor.getInterface(Ci.nsIDOMWindow);
     var contentDocument = contentWindow.document;
     var browserWindow =
       OfflineApps._getBrowserWindowForContentWindow(contentWindow);
+
+    if (browserWindow != window) {
+      // Must belong to some other window.
+      return;
+    }
+
     var browser =
       OfflineApps._getBrowserForContentWindow(browserWindow, contentWindow);
 
-    if (!browser) {
-      // Must belong to some other window.
-      return;
-    }
-
     var host = contentDocument.documentURIObject.asciiHost;
 
     var message;
     var responseTopic;
     if (topic == this._permissionsPrompt) {
       message = gNavigatorBundle.getFormattedString("offlineApps.available",
                                                     [ host ]);
       responseTopic = this._permissionsResponse;
--- a/browser/base/content/syncAddDevice.xul
+++ b/browser/base/content/syncAddDevice.xul
@@ -115,30 +115,30 @@
            onclick="gSyncAddDevice.goToSyncKeyPage();"/>
   </wizardpage>
 
   <!-- Need a non-empty label here, otherwise we get a default label on Mac -->
   <wizardpage id="syncKeyPage"
               label=" "
               onpageshow="gSyncAddDevice.onPageShow();">
     <description>
-      &addDevice.dialog.syncKey.label;
+      &addDevice.dialog.recoveryKey.label;
     </description>
     <spacer/>
 
     <groupbox>
-      <label value="&syncKeyEntry.label;"
-             accesskey="&syncKeyEntry.accesskey;"
+      <label value="&recoveryKeyEntry.label;"
+             accesskey="&recoveryKeyEntry.accesskey;"
              control="weavePassphrase"/>
       <textbox id="weavePassphrase"
                readonly="true"/>
     </groupbox>
 
     <groupbox align="center">
-      <description>&syncKeyBackup.description;</description>
+      <description>&recoveryKeyBackup.description;</description>
       <hbox>
         <button id="printSyncKeyButton"
                 label="&button.syncKeyBackup.print.label;"
                 accesskey="&button.syncKeyBackup.print.accesskey;"
                 oncommand="gSyncUtils.passphrasePrint('weavePassphrase');"/>
         <button id="saveSyncKeyButton"
                 label="&button.syncKeyBackup.save.label;"
                 accesskey="&button.syncKeyBackup.save.accesskey;"
--- a/browser/base/content/syncGenericChange.js
+++ b/browser/base/content/syncGenericChange.js
@@ -87,40 +87,40 @@ let Change = {
       Services.strings.createBundle("chrome://browser/locale/syncGenericChange.properties");
 
     switch (this._dialogType) {
       case "UpdatePassphrase":
       case "ResetPassphrase":
         document.getElementById("textBox1Row").hidden = true;
         document.getElementById("textBox2Row").hidden = true;
         document.getElementById("passphraseLabel").value
-          = this._str("new.synckey.label");
+          = this._str("new.recoverykey.label");
         document.getElementById("passphraseSpacer").hidden = false;
 
         if (this._updatingPassphrase) {
           document.getElementById("passphraseHelpBox").hidden = false;
-          document.title = this._str("new.synckey.title");
-          introText.textContent = this._str("new.synckey2.introText");
+          document.title = this._str("new.recoverykey.title");
+          introText.textContent = this._str("new.recoverykey.introText");
           this._dialog.getButton("finish").label
-            = this._str("new.synckey.acceptButton");
+            = this._str("new.recoverykey.acceptButton");
         }
         else {
           document.getElementById("generatePassphraseButton").hidden = false;
           document.getElementById("passphraseBackupButtons").hidden = false;
           this._passphraseBox.setAttribute("readonly", "true");
           let pp = Weave.Service.passphrase;
           if (Weave.Utils.isPassphrase(pp))
              pp = Weave.Utils.hyphenatePassphrase(pp);
           this._passphraseBox.value = pp;
           this._passphraseBox.focus();
-          document.title = this._str("change.synckey2.title");
+          document.title = this._str("change.recoverykey.title");
           introText.textContent = this._str("change.synckey.introText2");
-          warningText.textContent = this._str("change.synckey2.warningText");
+          warningText.textContent = this._str("change.recoverykey.warningText");
           this._dialog.getButton("finish").label
-            = this._str("change.synckey.acceptButton");
+            = this._str("change.recoverykey.acceptButton");
           if (this._duringSetup) {
             this._dialog.getButton("finish").disabled = false;
           }
         }
         break;
       case "ChangePassword":
         document.getElementById("passphraseRow").hidden = true;
         let box1label = document.getElementById("textBox1Label");
@@ -132,17 +132,17 @@ let Change = {
           introText.textContent = this._str("new.password.introText");
           this._dialog.getButton("finish").label
             = this._str("new.password.acceptButton");
           document.getElementById("textBox2Row").hidden = true;
         }
         else {
           document.title = this._str("change.password.title");
           box2label.value = this._str("new.password.confirm");
-          introText.textContent = this._str("change.password2.introText");
+          introText.textContent = this._str("change.password3.introText");
           warningText.textContent = this._str("change.password.warningText");
           this._dialog.getButton("finish").label
             = this._str("change.password.acceptButton");
         }
         break;
     }
     document.getElementById("change-page")
             .setAttribute("label", document.title);
@@ -190,30 +190,30 @@ let Change = {
     this._dialog.getButton("finish").disabled = false;
   },
 
   doChangePassphrase: function Change_doChangePassphrase() {
     let pp = Weave.Utils.normalizePassphrase(this._passphraseBox.value);
     if (this._updatingPassphrase) {
       Weave.Service.passphrase = pp;
       if (Weave.Service.login()) {
-        this._updateStatus("change.synckey2.success", "success");
+        this._updateStatus("change.recoverykey.success", "success");
         Weave.Service.persistLogin();
       }
       else {
         this._updateStatus("new.passphrase.status.incorrect", "error");
       }
     }
     else {
-      this._updateStatus("change.synckey.label", "active");
+      this._updateStatus("change.recoverykey.label", "active");
 
       if (Weave.Service.changePassphrase(pp))
-        this._updateStatus("change.synckey2.success", "success");
+        this._updateStatus("change.recoverykey.success", "success");
       else
-        this._updateStatus("change.synckey2.error", "error");
+        this._updateStatus("change.recoverykey.error", "error");
     }
 
     return false;
   },
 
   doChangePassword: function Change_doChangePassword() {
     if (this._currentPasswordInvalid) {
       Weave.Service.password = this._firstBox.value;
--- a/browser/base/content/syncGenericChange.xul
+++ b/browser/base/content/syncGenericChange.xul
@@ -133,17 +133,17 @@
               label="&button.syncKeyBackup.save.label;"
               accesskey="&button.syncKeyBackup.save.accesskey;"
               oncommand="gSyncUtils.passphraseSave('passphraseBox');"/>
     </hbox>
 
     <vbox id="passphraseHelpBox"
           hidden="true">
       <description>
-        &existingSyncKey.description;
+        &existingRecoveryKey.description;
         <label class="text-link"
                href="https://services.mozilla.com/sync/help/manual-setup">
           &addDevice.showMeHow.label;
         </label>
       </description>
     </vbox>
 
     <spacer id="passphraseSpacer"
--- a/browser/base/content/syncSetup.xul
+++ b/browser/base/content/syncSetup.xul
@@ -191,35 +191,35 @@
               &setup.tosAgree3.label;
             </description>
           </hbox>
         </row>
       </rows>
     </grid>
   </wizardpage>
 
-  <wizardpage label="&setup.newSyncKeyPage.title.label;"
+  <wizardpage label="&setup.newRecoveryKeyPage.title.label;"
               onextra1="gSyncSetup.onSyncOptions()"
               onpageshow="gSyncSetup.onPageShow();">
     <description>
-      &setup.newSyncKeyPage.description.label;
+      &setup.newRecoveryKeyPage.description.label;
     </description>
     <spacer/>
 
     <groupbox>
-      <label value="&syncKeyEntry.label;"
-             accesskey="&syncKeyEntry.accesskey;"
+      <label value="&recoveryKeyEntry.label;"
+             accesskey="&recoveryKeyEntry.accesskey;"
              control="weavePassphrase"/>
       <textbox id="weavePassphrase"
                readonly="true"
                onfocus="this.select();"/>
     </groupbox>
 
     <groupbox align="center">
-      <description>&syncKeyBackup.description;</description>
+      <description>&recoveryKeyBackup.description;</description>
       <hbox>
         <button id="printSyncKeyButton"
                 label="&button.syncKeyBackup.print.label;"
                 accesskey="&button.syncKeyBackup.print.accesskey;"
                 oncommand="gSyncUtils.passphrasePrint('weavePassphrase');"/>
         <button id="saveSyncKeyButton"
                 label="&button.syncKeyBackup.save.label;"
                 accesskey="&button.syncKeyBackup.save.accesskey;"
@@ -346,18 +346,18 @@
               </vbox>
             </hbox>
           </row>
         </rows>
       </grid>
 
     <groupbox>
       <label id="existingPassphraseLabel"
-             value="&signIn.syncKey.label;"
-             accesskey="&signIn.syncKey.accesskey;"
+             value="&signIn.recoveryKey.label;"
+             accesskey="&signIn.recoveryKey.accesskey;"
              control="existingPassphrase"/>
       <textbox id="existingPassphrase"
                oninput="gSyncSetup.checkFields()"/>
       <hbox id="login-throbber" hidden="true">
         <image/>
         <label value="&verifying.label;"/>
       </hbox>
       <vbox align="left" id="existingPassphraseFeedbackRow" hidden="true">
@@ -365,17 +365,17 @@
           <image class="statusIcon"/>
           <label class="status" value=" "/>
         </hbox>
       </vbox>
     </groupbox>
 
     <vbox id="passphraseHelpBox">
       <description>
-        &existingSyncKey.description;
+        &existingRecoveryKey.description;
         <label class="text-link"
                href="https://services.mozilla.com/sync/help/manual-setup">
           &addDevice.showMeHow.label;
         </label>
         <spacer id="passphraseHelpSpacer"/>
         <label class="text-link"
                onclick="gSyncSetup.resetPassphrase(); return false;">
           &resetSyncKey.label;
--- a/browser/base/content/syncUtils.js
+++ b/browser/base/content/syncUtils.js
@@ -188,18 +188,18 @@ let gSyncUtils = {
   },
 
   /**
    * Save passphrase backup document to disk as HTML file.
    * 
    * @param elid : ID of the form element containing the passphrase.
    */
   passphraseSave: function(elid) {
-    let dialogTitle = this.bundle.GetStringFromName("save.synckey.title");
-    let defaultSaveName = this.bundle.GetStringFromName("save.default.label");
+    let dialogTitle = this.bundle.GetStringFromName("save.recoverykey.title");
+    let defaultSaveName = this.bundle.GetStringFromName("save.recoverykey.defaultfilename");
     this._preparePPiframe(elid, function(iframe) {
       let filepicker = Cc["@mozilla.org/filepicker;1"]
                          .createInstance(Ci.nsIFilePicker);
       filepicker.init(window, dialogTitle, Ci.nsIFilePicker.modeSave);
       filepicker.appendFilters(Ci.nsIFilePicker.filterHTML);
       filepicker.defaultString = defaultSaveName;
       let rv = filepicker.show();
       if (rv == Ci.nsIFilePicker.returnOK
@@ -238,17 +238,17 @@ let gSyncUtils = {
       valid = val1.length >= Weave.MIN_PASS_LENGTH;
     else if (val1 && val1 == Weave.Service.username)
       error = "change.password.pwSameAsUsername";
     else if (val1 && val1 == Weave.Service.account)
       error = "change.password.pwSameAsEmail";
     else if (val1 && val1 == Weave.Service.password)
       error = "change.password.pwSameAsPassword";
     else if (val1 && val1 == Weave.Service.passphrase)
-      error = "change.password.pwSameAsSyncKey";
+      error = "change.password.pwSameAsRecoveryKey";
     else if (val1 && val2) {
       if (val1 == val2 && val1.length >= Weave.MIN_PASS_LENGTH)
         valid = true;
       else if (val1.length < Weave.MIN_PASS_LENGTH)
         error = "change.password.tooShort";
       else if (val1 != val2)
         error = "change.password.mismatch";
     }
--- a/browser/base/content/tabview/tabitems.js
+++ b/browser/base/content/tabview/tabitems.js
@@ -537,16 +537,18 @@ TabItem.prototype = Utils.extend(new Ite
     // don't allow zoom in if its group is hidden
     if (this.parent && this.parent.hidden)
       return;
 
     let self = this;
     let $tabEl = this.$container;
     let $canvas = this.$canvas;
 
+    hideSearch();
+
     UI.setActive(this);
     TabItems._update(this.tab, {force: true});
 
     // Zoom in!
     let tab = this.tab;
 
     function onZoomDone() {
       $canvas.css({ '-moz-transform': null });
--- a/browser/base/content/tabview/ui.js
+++ b/browser/base/content/tabview/ui.js
@@ -708,26 +708,24 @@ let UI = {
           self._privateBrowsing.wasInTabView = self.isTabViewVisible();
           if (self.isTabViewVisible())
             self.goToTab(gBrowser.selectedTab);
         }
       } else if (topic == "private-browsing-change-granted") {
         if (data == "enter" || data == "exit") {
           hideSearch();
           self._privateBrowsing.transitionMode = data;
-          self.storageBusy();
         }
       } else if (topic == "private-browsing-transition-complete") {
         // We use .transitionMode here, as aData is empty.
         if (self._privateBrowsing.transitionMode == "exit" &&
             self._privateBrowsing.wasInTabView)
           self.showTabView(false);
 
         self._privateBrowsing.transitionMode = "";
-        self.storageReady();
       }
     }
 
     Services.obs.addObserver(pbObserver, "private-browsing", false);
     Services.obs.addObserver(pbObserver, "private-browsing-change-granted", false);
     Services.obs.addObserver(pbObserver, "private-browsing-transition-complete", false);
 
     this._cleanupFunctions.push(function() {
@@ -864,18 +862,22 @@ let UI = {
 
   // ----------
   // Function: onTabSelect
   // Called when the user switches from one tab to another outside of the TabView UI.
   onTabSelect: function UI_onTabSelect(tab) {
     this._currentTab = tab;
 
     if (this.isTabViewVisible()) {
-      if (!this.restoredClosedTab && this._lastOpenedTab == tab && 
-        tab._tabViewTabItem) {
+      // We want to zoom in if:
+      // 1) we didn't just restore a tab via Ctrl+Shift+T
+      // 2) we're not in the middle of switching from/to private browsing
+      // 3) the currently selected tab is the last created tab and has a tabItem
+      if (!this.restoredClosedTab && !this._privateBrowsing.transitionMode &&
+          this._lastOpenedTab == tab && tab._tabViewTabItem) {
         tab._tabViewTabItem.zoomIn(true);
         this._lastOpenedTab = null;
         return;
       }
       if (this._closedLastVisibleTab ||
           (this._closedSelectedTabInTabView && !this.closedLastTabInTabView) ||
           this.restoredClosedTab) {
         if (this.restoredClosedTab) {
@@ -1125,28 +1127,36 @@ let UI = {
         self.ignoreKeypressForSearch = false;
         processBrowserKeys(event);
         return;
       }
 
       function getClosestTabBy(norm) {
         if (!self.getActiveTab())
           return null;
-        let centers =
-          [[item.bounds.center(), item]
-             for each(item in TabItems.getItems()) if (!item.parent || !item.parent.hidden)];
-        let myCenter = self.getActiveTab().bounds.center();
-        let matches = centers
-          .filter(function(item){return norm(item[0], myCenter)})
-          .sort(function(a,b){
-            return myCenter.distance(a[0]) - myCenter.distance(b[0]);
-          });
-        if (matches.length > 0)
-          return matches[0][1];
-        return null;
+
+        let activeTab = self.getActiveTab();
+        let activeTabGroup = activeTab.parent;
+        let myCenter = activeTab.bounds.center();
+        let match;
+
+        TabItems.getItems().forEach(function (item) {
+          if (!item.parent.hidden &&
+              (!activeTabGroup.expanded || activeTabGroup.id == item.parent.id)) {
+            let itemCenter = item.bounds.center();
+
+            if (norm(itemCenter, myCenter)) {
+              let itemDist = myCenter.distance(itemCenter);
+              if (!match || match[0] > itemDist)
+                match = [itemDist, item];
+            }
+          }
+        });
+
+        return match && match[1];
       }
 
       let preventDefault = true;
       let activeTab;
       let norm = null;
       switch (event.keyCode) {
         case KeyEvent.DOM_VK_RIGHT:
           norm = function(a, me){return a.x > me.x};
@@ -1497,17 +1507,17 @@ let UI = {
     if (isSearchEnabled()) {
       let matcher = createSearchTabMacher();
       let matches = matcher.matched();
 
       if (matches.length > 0) {
         matches[0].zoomIn();
         zoomedIn = true;
       }
-      hideSearch(null);
+      hideSearch();
     }
 
     if (!zoomedIn) {
       let unhiddenGroups = GroupItems.groupItems.filter(function(groupItem) {
         return (!groupItem.hidden && groupItem.getChildren().length > 0);
       });
       // no pinned tabs and no visible groups: open a new group. open a blank
       // tab and return
@@ -1608,21 +1618,25 @@ let UI = {
   },
 
   // ----------
   // Function: getFavIconUrlForTab
   // Gets fav icon url for the given xul:tab.
   getFavIconUrlForTab: function UI_getFavIconUrlForTab(tab) {
     let url;
 
-    // use the tab image if it doesn't start with http e.g. data:image/png, chrome://
-    if (tab.image && !(/^https?:/.test(tab.image)))
-      url = tab.image;
-    else
+    if (tab.image) {
+      // if starts with http/https, fetch icon from favicon service via the moz-anno protocal
+      if (/^https?:/.test(tab.image))
+        url = gFavIconService.getFaviconLinkForIcon(gWindow.makeURI(tab.image)).spec;
+      else
+        url = tab.image;
+    } else {
       url = gFavIconService.getFaviconImageForPage(tab.linkedBrowser.currentURI).spec;
+    }
 
     return url;
   },
 
   // ----------
   // Function: notifySessionRestoreEnabled
   // Notify the user that session restore has been automatically enabled
   // by showing a banner that expects no user interaction. It fades out after
--- a/browser/base/content/test/browser_sanitizeDialog.js
+++ b/browser/base/content/test/browser_sanitizeDialog.js
@@ -51,18 +51,16 @@
  */
 
 Cc["@mozilla.org/moz/jssubscript-loader;1"].
   getService(Ci.mozIJSSubScriptLoader).
   loadSubScript("chrome://browser/content/sanitize.js");
 
 const dm = Cc["@mozilla.org/download-manager;1"].
            getService(Ci.nsIDownloadManager);
-const bhist = Cc["@mozilla.org/browser/global-history;2"].
-              getService(Ci.nsIBrowserHistory);
 const formhist = Cc["@mozilla.org/satchel/form-history;1"].
                  getService(Ci.nsIFormHistory2);
 
 // Add tests here.  Each is a function that's called by doNextTest().
 var gAllTests = [
 
   /**
    * Initializes the dialog to its default state.
@@ -578,17 +576,17 @@ WindowHelper.prototype = {
         wh.win = win;
 
         executeSoon(function () {
           // Some exceptions that reach here don't reach the test harness, but
           // ok()/is() do...
           try {
             if (wh.onunload)
               wh.onunload();
-            doNextTest();
+            waitForAsyncUpdates(doNextTest);
           }
           catch (exc) {
             win.close();
             ok(false, "Unexpected exception: " + exc + "\n" + exc.stack);
             finish();
           }
         });
       }, false);
@@ -693,35 +691,70 @@ function addFormEntryWithMinutesAgo(aMin
 /**
  * Adds a history visit to history.
  *
  * @param aMinutesAgo
  *        The visit will be visited this many minutes ago
  */
 function addHistoryWithMinutesAgo(aMinutesAgo) {
   let pURI = makeURI("http://" + aMinutesAgo + "-minutes-ago.com/");
-  bhist.addPageWithDetails(pURI,
-                           aMinutesAgo + " minutes ago",
-                           now_uSec - (aMinutesAgo * 60 * 1000 * 1000));
-  is(bhist.isVisited(pURI), true,
+  PlacesUtils.bhistory
+             .addPageWithDetails(pURI,
+                                 aMinutesAgo + " minutes ago",
+                                 now_uSec - (aMinutesAgo * 60 * 1000 * 1000));
+  is(PlacesUtils.bhistory.isVisited(pURI), true,
      "Sanity check: history visit " + pURI.spec +
      " should exist after creating it");
   return pURI;
 }
 
 /**
  * Removes all history visits, downloads, and form entries.
  */
 function blankSlate() {
-  bhist.removeAllPages();
+  PlacesUtils.bhistory.removeAllPages();
   dm.cleanUp();
   formhist.removeAllEntries();
 }
 
 /**
+ * Waits for all pending async statements on the default connection, before
+ * proceeding with aCallback.
+ *
+ * @param aCallback
+ *        Function to be called when done.
+ * @param aScope
+ *        Scope for the callback.
+ * @param aArguments
+ *        Arguments array for the callback.
+ *
+ * @note The result is achieved by asynchronously executing a query requiring
+ *       a write lock.  Since all statements on the same connection are
+ *       serialized, the end of this write operation means that all writes are
+ *       complete.  Note that WAL makes so that writers don't block readers, but
+ *       this is a problem only across different connections.
+ */
+function waitForAsyncUpdates(aCallback, aScope, aArguments)
+{
+  let scope = aScope || this;
+  let args = aArguments || [];
+  let db = PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase)
+                              .DBConnection;
+  db.createAsyncStatement("BEGIN EXCLUSIVE").executeAsync();
+  db.createAsyncStatement("COMMIT").executeAsync({
+    handleResult: function() {},
+    handleError: function() {},
+    handleCompletion: function(aReason)
+    {
+      aCallback.apply(scope, args);
+    }
+  });
+}
+
+/**
  * Ensures that the given pref is the expected value.
  *
  * @param aPrefName
  *        The pref's sub-branch under the privacy branch
  * @param aExpectedVal
  *        The pref's expected value
  * @param aMsg
  *        Passed to is()
@@ -753,17 +786,17 @@ function downloadExists(aID)
 
 /**
  * Runs the next test in the gAllTests array.  If all tests have been run,
  * finishes the entire suite.
  */
 function doNextTest() {
   if (gAllTests.length <= gCurrTest) {
     blankSlate();
-    finish();
+    waitForAsyncUpdates(finish);
   }
   else {
     let ct = gCurrTest;
     gCurrTest++;
     gAllTests[ct]();
   }
 }
 
@@ -805,17 +838,17 @@ function ensureFormEntriesClearedState(a
  * @param aURIs
  *        Array of page URIs
  * @param aShouldBeCleared
  *        True if each visit to the URI should be cleared, false otherwise
  */
 function ensureHistoryClearedState(aURIs, aShouldBeCleared) {
   let niceStr = aShouldBeCleared ? "no longer" : "still";
   aURIs.forEach(function (aURI) {
-    is(bhist.isVisited(aURI), !aShouldBeCleared,
+    is(PlacesUtils.bhistory.isVisited(aURI), !aShouldBeCleared,
        "history visit " + aURI.spec + " should " + niceStr + " exist");
   });
 }
 
 /**
  * Ensures that the given pref is the expected value.
  *
  * @param aPrefName
@@ -831,10 +864,10 @@ function intPrefIs(aPrefName, aExpectedV
 
 ///////////////////////////////////////////////////////////////////////////////
 
 function test() {
   requestLongerTimeout(2);
   blankSlate();
   waitForExplicitFinish();
   // Kick off all the tests in the gAllTests array.
-  doNextTest();
+  waitForAsyncUpdates(doNextTest);
 }
--- a/browser/base/content/test/browser_sanitizeDialog_treeView.js
+++ b/browser/base/content/test/browser_sanitizeDialog_treeView.js
@@ -50,18 +50,16 @@
  */
 
 Cc["@mozilla.org/moz/jssubscript-loader;1"].
   getService(Ci.mozIJSSubScriptLoader).
   loadSubScript("chrome://browser/content/sanitize.js");
 
 const dm = Cc["@mozilla.org/download-manager;1"].
            getService(Ci.nsIDownloadManager);
-const bhist = Cc["@mozilla.org/browser/global-history;2"].
-              getService(Ci.nsIBrowserHistory);
 const formhist = Cc["@mozilla.org/satchel/form-history;1"].
                  getService(Ci.nsIFormHistory2);
 
 // Add tests here.  Each is a function that's called by doNextTest().
 var gAllTests = [
 
   /**
    * Moves the grippy around, makes sure it works OK.
@@ -497,35 +495,70 @@ function addFormEntryWithMinutesAgo(aMin
 /**
  * Adds a history visit to history.
  *
  * @param aMinutesAgo
  *        The visit will be visited this many minutes ago
  */
 function addHistoryWithMinutesAgo(aMinutesAgo) {
   let pURI = makeURI("http://" + aMinutesAgo + "-minutes-ago.com/");
-  bhist.addPageWithDetails(pURI,
-                           aMinutesAgo + " minutes ago",
-                           now_uSec - (aMinutesAgo * 60 * 1000 * 1000));
-  is(bhist.isVisited(pURI), true,
+  PlacesUtils.bhistory
+             .addPageWithDetails(pURI,
+                                 aMinutesAgo + " minutes ago",
+                                 now_uSec - (aMinutesAgo * 60 * 1000 * 1000));
+  is(PlacesUtils.bhistory.isVisited(pURI), true,
      "Sanity check: history visit " + pURI.spec +
      " should exist after creating it");
   return pURI;
 }
 
 /**
  * Removes all history visits, downloads, and form entries.
  */
 function blankSlate() {
-  bhist.removeAllPages();
+  PlacesUtils.bhistory.removeAllPages();
   dm.cleanUp();
   formhist.removeAllEntries();
 }
 
 /**
+ * Waits for all pending async statements on the default connection, before
+ * proceeding with aCallback.
+ *
+ * @param aCallback
+ *        Function to be called when done.
+ * @param aScope
+ *        Scope for the callback.
+ * @param aArguments
+ *        Arguments array for the callback.
+ *
+ * @note The result is achieved by asynchronously executing a query requiring
+ *       a write lock.  Since all statements on the same connection are
+ *       serialized, the end of this write operation means that all writes are
+ *       complete.  Note that WAL makes so that writers don't block readers, but
+ *       this is a problem only across different connections.
+ */
+function waitForAsyncUpdates(aCallback, aScope, aArguments)
+{
+  let scope = aScope || this;
+  let args = aArguments || [];
+  let db = PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase)
+                              .DBConnection;
+  db.createAsyncStatement("BEGIN EXCLUSIVE").executeAsync();
+  db.createAsyncStatement("COMMIT").executeAsync({
+    handleResult: function() {},
+    handleError: function() {},
+    handleCompletion: function(aReason)
+    {
+      aCallback.apply(scope, args);
+    }
+  });
+}
+
+/**
  * Checks to see if the download with the specified ID exists.
  *
  * @param  aID
  *         The ID of the download to check
  * @return True if the download exists, false otherwise
  */
 function downloadExists(aID)
 {
@@ -543,17 +576,17 @@ function downloadExists(aID)
 
 /**
  * Runs the next test in the gAllTests array.  If all tests have been run,
  * finishes the entire suite.
  */
 function doNextTest() {
   if (gAllTests.length <= gCurrTest) {
     blankSlate();
-    finish();
+    waitForAsyncUpdates(finish);
   }
   else {
     let ct = gCurrTest;
     gCurrTest++;
     gAllTests[ct]();
   }
 }
 
@@ -595,17 +628,17 @@ function ensureFormEntriesClearedState(a
  * @param aURIs
  *        Array of page URIs
  * @param aShouldBeCleared
  *        True if each visit to the URI should be cleared, false otherwise
  */
 function ensureHistoryClearedState(aURIs, aShouldBeCleared) {
   let niceStr = aShouldBeCleared ? "no longer" : "still";
   aURIs.forEach(function (aURI) {
-    is(bhist.isVisited(aURI), !aShouldBeCleared,
+    is(PlacesUtils.bhistory.isVisited(aURI), !aShouldBeCleared,
        "history visit " + aURI.spec + " should " + niceStr + " exist");
   });
 }
 
 /**
  * Opens the sanitize dialog and runs a callback once it's finished loading.
  * 
  * @param aOnloadCallback
@@ -620,17 +653,17 @@ function openWindow(aOnloadCallback) {
     let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
     win.addEventListener("load", function onload(event) {
       win.removeEventListener("load", onload, false);
       executeSoon(function () {
         // Some exceptions that reach here don't reach the test harness, but
         // ok()/is() do...
         try {
           aOnloadCallback(win);
-          doNextTest();
+          waitForAsyncUpdates(doNextTest);
         }
         catch (exc) {
           win.close();
           ok(false, "Unexpected exception: " + exc + "\n" + exc.stack);
           finish();
         }
       });
     }, false);
@@ -644,10 +677,10 @@ function openWindow(aOnloadCallback) {
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 
 function test() {
   blankSlate();
   waitForExplicitFinish();
   // Kick off all the tests in the gAllTests array.
-  doNextTest();
+  waitForAsyncUpdates(doNextTest);
 }
--- a/browser/base/content/test/tabview/Makefile.in
+++ b/browser/base/content/test/tabview/Makefile.in
@@ -115,16 +115,17 @@ include $(topsrcdir)/config/rules.mk
                  browser_tabview_bug626525.js \
                  browser_tabview_bug626791.js \
                  browser_tabview_bug627239.js \
                  browser_tabview_bug627288.js \
                  browser_tabview_bug627736.js \
                  browser_tabview_bug628061.js \
                  browser_tabview_bug628165.js \
                  browser_tabview_bug628270.js \
+                 browser_tabview_bug628887.js \
                  browser_tabview_bug629189.js \
                  browser_tabview_bug629195.js \
                  browser_tabview_bug630102.js \
                  browser_tabview_bug630157.js \
                  browser_tabview_bug631662.js \
                  browser_tabview_bug631752.js \
                  browser_tabview_bug633788.js \
                  browser_tabview_bug634077.js \
@@ -149,16 +150,18 @@ include $(topsrcdir)/config/rules.mk
                  browser_tabview_bug656778.js \
                  browser_tabview_bug656913.js \
                  browser_tabview_bug662266.js \
                  browser_tabview_bug663421.js \
                  browser_tabview_bug665502.js \
                  browser_tabview_bug669694.js \
                  browser_tabview_bug673196.js \
                  browser_tabview_bug673729.js \
+                 browser_tabview_bug679853.js \
+                 browser_tabview_bug681599.js \
                  browser_tabview_click_group.js \
                  browser_tabview_dragdrop.js \
                  browser_tabview_exit_button.js \
                  browser_tabview_expander.js \
                  browser_tabview_firstrun_pref.js \
                  browser_tabview_group.js \
                  browser_tabview_launch.js \
                  browser_tabview_multiwindow_search.js \
--- a/browser/base/content/test/tabview/browser_tabview_bug600645.js
+++ b/browser/base/content/test/tabview/browser_tabview_bug600645.js
@@ -35,18 +35,28 @@ function onTabViewWindowLoaded() {
 
   let errorHandler = function(event) {
     newTab.removeEventListener("error", errorHandler, false);
 
     // since the browser code and test code are invoked when an error event is 
     // fired, a delay is used here to avoid the test code run before the browser 
     // code.
     executeSoon(function() {
-      is($icon.attr("src"), fi.defaultFavicon.spec,
-         "The icon is showing the default fav icon");
+      let iconSrc = $icon.attr("src");
+      let hasData = true;
+      try {
+        fi.getFaviconDataAsDataURL(iconSrc);
+      } catch(e) {
+        hasData = false;
+      }
+      ok(!hasData, "The icon src doesn't return any data");
+      // with moz-anno:favicon automatically redirects to the default favIcon 
+      // if the given url is invalid
+      ok(/^moz-anno:favicon:/.test(iconSrc),
+         "The icon url starts with moz-anno:favicon so the default fav icon would be displayed");
 
       // clean up
       gBrowser.removeTab(newTab);
       let endGame = function() {
         window.removeEventListener("tabviewhidden", endGame, false);
 
         ok(!TabView.isVisible(), "Tab View is hidden");
         finish();
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/tabview/browser_tabview_bug628887.js
@@ -0,0 +1,50 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+function test() {
+  waitForExplicitFinish();
+
+  newWindowWithTabView(function(win) {
+    registerCleanupFunction(function() win.close());
+
+    let cw = win.TabView.getContentWindow();
+    let groupItemOne = cw.GroupItems.groupItems[0];
+
+    let groupItemTwo = createGroupItemWithBlankTabs(win, 100, 100, 40, 2);
+    ok(groupItemTwo.isStacked(), "groupItem is now stacked");
+
+    is(win.gBrowser.tabs.length, 3, "There are three tabs");
+
+    // the focus should remain within the group after it's expanded
+    groupItemTwo.addSubscriber("expanded", function onExpanded() {
+      groupItemTwo.removeSubscriber("expanded", onExpanded);
+
+      ok(groupItemTwo.expanded, "groupItemTwo is expanded");
+      is(cw.UI.getActiveTab(), groupItemTwo.getChild(0),
+         "The first tab item in group item two is active in expanded mode");
+
+      EventUtils.synthesizeKey("VK_DOWN", {}, cw);
+      is(cw.UI.getActiveTab(), groupItemTwo.getChild(0),
+         "The first tab item is still active after pressing down key");
+
+      // the focus should goes to other group if the down arrow is pressed
+      groupItemTwo.addSubscriber("collapsed", function onExpanded() {
+        groupItemTwo.removeSubscriber("collapsed", onExpanded);
+
+        ok(!groupItemTwo.expanded, "groupItemTwo is not expanded");
+        is(cw.UI.getActiveTab(), groupItemTwo.getChild(0),
+           "The first tab item is active in group item two in collapsed mode");
+
+        EventUtils.synthesizeKey("VK_DOWN", {}, cw);
+        is(cw.UI.getActiveTab(), groupItemOne.getChild(0),
+           "The first tab item in group item one is active after pressing down key");
+
+        finish();
+      });
+
+      groupItemTwo.collapse();
+    });
+
+    groupItemTwo.expand();
+  });
+}
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/tabview/browser_tabview_bug679853.js
@@ -0,0 +1,32 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+function test() {
+  waitForExplicitFinish();
+
+  // clean up after ourselves
+  registerCleanupFunction(function () {
+    while (gBrowser.tabs.length > 1)
+      gBrowser.removeTab(gBrowser.tabs[1]);
+
+    hideTabView();
+  });
+
+  // select the new tab
+  gBrowser.selectedTab = gBrowser.addTab();
+
+  showTabView(function () {
+    // enter private browsing mode
+    togglePrivateBrowsing(function () {
+      ok(!TabView.isVisible(), "tabview is hidden");
+
+      showTabView(function () {
+        // leave private browsing mode
+        togglePrivateBrowsing(function () {
+          ok(TabView.isVisible(), "tabview is visible");
+          hideTabView(finish);
+        });
+      });
+    });
+  });
+}
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/tabview/browser_tabview_bug681599.js
@@ -0,0 +1,31 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+function test() {
+  waitForExplicitFinish();
+
+  showTabView(function() {
+    let cw = TabView.getContentWindow();
+
+    registerCleanupFunction(function () {
+      while (gBrowser.tabs.length > 1)
+        gBrowser.removeTab(gBrowser.tabs[1]);
+      hideTabView();
+    })
+
+    whenSearchIsEnabled(function() {
+      ok(cw.isSearchEnabled(), "The search is enabled before creating a new tab");
+
+      whenTabViewIsHidden(function() {
+        showTabView(function() {
+          ok(!cw.isSearchEnabled(), "The search is disabled when entering Tabview");
+
+          hideTabView(finish);
+        })
+      });
+      EventUtils.synthesizeKey("t", { accelKey: true }, cw);
+    });
+
+    EventUtils.synthesizeKey("VK_SLASH", {}, cw);
+  });
+}
--- a/browser/components/places/content/controller.js
+++ b/browser/components/places/content/controller.js
@@ -1371,25 +1371,33 @@ let PlacesControllerDragHelper = {
   /**
    * @returns The current active drag session. Returns null if there is none.
    */
   getSession: function PCDH__getSession() {
     return this.dragService.getCurrentSession();
   },
 
   /**
-   * Extract the first accepted flavor from a flavors array.
+   * Extract the first accepted flavor from a list of flavors.
    * @param aFlavors
-   *        The flavors array.
+   *        The flavors list of type nsIDOMDOMStringList.
    */
   getFirstValidFlavor: function PCDH_getFirstValidFlavor(aFlavors) {
     for (let i = 0; i < aFlavors.length; i++) {
       if (this.GENERIC_VIEW_DROP_TYPES.indexOf(aFlavors[i]) != -1)
         return aFlavors[i];
     }
+
+    // If no supported flavor is found, check if data includes text/plain 
+    // contents.  If so, request them as text/unicode, a conversion will happen 
+    // automatically.
+    if (aFlavors.contains("text/plain")) {
+        return PlacesUtils.TYPE_UNICODE;
+    }
+
     return null;
   },
 
   /**
    * Determines whether or not the data currently being dragged can be dropped
    * on a places view.
    * @param ip
    *        The insertion point where the items should be dropped.
--- a/browser/components/places/tests/browser/Makefile.in
+++ b/browser/components/places/tests/browser/Makefile.in
@@ -43,16 +43,17 @@ relativesrcdir  = browser/components/pla
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
 _BROWSER_TEST_FILES = \
 	head.js \
 	browser_0_library_left_pane_migration.js \
 	browser_library_left_pane_fixnames.js \
 	browser_425884.js \
+	browser_475045.js \
 	browser_423515.js \
 	browser_410196_paste_into_tags.js \
 	browser_457473_no_copy_guid.js \
 	browser_sort_in_library.js \
 	browser_library_open_leak.js \
 	browser_library_panel_leak.js \
 	browser_library_search.js \
 	browser_history_sidebar_search.js \
new file mode 100644
--- /dev/null
+++ b/browser/components/places/tests/browser/browser_475045.js
@@ -0,0 +1,59 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+function test() {
+  // Make sure the bookmarks bar is visible and restore its state on cleanup.
+  let toolbar = document.getElementById("PersonalToolbar");
+  ok(toolbar, "PersonalToolbar should not be null");
+
+  if (toolbar.collapsed) {
+    setToolbarVisibility(toolbar, true);
+    registerCleanupFunction(function() {
+      setToolbarVisibility(toolbar, false);
+    });
+  }
+
+  // Setup the node we will use to be dropped. The actual node used does not
+  // matter because we will set its data, effect, and mimeType manually.
+  let placesItems = document.getElementById("PlacesToolbarItems");
+  ok(placesItems, "PlacesToolbarItems should not be null");
+  ok(placesItems.localName == "scrollbox", "PlacesToolbarItems should not be null");
+  ok(placesItems.childNodes[0], "PlacesToolbarItems must have at least one child");
+
+  /** 
+   * Simulates a drop of a URI onto the bookmarks bar.
+   * 
+   * @param aEffect
+   *        The effect to use for the drop operation: move, copy, or link.
+   * @param aMimeType
+   *        The mime type to use for the drop operation.
+   */
+  let simulateDragDrop = function(aEffect, aMimeType) {
+    const uriSpec = "http://www.mozilla.org/D1995729-A152-4e30-8329-469B01F30AA7";
+    let uri = makeURI(uriSpec);
+    EventUtils.synthesizeDrop(placesItems.childNodes[0], 
+                              placesItems, 
+                              [[{type: aMimeType, 
+                                data: uriSpec}]], 
+                              aEffect, window);
+
+    // Verify that the drop produces exactly one bookmark.
+    let bookmarkIds = PlacesUtils.bookmarks
+                      .getBookmarkIdsForURI(uri);
+    ok(bookmarkIds.length == 1, "There should be exactly one bookmark");
+    
+    PlacesUtils.bookmarks.removeItem(bookmarkIds[0]);
+
+    // Verify that we removed the bookmark successfully.
+    ok(!PlacesUtils.bookmarks.isBookmarked(uri), "URI should be removed");
+  } 
+  
+  // Simulate a bookmark drop for all of the mime types and effects.
+  let mimeTypes = ["text/plain", "text/unicode", "text/x-moz-url"];
+  let effects = ["move", "copy", "link"];
+  effects.forEach(function (effect) {
+    mimeTypes.forEach(function (mimeType) {
+      simulateDragDrop(effect, mimeType);
+    });
+  });
+}
--- a/browser/components/places/tests/browser/browser_bookmarksProperties.js
+++ b/browser/components/places/tests/browser/browser_bookmarksProperties.js
@@ -531,17 +531,17 @@ function test() {
 }
 
 function runNextTest() {
   // Cleanup from previous test.
   if (gCurrentTest) {
     gCurrentTest.cleanup();
     info("End of test: " + gCurrentTest.desc);
     gCurrentTest = null;
-    executeSoon(runNextTest);
+    waitForAsyncUpdates(runNextTest);
     return;
   }
 
   if (gTests.length > 0) {
     // Goto next tests.
     gCurrentTest = gTests.shift();
     info("Start of test: " + gCurrentTest.desc);
     gCurrentTest.setup();
--- a/browser/components/places/tests/browser/browser_library_infoBox.js
+++ b/browser/components/places/tests/browser/browser_library_infoBox.js
@@ -141,18 +141,17 @@ gTests.push({
     checkInfoBoxSelected(PO);
     ok(!infoBoxExpanderWrapper.hidden,
        "Expander button is not hidden for second bookmark item.");
     checkAddInfoFieldsNotCollapsed(PO);
     checkAddInfoFields(PO, "second bookmark item");
 
     menuNode.containerOpen = false;
 
-    bhist.removeAllPages();
-    nextTest();
+    waitForClearHistory(nextTest);
   }
 });
 
 function checkInfoBoxSelected(PO) {
   is(getAndCheckElmtById("detailsDeck").selectedIndex, 1,
      "Selected element in detailsDeck is infoBox.");
 }
 
--- a/browser/components/places/tests/browser/head.js
+++ b/browser/components/places/tests/browser/head.js
@@ -24,15 +24,56 @@ function openLibrary(callback, aLeftPane
                                   aLeftPaneRoot);
   waitForFocus(function () {
     callback(library);
   }, library);
 
   return library;
 }
 
+/**
+ * Waits for completion of a clear history operation, before
+ * proceeding with aCallback.
+ *
+ * @param aCallback
+ *        Function to be called when done.
+ */
 function waitForClearHistory(aCallback) {
   Services.obs.addObserver(function observeCH(aSubject, aTopic, aData) {
     Services.obs.removeObserver(observeCH, PlacesUtils.TOPIC_EXPIRATION_FINISHED);
     aCallback();
   }, PlacesUtils.TOPIC_EXPIRATION_FINISHED, false);
   PlacesUtils.bhistory.removeAllPages();
 }
+
+/**
+ * Waits for all pending async statements on the default connection, before
+ * proceeding with aCallback.
+ *
+ * @param aCallback
+ *        Function to be called when done.
+ * @param aScope
+ *        Scope for the callback.
+ * @param aArguments
+ *        Arguments array for the callback.
+ *
+ * @note The result is achieved by asynchronously executing a query requiring
+ *       a write lock.  Since all statements on the same connection are
+ *       serialized, the end of this write operation means that all writes are
+ *       complete.  Note that WAL makes so that writers don't block readers, but
+ *       this is a problem only across different connections.
+ */
+function waitForAsyncUpdates(aCallback, aScope, aArguments)
+{
+  let scope = aScope || this;
+  let args = aArguments || [];
+  let db = PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase)
+                              .DBConnection;
+  db.createAsyncStatement("BEGIN EXCLUSIVE").executeAsync();
+  db.createAsyncStatement("COMMIT").executeAsync({
+    handleResult: function() {},
+    handleError: function() {},
+    handleCompletion: function(aReason)
+    {
+      aCallback.apply(scope, args);
+    }
+  });
+}
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placestitle.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placestitle.js
@@ -37,89 +37,73 @@
 
 // This test makes sure that the title of existing history entries does not
 // change inside the private browsing mode.
 
 function test() {
   // initialization
   let pb = Cc["@mozilla.org/privatebrowsing;1"].
            getService(Ci.nsIPrivateBrowsingService);
-  let bhist = Cc["@mozilla.org/browser/global-history;2"].
-              getService(Ci.nsIBrowserHistory);
-  let histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].
-                getService(Ci.nsINavHistoryService).
-                QueryInterface(Ci.nsPIPlacesDatabase);
   let cm = Cc["@mozilla.org/cookiemanager;1"].
            getService(Ci.nsICookieManager);
   waitForExplicitFinish();
 
   const TEST_URL = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/title.sjs";
 
-  function cleanup() {
-    // delete all history items
-    bhist.removeAllPages();
+  function waitForCleanup(aCallback) {
     // delete all cookies
     cm.removeAll();
+    // delete all history items
+    waitForClearHistory(aCallback);
   }
-  cleanup();
 
   let observer = {
     pass: 1,
-    onBeginUpdateBatch: function() {
-    },
-    onEndUpdateBatch: function() {
-    },
-    onVisit: function(aURI, aVisitID, aTime, aSessionId, aReferringId,
-                      aTransitionType, _added) {
-    },
     onTitleChanged: function(aURI, aPageTitle) {
       if (aURI.spec != TEST_URL)
         return;
       switch (this.pass++) {
       case 1: // the first time that the page is loaded
         is(aPageTitle, "No Cookie", "The page should be loaded without any cookie for the first time");
         gBrowser.selectedTab = gBrowser.addTab(TEST_URL);
         break;
       case 2: // the second time that the page is loaded
         is(aPageTitle, "Cookie", "The page should be loaded with a cookie for the second time");
-        cleanup();
-        gBrowser.selectedTab = gBrowser.addTab(TEST_URL);
+        waitForCleanup(function () {
+          gBrowser.selectedTab = gBrowser.addTab(TEST_URL);
+        });
         break;
       case 3: // before entering the private browsing mode
         is(aPageTitle, "No Cookie", "The page should be loaded without any cookie again");
         // enter private browsing mode
         pb.privateBrowsingEnabled = true;
         gBrowser.selectedTab = gBrowser.addTab(TEST_URL);
         executeSoon(function() {
-          histsvc.removeObserver(observer);
+          PlacesUtils.history.removeObserver(observer);
           pb.privateBrowsingEnabled = false;
-          while (gBrowser.browsers.length > 1)
+          while (gBrowser.browsers.length > 1) {
             gBrowser.removeCurrentTab();
-          cleanup();
-          finish();
+          }
+          waitForCleanup(finish);
         });
         break;
       default:
         ok(false, "Unexpected pass: " + (this.pass - 1));
       }
     },
-    onBeforeDeleteURI: function(aURI) {
-    },
-    onDeleteURI: function(aURI) {
-    },
-    onClearHistory: function() {
-    },
-    onPageChanged: function(aURI, aWhat, aValue) {
-    },
-    onDeleteVisits: function() {
-    },
-    QueryInterface: function(iid) {
-      if (iid.equals(Ci.nsINavHistoryObserver) ||
-          iid.equals(Ci.nsISupports)) {
-        return this;
-      }
-      throw Cr.NS_ERROR_NO_INTERFACE;
-    }
+
+    onBeginUpdateBatch: function () {},
+    onEndUpdateBatch: function () {},
+    onVisit: function () {},
+    onBeforeDeleteURI: function () {},
+    onDeleteURI: function () {},
+    onClearHistory: function () {},
+    onPageChanged: function () {},
+    onDeleteVisits: function() {},
+
+    QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver])
   };
-  histsvc.addObserver(observer, false);
+  PlacesUtils.history.addObserver(observer, false);
 
-  gBrowser.selectedTab = gBrowser.addTab(TEST_URL);
+  waitForCleanup(function () {
+    gBrowser.selectedTab = gBrowser.addTab(TEST_URL);
+  });
 }
--- a/browser/components/privatebrowsing/test/browser/head.js
+++ b/browser/components/privatebrowsing/test/browser/head.js
@@ -4,8 +4,22 @@ registerCleanupFunction(function() {
            getService(Ci.nsIPrivateBrowsingService);
   ok(!pb.privateBrowsingEnabled, "Private browsing should be terminated after finishing the test");
   pb.privateBrowsingEnabled = false;
   try {
     Services.prefs.clearUserPref("browser.privatebrowsing.keep_current_session");
   } catch(e) {}
 });
 
+/**
+ * Waits for completion of a clear history operation, before
+ * proceeding with aCallback.
+ *
+ * @param aCallback
+ *        Function to be called when done.
+ */
+function waitForClearHistory(aCallback) {
+  Services.obs.addObserver(function observeCH(aSubject, aTopic, aData) {
+    Services.obs.removeObserver(observeCH, PlacesUtils.TOPIC_EXPIRATION_FINISHED);
+    aCallback();
+  }, PlacesUtils.TOPIC_EXPIRATION_FINISHED, false);
+  PlacesUtils.bhistory.removeAllPages();
+}
--- a/browser/installer/Makefile.in
+++ b/browser/installer/Makefile.in
@@ -83,20 +83,16 @@ ifdef MOZ_ANGLE
 DEFINES += -DMOZ_ANGLE=$(MOZ_ANGLE)
 DEFINES += -DMOZ_D3DX9_DLL=$(MOZ_D3DX9_DLL)
 DEFINES += -DMOZ_D3DCOMPILER_DLL=$(MOZ_D3DCOMPILER_DLL)
 endif
 
 include $(topsrcdir)/ipc/app/defs.mk
 DEFINES += -DMOZ_CHILD_PROCESS_NAME=$(MOZ_CHILD_PROCESS_NAME)
 
-ifdef WIN32_OLD_STYLE_JEMALLOC
-DEFINES += -DWIN32_OLD_STYLE_JEMALLOC=1
-endif
-
 ifneq (,$(filter aurora beta,$(MOZ_UPDATE_CHANNEL)))
 DEFINES += -DSHIP_FEEDBACK=1
 endif
 
 ifdef MOZ_PKG_MANIFEST_P
 MOZ_PKG_MANIFEST = package-manifest
 
 $(MOZ_PKG_MANIFEST): $(MOZ_PKG_MANIFEST_P) $(GLOBAL_DEPS)
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -56,24 +56,18 @@
 #ifdef XP_MACOSX
 @BINPATH@/@MOZ_CHILD_PROCESS_NAME@.app/
 @BINPATH@/@DLL_PREFIX@plugin_child_interpose@DLL_SUFFIX@
 #else
 @BINPATH@/@MOZ_CHILD_PROCESS_NAME@
 #endif
 #ifdef XP_WIN32
 #ifdef MOZ_MEMORY
-#ifdef WIN32_OLD_STYLE_JEMALLOC
-@BINPATH@/mozcrt19.dll
-@BINPATH@/mozcpp19.dll
-#else
 @BINPATH@/jemalloc.dll
 #endif
-#endif
-#else
 #if _MSC_VER == 1400
 @BINPATH@/Microsoft.VC80.CRT.manifest
 @BINPATH@/msvcm80.dll
 @BINPATH@/msvcp80.dll
 @BINPATH@/msvcr80.dll
 #elif _MSC_VER == 1500
 @BINPATH@/Microsoft.VC90.CRT.manifest
 @BINPATH@/msvcm90.dll
--- a/browser/installer/removed-files.in
+++ b/browser/installer/removed-files.in
@@ -1267,24 +1267,18 @@ xpicleanup@BIN_SUFFIX@
   res/fonts/mathfontSymbol.properties
 #endif
 #ifdef XP_WIN
   components/brwsrcmp.dll
   components/jsd3250.dll
   components/nsPostUpdateWin.js
   js3250.dll
   plugins/npnul32.dll
-  #ifdef MOZ_MEMORY
-    Microsoft.VC80.CRT.manifest
-    msvcm80.dll
-    msvcp80.dll
-    msvcr80.dll
-  #else
-    mozcrt19.dll
-  #endif
+  mozcrt19.dll
+  mozcpp19.dll
 #endif
 @DLL_PREFIX@xpcom_core@DLL_SUFFIX@
 components/@DLL_PREFIX@jar50@DLL_SUFFIX@
 #ifdef XP_WIN
   components/xpinstal.dll
 #else
   components/@DLL_PREFIX@jsd@DLL_SUFFIX@
   components/@DLL_PREFIX@xpinstall@DLL_SUFFIX@
--- a/browser/locales/en-US/chrome/browser/syncGenericChange.properties
+++ b/browser/locales/en-US/chrome/browser/syncGenericChange.properties
@@ -1,35 +1,33 @@
-# LOCALIZATION NOTE (change.password.title): This (and associated change.password/passphrase) are used when the user elects to change their password.
+#LOCALIZATION NOTE (change.password.title): This (and associated change.password/passphrase) are used when the user elects to change their password.
 change.password.title = Change your Password
 change.password.acceptButton = Change Password
 change.password.status.active = Changing your password…
 change.password.status.success = Your password has been changed.
 change.password.status.error = There was an error changing your password.
 
-change.password2.introText = Your password must be at least 8 characters long.  It cannot be the same as either your user name or your Sync Key.
+change.password3.introText = Your password must be at least 8 characters long.  It cannot be the same as either your user name or your Recovery Key.
 change.password.warningText = Note: All of your other devices will be unable to connect to your account once you change this password.
 
-change.synckey2.title = My Sync Key
-change.synckey.acceptButton = Change Sync Key
-change.synckey.label = Changing Sync Key and uploading local data, please wait…
-change.synckey2.error = There was an error while changing your Sync Key!
-change.synckey2.success = Your Sync Key was successfully changed!
+change.recoverykey.title = My Recovery Key
+change.recoverykey.acceptButton = Change Recovery Key
+change.recoverykey.label = Changing Recovery Key and uploading local data, please wait…
+change.recoverykey.error = There was an error while changing your Recovery Key!
+change.recoverykey.success = Your Recovery Key was successfully changed!
 
-change.synckey.introText = Firefox Cares About Your Privacy
 change.synckey.introText2 = To ensure your total privacy, all of your data is encrypted prior to being uploaded. The key to decrypt your data is not uploaded.
-# LOCALIZATION NOTE (change.synckey2.warningText) "Sync" should match &syncBrand.shortName.label; from syncBrand.dtd
-change.synckey2.warningText = Note: Changing this will erase all data stored on the Sync server and upload new data secured by this Sync Key. Your other devices will not sync until the new Sync Key is entered for that device.
+# LOCALIZATION NOTE (change.recoverykey.warningText) "Sync" should match &syncBrand.shortName.label; from syncBrand.dtd
+change.recoverykey.warningText = Note: Changing this will erase all data stored on the Sync server and upload new data secured by this Recovery Key. Your other devices will not sync until the new Recovery Key is entered for that device.
 
-new.synckey.label = Your Sync Key
+new.recoverykey.label = Your Recovery Key
 
 # LOCALIZATION NOTE (new.password.title): This (and associated new.password/passphrase) are used on a second computer when it detects that your password or passphrase has been changed on a different device.
 new.password.title            = Update Password
 new.password.introText        = Your password was rejected by the server, please update your password.
 new.password.label            = Enter your new password
 new.password.confirm          = Confirm your new password
 new.password.acceptButton     = Update Password
 new.password.status.incorrect = Password incorrect, please try again.
 
-new.synckey.title          = Update Sync Key
-new.synckey2.introText       = Your Sync Key was changed using another device, please enter your updated Sync Key.
-new.synckey.acceptButton     = Update Sync Key
-new.synckey.status.incorrect = Sync Key incorrect, please try again.
+new.recoverykey.title          = Update Recovery Key
+new.recoverykey.introText      = Your Recovery Key was changed using another device, please enter your updated Recovery Key.
+new.recoverykey.acceptButton     = Update Recovery Key
--- a/browser/locales/en-US/chrome/browser/syncSetup.dtd
+++ b/browser/locales/en-US/chrome/browser/syncSetup.dtd
@@ -14,18 +14,18 @@
 <!-- New Account AND Existing Account -->
 <!ENTITY server.label               "Server">
 <!ENTITY serverType.main.label      "&syncBrand.fullName.label; Server">
 <!ENTITY serverType.custom2.label   "Use a custom server…">
 <!ENTITY signIn.account2.label      "Account">
 <!ENTITY signIn.account2.accesskey  "A">
 <!ENTITY signIn.password.label      "Password">
 <!ENTITY signIn.password.accesskey  "P">
-<!ENTITY signIn.syncKey.label       "Sync Key">
-<!ENTITY signIn.syncKey.accesskey   "K">
+<!ENTITY signIn.recoveryKey.label       "Recovery Key">
+<!ENTITY signIn.recoveryKey.accesskey   "K">
 
 <!-- New Account Page 1: Basic Account Info -->
 <!ENTITY setup.newAccountDetailsPage.title.label "Account Details">
 <!ENTITY setup.emailAddress.label     "Email Address">
 <!ENTITY setup.emailAddress.accesskey "E">
 <!ENTITY setup.choosePassword.label      "Choose a Password">
 <!ENTITY setup.choosePassword.accesskey  "P">
 <!ENTITY setup.confirmPassword.label     "Confirm Password">
@@ -36,22 +36,22 @@
 <!ENTITY setup.tosAgree1.accesskey  "a">
 <!ENTITY setup.tosLink.label        "Terms of Service">
 <!ENTITY setup.tosAgree2.label      "and the">
 <!ENTITY setup.ppLink.label         "Privacy Policy">
 <!ENTITY setup.tosAgree3.label      "">
 <!ENTITY setup.tosAgree2.accesskey  "">
 
 <!-- New Account Page 2: Sync Key -->
-<!ENTITY setup.newSyncKeyPage.title.label "&brandShortName; Cares About Your Privacy">
-<!ENTITY setup.newSyncKeyPage.description.label "To ensure your total privacy, all of your data is encrypted prior to being uploaded. The Sync Key which is necessary to decrypt your data is not uploaded.">
-<!ENTITY syncKeyEntry.label        "Your Sync Key">
-<!ENTITY syncKeyEntry.accesskey    "K">
+<!ENTITY setup.newRecoveryKeyPage.title.label "&brandShortName; Cares About Your Privacy">
+<!ENTITY setup.newRecoveryKeyPage.description.label "To ensure your total privacy, all of your data is encrypted prior to being uploaded. The Recovery Key which is necessary to decrypt your data is not uploaded.">
+<!ENTITY recoveryKeyEntry.label        "Your Recovery Key">
+<!ENTITY recoveryKeyEntry.accesskey    "K">
 <!ENTITY syncGenerateNewKey.label  "Generate a new key">
-<!ENTITY syncKeyBackup.description "Your Sync Key is required to access &syncBrand.fullName.label; on other machines. Please create a backup copy. We cannot help you recover your Sync Key.">
+<!ENTITY recoveryKeyBackup.description "Your Recovery Key is required to access &syncBrand.fullName.label; on other machines. Please create a backup copy. We cannot help you recover your Recovery Key.">
 
 <!ENTITY button.syncKeyBackup.print.label     "Print…">
 <!ENTITY button.syncKeyBackup.print.accesskey "P">
 <!ENTITY button.syncKeyBackup.save.label      "Save…">
 <!ENTITY button.syncKeyBackup.save.accesskey  "S">
 
 <!-- New Account Page 3: Captcha -->
 <!ENTITY setup.captchaPage2.title.label     "Please Confirm You're Not a Robot">
@@ -60,22 +60,22 @@
 <!ENTITY addDevice.showMeHow.label          "Show me how.">
 <!ENTITY addDevice.dontHaveDevice.label     "I don't have the device with me">
 <!ENTITY addDevice.setup.description.label  "To activate, go to &syncBrand.shortName.label; Options on your other device and select &#x0022;Add a Device&#x0022;.">
 <!ENTITY addDevice.setup.enterCode.label    "Then, enter this code:">
 <!ENTITY addDevice.dialog.description.label "To activate your new device, go to &syncBrand.shortName.label; Options on the device and select &#x0022;Connect.&#x0022;">
 <!ENTITY addDevice.dialog.enterCode.label   "Enter the code that the device provides:">
 <!ENTITY addDevice.dialog.tryAgain.label    "Please try again.">
 <!ENTITY addDevice.dialog.successful.label  "The device has been successfully added. The initial synchronization can take several minutes and will finish in the background.">
-<!ENTITY addDevice.dialog.syncKey.label     "To activate your device you will need to enter your Sync Key. Please print or save this key and take it with you.">
+<!ENTITY addDevice.dialog.recoveryKey.label     "To activate your device you will need to enter your Recovery Key. Please print or save this key and take it with you.">
 <!ENTITY addDevice.dialog.connected.label   "Device Connected">
 
 <!-- Existing Account Page 2: Manual Login -->
 <!ENTITY setup.signInPage.title.label "Sign In">
-<!ENTITY existingSyncKey.description "You can get a copy of your Sync Key by going to &syncBrand.shortName.label; Options on your other device, and selecting  &#x0022;My Sync Key&#x0022; under &#x0022;Manage Account&#x0022;.">
+<!ENTITY existingRecoveryKey.description "You can get a copy of your Recovery Key by going to &syncBrand.shortName.label; Options on your other device, and selecting  &#x0022;My Recovery Key&#x0022; under &#x0022;Manage Account&#x0022;.">
 <!ENTITY verifying.label              "Verifying…">
 <!ENTITY resetPassword.label          "Reset Password">
 <!ENTITY resetSyncKey.label           "I have lost my other device.">
 
 <!-- Sync Options -->
 <!ENTITY setup.optionsPage.title      "Sync Options">
 <!ENTITY syncComputerName.label       "Computer Name:">
 <!ENTITY syncComputerName.accesskey   "c">
--- a/browser/locales/en-US/chrome/browser/syncSetup.properties
+++ b/browser/locales/en-US/chrome/browser/syncSetup.properties
@@ -24,18 +24,18 @@ bookmarksCount.label        = #1 bookmar
 # #1 is the number of days (was %S for a short while, use #1 instead, even if both work)
 historyDaysCount.label      = #1 day of history;#1 days of history
 # LOCALIZATION NOTE (passwordsCount.label):
 # Semi-colon list of plural forms. See:
 # http://developer.mozilla.org/en/docs/Localization_and_Plurals
 # #1 is the number of passwords (was %S for a short while, use #1 instead, even if both work)
 passwordsCount.label        = #1 password;#1 passwords
 
-save.synckey.title = Save Sync Key
-save.default.label = Firefox Sync Key.html
+save.recoverykey.title = Save Recovery Key
+save.recoverykey.defaultfilename = Firefox Recovery Key.html
 
 newAccount.action.label = Firefox Sync is now set up to automatically sync all of your browser data.
 newAccount.change.label = You can choose exactly what to sync by selecting Sync Options below.
 resetClient.change.label = Firefox Sync will now merge all this computer's browser data into your Sync account.
 wipeClient.change.label = Firefox Sync will now replace all of the browser data on this computer with the data in your Sync account.
 wipeRemote.change.label = Firefox Sync will now replace all of the browser data in your Sync account with the data on this computer.
 existingAccount.change.label = You can change this preference by selecting Sync Options below.
 
index a65aa30ebae6c314bccd897862be400e27c7afab..561407ab62c5f8889a3367370abb7940c345876b
GIT binary patch
literal 7437
zc$`&OcQjnx*CvF~qBDAp9!BpqN^}x6+GryaWc27|^iCuUQ9_syJ<&!VqxX^^Iuk^6
z!bAw4{NBI5v(CNioVD&gYv29cyZ7_#L=z(&3Q}fLJUl!K-A9^_@$m3RZ`T3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#
zJIPTK{<seM5s6+4PhTVh*@#C8nRW7qq_{1rRaZK$bQG+O+rk2qC6-2;#$d`P>e*fT
zi*+v?s9gQf^DlkUNnIRxb{7$arTXI%tvN7Hw2@#Y!F&9o0hn4Am@Kh0TI7HU91)T9
z*ejhq^ec9qJ@dB`Nmw%0aKS)z?SSP413LYB2d}cT7YtZpX%wO9i~x-Eseb!7d8q*4
z(zUmb`&8rZQiLTAhMlOqdUfZ4-Vfe8&IHSD-O5++RFl1u#}Z4U8qPZ5iKI7?h?nwa
zAs6D4H-2$4{nsx?yqXt*-zzAdYrz#*5`hxzC3cor8ufs7JVH@ONRWm2G~N)z8q1vs
z4xU^}2q^<gu!MsW?0@@WiKS78<``V@oG^HG#=jl$&B3CaEFH(l`d_fHWa)R({{m!7
V!vvb~<yHUy002ovPDHLkV1lps*qQ(U
--- a/browser/themes/pinstripe/browser/browser.css
+++ b/browser/themes/pinstripe/browser/browser.css
@@ -364,16 +364,37 @@ toolbar:not([mode="icons"]) #restore-but
 }
 
 .toolbarbutton-1[disabled="true"] > .toolbarbutton-icon,
 .toolbarbutton-1[type="menu-button"] > .toolbarbutton-menubutton-button[disabled="true"] > .toolbarbutton-icon,
 #restore-button[disabled="true"] > .toolbarbutton-icon {
   opacity: .4;
 }
 
+@media (-moz-mac-lion-theme) {
+  .toolbarbutton-1[disabled="true"] > .toolbarbutton-icon,
+  .toolbarbutton-1[type="menu-button"] > .toolbarbutton-menubutton-button[disabled="true"] > .toolbarbutton-icon,
+  #restore-button[disabled="true"] > .toolbarbutton-icon,
+  .toolbarbutton-1[disabled="true"] > .toolbarbutton-menu-dropmarker,
+  .toolbarbutton-1[disabled="true"] > .toolbarbutton-menubutton-dropmarker,
+  .toolbarbutton-1:not(:hover):-moz-window-inactive > .toolbarbutton-icon,
+  .toolbarbutton-1:not(:hover):-moz-window-inactive > .toolbarbutton-icon,
+  #restore-button:not(:hover):-moz-window-inactive > .toolbarbutton-icon,
+  .toolbarbutton-1:not(:hover):-moz-window-inactive > .toolbarbutton-menu-dropmarker,
+  .toolbarbutton-1:not(:hover):-moz-window-inactive > .toolbarbutton-menubutton-dropmarker {
+    opacity: .5;
+  }
+
+  .toolbarbutton-1:-moz-window-inactive[disabled="true"] > .toolbarbutton-icon,
+  .toolbarbutton-1:-moz-window-inactive[type="menu-button"] > .toolbarbutton-menubutton-button[disabled="true"] > .toolbarbutton-icon,
+  #restore-button:-moz-window-inactive[disabled="true"] > .toolbarbutton-icon {
+    opacity: .25;
+  }
+}
+
 .toolbarbutton-1 > .toolbarbutton-menu-dropmarker,
 .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker {
   list-style-image: url(chrome://browser/skin/toolbarbutton-dropmarker.png);
 }
 
 .toolbarbutton-1 > .toolbarbutton-menu-dropmarker {
   -moz-margin-end: 1px;
 }
@@ -477,16 +498,17 @@ toolbar[mode="icons"] #forward-button:-m
   border-radius: 10000px;
 }
 
 #navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button:not(:-moz-lwtheme) {
   height: 31px;
   padding: 4px 5px 5px 3px;
   margin-bottom: -1px;
   background: url(chrome://browser/skin/keyhole-circle.png) 0 0 no-repeat;
+  border-radius: 0;
 }
 
 #navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button:-moz-window-inactive:not(:-moz-lwtheme) {
   background-position: -60px 0;
 }
 
 #navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button:not([disabled="true"]):active:hover:not(:-moz-lwtheme),
 #navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button[open="true"]:not(:-moz-lwtheme) {
@@ -634,35 +656,27 @@ toolbar[mode="icons"] #forward-button:-m
 #history-button {
   -moz-image-region: rect(0, 160px, 20px, 140px);
 }
 
 #history-button[checked="true"] {
   -moz-image-region: rect(20px, 160px, 40px, 140px);
 }
 
-#history-button[checked="true"]:active:hover {
-  -moz-image-region: rect(40px, 160px, 60px, 140px);
-}
-
 /* bookmark sidebar & menu buttons */
 
 #bookmarks-button,
 #bookmarks-menu-button {
   -moz-image-region: rect(0, 180px, 20px, 160px);
 }
 
 #bookmarks-button[checked="true"] {
   -moz-image-region: rect(20px, 180px, 40px, 160px);
 }
 
-#bookmarks-button[checked="true"]:active:hover {
-  -moz-image-region: rect(40px, 180px, 60px, 160px);
-}
-
 #bookmarks-menu-button.bookmark-item {
   -moz-image-region: rect(2px, 178px, 18px, 162px);
   list-style-image: url("chrome://browser/skin/Toolbar.png");
 }
 
 #bookmarks-menu-button.toolbarbutton-1 {
   -moz-box-orient: horizontal;
 }
@@ -1878,17 +1892,17 @@ toolbarbutton.chevron > .toolbarbutton-m
 }
 
 .tab-close-button:hover:active {
   -moz-image-region: rect(0, 48px, 16px, 32px);
 }
 
 .tabbrowser-arrowscrollbox > .scrollbutton-up,
 .tabbrowser-arrowscrollbox > .scrollbutton-down {
-  -moz-image-region: rect(0, 11px, 17px, 0);
+  -moz-image-region: rect(0, 13px, 20px, 0);
   margin: 0;
   padding: 0 4px;
   border: none;
 }
 
 #tabbrowser-tabs[tabsontop=false] > .tabbrowser-arrowscrollbox > .scrollbutton-up,
 #tabbrowser-tabs[tabsontop=false] > .tabbrowser-arrowscrollbox > .scrollbutton-down,
 #tabbrowser-tabs[tabsontop=false] > .tabbrowser-arrowscrollbox > .scrollbutton-up > .toolbarbutton-icon,
@@ -1917,27 +1931,28 @@ toolbarbutton.chevron > .toolbarbutton-m
 
 .tabbrowser-arrowscrollbox > .scrollbutton-down:-moz-locale-dir(ltr),
 .tabbrowser-arrowscrollbox > .scrollbutton-up:-moz-locale-dir(rtl) {
   list-style-image: url("chrome://browser/skin/tabbrowser/tab-arrow-right.png");
 }
 
 .tabbrowser-arrowscrollbox > .scrollbutton-up:hover,
 .tabbrowser-arrowscrollbox > .scrollbutton-down:hover {
-  -moz-image-region: rect(0, 22px, 17px, 11px);
+  -moz-image-region: rect(0, 26px, 20px, 13px);
 }
 
 .tabbrowser-arrowscrollbox > .scrollbutton-up:hover:active,
 .tabbrowser-arrowscrollbox > .scrollbutton-down:hover:active {
-  -moz-image-region: rect(0, 44px, 17px, 33px);
-}
-
-.tabbrowser-arrowscrollbox > .scrollbutton-up[disabled],
-.tabbrowser-arrowscrollbox > .scrollbutton-down[disabled] {
-  -moz-image-region: rect(0, 33px, 17px, 22px) !important;
+  -moz-image-region: rect(0, 39px, 20px, 26px);
+}
+
+.tabbrowser-arrowscrollbox > .scrollbutton-up[disabled] > .toolbarbutton-icon,
+.tabbrowser-arrowscrollbox > .scrollbutton-down[disabled] > .toolbarbutton-icon {
+  -moz-image-region: rect(0, 13px, 20px, 0) !important;
+  opacity: .5;
 }
 
 .tabbrowser-arrowscrollbox > .scrollbutton-up:not([disabled]):-moz-locale-dir(ltr),
 .tabbrowser-arrowscrollbox > .scrollbutton-down:not([disabled]):-moz-locale-dir(rtl) {
   -moz-border-image: url("chrome://browser/skin/tabbrowser/tab-overflow-border.png") 0 2 0 2 / 0 2px 0 0;
 }
 
 .tabbrowser-arrowscrollbox > .scrollbutton-down:not([disabled]):-moz-locale-dir(ltr),
--- a/browser/themes/pinstripe/browser/jar.mn
+++ b/browser/themes/pinstripe/browser/jar.mn
@@ -132,11 +132,19 @@ browser.jar:
   skin/classic/browser/sync-mobileIcon.png
   skin/classic/browser/sync-notification-24.png
   skin/classic/browser/syncSetup.css
   skin/classic/browser/syncCommon.css
   skin/classic/browser/syncQuota.css
 #endif
   skin/classic/browser/lion/keyhole-circle.png              (keyhole-circle-lion.png)
   skin/classic/browser/lion/Toolbar.png                     (Toolbar-lion.png)
+  skin/classic/browser/lion/toolbarbutton-dropmarker.png    (toolbarbutton-dropmarker-lion.png)
+  skin/classic/browser/lion/tabbrowser/alltabs-box-bkgnd-icon.png      (tabbrowser/alltabs-box-bkgnd-icon-lion.png)
+  skin/classic/browser/lion/tabview/tabview.png                        (tabview/tabview-lion.png)
+  skin/classic/browser/lion/places/toolbar.png              (places/toolbar-lion.png)
 
-% override chrome://browser/skin/keyhole-circle.png chrome://browser/skin/lion/keyhole-circle.png os=Darwin osversion>=10.7
-% override chrome://browser/skin/Toolbar.png chrome://browser/skin/lion/Toolbar.png os=Darwin osversion>=10.7
+% override chrome://browser/skin/keyhole-circle.png                        chrome://browser/skin/lion/keyhole-circle.png                           os=Darwin osversion>=10.7
+% override chrome://browser/skin/Toolbar.png                               chrome://browser/skin/lion/Toolbar.png                                  os=Darwin osversion>=10.7
+% override chrome://browser/skin/toolbarbutton-dropmarker.png              chrome://browser/skin/lion/toolbarbutton-dropmarker.png                 os=Darwin osversion>=10.7
+% override chrome://browser/skin/tabbrowser/alltabs-box-bkgnd-icon.png     chrome://browser/skin/lion/tabbrowser/alltabs-box-bkgnd-icon.png        os=Darwin osversion>=10.7
+% override chrome://browser/skin/tabview/tabview.png                       chrome://browser/skin/lion/tabview/tabview.png                          os=Darwin osversion>=10.7
+% override chrome://browser/skin/places/toolbar.png                        chrome://browser/skin/lion/places/toolbar.png                           os=Darwin osversion>=10.7
index f164d498c351e2541fadcbfb9b1e7a8334a7e581..8c4cb3ba212f577a420eb96e57bef052c33021c0
GIT binary patch
literal 2581
zc$`I6c|4TcA7;2@Y)L3Yu4`nO(PV5FlQ3kjh|(fU8QGGu4>$MPw<~3hFd_*VG}*f}
zAtuJyW-KF<Ww@AOEO#Wom;CPi<9*-H=e*zNe80~*&-p$l;exHXFjyMQ#l<CTao+S2
z@O1_r`9plb+tZLb!NnyoZee=PA%t3=D`0(@a=g<^-`=-;_(dw&@rZh_hfn=b5jmN_
zoi)&yB0`4znqoC(&Hjtt!k@<f3G&W;!aSfuVmvFL<0q)!ASUS|kLA%yLCciscXfAD
zc6NISMx%1~R;(hsL+2uCySvMs4V&YEFl6=3mes`3(NSBs<SwbQ54*o<V`LR$uV^0A
z_Q~#Je(7l0P|AE(WD>^_I)0{v^qsQ>jv}FW6D}0m$aluG9Q*P>O{T74VVo$u@0ep4
zW8j4vfj~fMxU?FG)-mYE;2$2_$5oBA`r)@}u&l+GSD-jqkxqwww92LycrqJ=7jHY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l0#XH&{2KKqTv
znB?BE!TzfI(c=Xw)_k||@Czr7*r(cwreJ>$%*lhkNMq4EH-*69g;E1PQ*rUcab5sb
zwKU_S>HB1E-fM~tI7O6iZ!c8(jrUOW9!7lW)6L76b^eCpZZ!+VGnU~$r>hp&sHu&0
z#EF^@^ZnP_TNWly=m&kPl;a<(={gPGSmGER^vrq*=}A(@&Pdp-I?1Z<+{Z4z<(bDr
zSy%3Np?IK(imkz^ilH$cqJ)c=ao~dXEhlb8hpu=W?o8e!;c_%GRm?;kaJGx`F21_!
z-sDoEa@d#cR``WUZSYnl^<?b+G?fbx-iVQ;&((;8>%%iy6~gTPRniSt29+00c0wj5
z?D;~oKIK(wn58a0d~;bKcU1N$Yk8t6nb`&Cz?|#<c0TB|t+2DrW~^;bO--fMiwzYJ
z%wjs*@TXM!OViwc_`u-TYk7K#2<w%9a9ZgTq>}sR(mVs}aNF2|Bj4Yf^8e>}TIlel
zo?Xv*7h(_tGo=nS_+EAGcX2csaH`(bp|;aP^8+t>RzM(7^!m!}bJU(lyREfYnf?Fq
zN@XxwWA9&f?2+$&(`*J=C)A*z=hqr<MYH6PpZ>kPl-_QYCL%d>9V-6K8>U@Y!*<w{
zxY$@+<D$rZ%w$0|ezqStQ?AAMEzpmdwRjRyq~>*~#vAYyRtmSyuKgadD_Sa7I0&6W
SGlA<Kmj%k!w95Ea^#1_v!6y;`
--- a/browser/themes/pinstripe/browser/places/organizer.css
+++ b/browser/themes/pinstripe/browser/places/organizer.css
@@ -99,16 +99,30 @@
 
 #placesToolbar > toolbarbutton[type="menu"] > .toolbarbutton-menu-dropmarker {
   list-style-image: url(chrome://browser/skin/toolbarbutton-dropmarker.png);
   padding: 0;
   margin-top: 1px;
   -moz-margin-end: 2px;
 }
 
+@media (-moz-mac-lion-theme) {
+  #placesToolbar > toolbarbutton[disabled="true"] > .toolbarbutton-icon,
+  #placesToolbar > toolbarbutton:not(:hover):-moz-window-inactive > .toolbarbutton-icon,
+  #placesToolbar > toolbarbutton[type="menu"][disabled="true"] > .toolbarbutton-menu-dropmarker,
+  #placesToolbar > toolbarbutton:not(:hover):-moz-window-inactive[type="menu"] > .toolbarbutton-menu-dropmarker {
+    opacity: .5;
+  }
+
+  #placesToolbar > toolbarbutton:-moz-window-inactive[disabled="true"] > .toolbarbutton-icon,
+  #placesToolbar > toolbarbutton:-moz-window-inactive[type="menu"][disabled="true"] > .toolbarbutton-menu-dropmarker {
+    opacity: .25;
+  }
+}
+
 #placesToolbar > toolbarbutton > menupopup {
   margin-top: 1px;
 }
 
 /* back and forward button */
 #back-button:-moz-locale-dir(ltr),
 #forward-button:-moz-locale-dir(rtl) {
   -moz-image-region: rect(0px, 16px, 16px, 0px);
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ac3358c91bc00e87bd41e49e5cf9672ecd685103
GIT binary patch
literal 1318
zc$@(y1=;$EP)<h;3K|Lk000e1NJLTq002+`000mO1^@s6fl2tm000E-Nkl<Zc-qaF
zZAhC}6vrnuzU!has8owXQPw&v_%1SyNEcB@{GhbMw_0afoUYvx=H}vT+Eg=*cCm>~
zVjG**YDBxjXq{l|Ms<_H94L%|!a!wT^@DzP{{tuNA)WQfmM|~;IC<{<-}{`L`*xDo
z_V@SyS6)#j!S8GjD*k+b1^A8af#oO#@Hi+JJU;=~*t!d~pWx5_oJ470VBm9D6I<y~
z58#P_fPf!iUjQT5*+C~;Dn@FDZV@)wp8=FeBqo@z!53ud`9B8`B^BHjp&KKuH_oS~
zrdGi`1l`~Puz()W!PY|c+&-3^oZJ8_9OF-Kc|`!v02c?ZgRP6}y$>KSUp-g~4i0`M
zLjMf>#C@b9^kmZ%3I#dY&#TVNE8sR;GuQW*m6c6EpW)$qx3_rsa2k999)s_|RpvVA
zV*4C?%evEt1`tI8T6oLc2i@V};bS5KG77ZRhx@hw$pLzyAIkjv{F~%>Y;5ev@bIu@
zZ*NaWmY%6TJ3D)jbiO=(IA}lc3hxEF$jC^0MMcG^QmJ%iWMnu|H{RC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@<}lKi2S}(tJc<GIEW+El*57}G@K|qxPR<lcKr#p-%g;^R
co+k9+FA1)f{H_9Cg#Z8m07*qoM6N<$f+2l=ApigX
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4d71308d278644ee9dda74ddac9207c0b1b26b3b
GIT binary patch
literal 538
zc$@(m0_FXQP)<h;3K|Lk000e1NJLTq001)p000yS1^@s6AP5Dd0005uNkl<Zc-rlj
zze@sP9LBrzygV@rlEjRVB2zLWD8!Z$hyIMVh=P6${TL%CXpNwPhG;CJA!seCMFOcM
zS^^=Vr52HvhPUT|Z<AoxFR=39!^88u-;;Yd?)9xvO8ptCWqyLildn=O^W$YSpaTP#
zpcYtf&`WN}oL0$Ybl{W+_W~dAg8-FYa!cm)N-d)S2XKJ~DbNnOKsQx<K-OI{uT^Rp
zC-BHy=m33S5TvQ}lKW-OS+)$Wac}^3!48$4x!s4uwFGX#HMpYEGk>Ry3F<+sKRvnU
zPL3(h(5&*L<`tEmIoD;*EL)~fC`4kh*sPQqq0%$ATc%hn#v_r)7Vg~!YgBsXHr|XE
zw4UC*OeZI{?*pSps%7e2QR$gW8E@G)BWU@2z9$q4&EO$Msr1abZWAq+%MApB!A<<e
z29=)qJ7o;u0nN*2Dt>(PypovNf9#yQP*i&6T$ee+&NriHv)N=c8l9rjGyfotOeQlN
z4u{vN^fq=g2e3dRXj{Ed{fF77_0;rEo=VSL)-BH4-OZdJPNn}OCP+{}xHZ>-CJ@@V
zRJ~UZYJo~Gd0ho>%_W6Q;Fgcv#{yLGZduoV$8o0g6yPfP_y1*QGfmKmppoi9vs&iA
cm-!A}0h)`@YUO@9WdHyG07*qoM6N<$g0_nLLjV8(
old mode 100755
new mode 100644
index f6582078f49789bdad234906e474bfe0b9027f77..32e42b04cce15cb654b44bc882b264bec5efa963
GIT binary patch
literal 568
zc$@(^0>}M{P)<h;3K|Lk000e1NJLTq001@s000yS1^@s6#v#t&00061Nkl<Zc-rmP
z&npCB7zgm3ooQRvVY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8b29ae775ad8c2e48c5391..09d80a1b25a84578587cc1d41afe6fd63dff2a93
GIT binary patch
literal 150
zc%17D@N?(olHy`uVBq!ia0vp^>_E)Q!3HEdXMMW?q+&f?978H@nRagEY%maTUHm{U
zT#6&gx_54CZ^VxN8@o^WPUPI=@W=ne!N;HPvEJ2-``9u2=>Iq`$zU&Wr7*GO?NQm&
zi|3tvb0s;s(8~YC-P%q=IUT>}7bT7y+4ha`t-O<^eCv-;phXOxu6{1-oD!M<-g!B*
--- a/build/autoconf/mozconfig-find
+++ b/build/autoconf/mozconfig-find
@@ -37,17 +37,16 @@
 #
 # ***** END LICENSE BLOCK *****
 
 # mozconfigfind - Loads options from .mozconfig onto configure's
 #    command-line. The .mozconfig file is searched for in the 
 #    order:
 #       if $MOZCONFIG is set, use that.
 #       Otherwise, use $TOPSRCDIR/.mozconfig
-#       Otherwise, use $HOME/.mozconfig
 #
 topsrcdir=$1
 
 abspath() {
   if uname -s | grep -q MINGW; then
     # We have no way to figure out whether we're in gmake or pymake right
     # now. gmake gives us Unix-style paths while pymake gives us Windows-style
     # paths, so attempt to handle both.
@@ -62,32 +61,42 @@ abspath() {
       exit 0
     fi
   done
 
   # If we're at this point, we have a relative path
   echo `pwd`/$1
 }
 
+if [ -n "$MOZCONFIG" ] && ! [ -f "$MOZCONFIG" ]; then
+  echo "Specified MOZCONFIG \"$MOZCONFIG\" does not exist!"
+  exit 1
+fi
+
+if [ -n "$MOZ_MYCONFIG" ]; then
+  echo "Your environment currently has the MOZ_MYCONFIG variable set to \"$MOZ_MYCONFIG\". MOZ_MYCONFIG is no longer supported. Please use MOZCONFIG instead."
+  exit 1
+fi
+
 for _config in "$MOZCONFIG" \
-               "$MOZ_MYCONFIG"
+               "$topsrcdir/.mozconfig"
 do
-  if [ -n "$_config" ] && ! [ -f "$_config" ]; then
-    echo "Specified MOZCONFIG \"$_config\" does not exist!"
-    exit 1
+  if test -f "$_config"; then
+    echo `abspath $_config`
+    exit 0
   fi
 done
 
-for _config in "$MOZCONFIG" \
-               "$MOZ_MYCONFIG" \
-               "$topsrcdir/.mozconfig" \
-               "$topsrcdir/mozconfig" \
+# We used to support a number of other implicit .mozconfig locations. We now
+# detect if we were about to use any of these locations and issue an error if we
+# find any.
+for _config in "$topsrcdir/mozconfig" \
                "$topsrcdir/mozconfig.sh" \
                "$topsrcdir/myconfig.sh" \
                "$HOME/.mozconfig" \
                "$HOME/.mozconfig.sh" \
                "$HOME/.mozmyconfig.sh"
 do
   if test -f "$_config"; then
-    echo `abspath $_config`
-    exit 0
+    echo "You currently have a mozconfig at \"$_config\". This implicit location is no longer supported. Please move it to $topsrcdir/.mozconfig or specify it explicitly via \$MOZCONFIG.";
+    exit 1
   fi
 done
--- a/build/macosx/mozconfig.leopard
+++ b/build/macosx/mozconfig.leopard
@@ -1,13 +1,36 @@
 if test -z "$CC" ; then
    CC=gcc-4.2
 fi
 
 if test -z "$CXX" ; then
    CXX=g++-4.2
 fi
 
+# Mac builds don't nomally have to be handled as cross
+# compilation, but some of the libraries on the bots
+# (IDL for example) are built only for one arch.
+
+HOST_CC=$CC
+HOST_CXX=$CXX
+
+# These must be set for cross builds, and don't hurt straight builds.
+RANLIB=ranlib
+AR=ar
+AS=$CC
+LD=ld
+STRIP="strip -x -S"
+
 # We do 32 bit builds for leopard
-CC="$CC -arch i386"
-CXX="$CXX -arch i386"
+TARGET_CPU=i386
+CC="$CC -arch $TARGET_CPU"
+CXX="$CXX -arch $TARGET_CPU"
+
+NATIVE_CPU=`$topsrcdir/build/autoconf/config.guess | cut -f1 -d-`
 
+if test "$NATIVE_CPU" != "$TARGET_CPU" ; then
+  CROSS_COMPILE=1
+fi
+
+# Note, the version (10) is used by libffi's configure.
+ac_add_options --target=i386-apple-darwin10
 ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.5.sdk
--- a/build/macosx/universal/mozconfig.common
+++ b/build/macosx/universal/mozconfig.common
@@ -33,20 +33,20 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 mk_add_options MOZ_UNIFY_BDATE=1
 
 mk_add_options MOZ_POSTFLIGHT_ALL+=build/macosx/universal/flight.mk
 
-DARWIN_VERSION=`uname -r`
-ac_add_app_options ppc  --target=powerpc-apple-darwin$DARWIN_VERSION
-ac_add_app_options i386 --target=i386-apple-darwin$DARWIN_VERSION
-ac_add_app_options x86_64 --target=x86_64-apple-darwin$DARWIN_VERSION
+# Note, the version (10) is used by libffi's configure.
+ac_add_app_options ppc  --target=powerpc-apple-darwin10
+ac_add_app_options i386 --target=i386-apple-darwin10
+ac_add_app_options x86_64 --target=x86_64-apple-darwin10
 
 ac_add_app_options ppc --with-macos-sdk=/Developer/SDKs/MacOSX10.5.sdk
 ac_add_app_options i386 --with-macos-sdk=/Developer/SDKs/MacOSX10.5.sdk
 ac_add_app_options x86_64 --with-macos-sdk=/Developer/SDKs/MacOSX10.6.sdk
 
 # $MOZ_BUILD_APP is only defined when sourced by configure.  That's not a
 # problem, because the variables it affects only need to be set for
 # configure.
--- a/build/mobile/devicemanagerADB.py
+++ b/build/mobile/devicemanagerADB.py
@@ -1,40 +1,39 @@
 import subprocess
 from devicemanager import DeviceManager, DMError
 import re
 import os
+import sys
 
 class DeviceManagerADB(DeviceManager):
 
   def __init__(self, host = None, port = 20701, retrylimit = 5, packageName = None):
     self.host = host
     self.port = port
     self.retrylimit = retrylimit
     self.retries = 0
     self._sock = None
+    self.useRunAs = False
     if packageName == None:
       if os.getenv('USER'):
         packageName = 'org.mozilla.fennec_' + os.getenv('USER')
       else:
         packageName = 'org.mozilla.fennec_'
     self.Init(packageName)
 
   def Init(self, packageName):
     # Initialization code that may fail: Catch exceptions here to allow
     # successful initialization even if, for example, adb is not installed.
     try:
-      root = self.getDeviceRoot()
-      self.verifyPackage(packageName)
-      self.tmpDir = root + "/tmp"
-      if (not self.dirExists(self.tmpDir)):
-        self.mkDir(self.tmpDir)
+      self.verifyADB()
+      self.verifyRunAs(packageName)
     except:
+      self.useRunAs = False
       self.packageName = None
-      self.tmpDir = None
     try:
       # a test to see if we have root privs
       files = self.listFiles("/data/data")
       if (len(files) == 1):
         if (files[0].find("Permission denied") != -1):
           print "NOT running as root"
           raise Exception("not running as root")
     except:
@@ -46,17 +45,17 @@ class DeviceManagerADB(DeviceManager):
   # external function
   # returns:
   #  success: True
   #  failure: False
   def pushFile(self, localname, destname):
     try:
       if (os.name == "nt"):
         destname = destname.replace('\\', '/')
-      if (self.packageName):
+      if (self.useRunAs):
         remoteTmpFile = self.tmpDir + "/" + os.path.basename(localname)
         self.checkCmd(["push", os.path.realpath(localname), remoteTmpFile])
         self.checkCmdAs(["shell", "cp", remoteTmpFile, destname])
         self.checkCmd(["shell", "rm", remoteTmpFile])
       else:
         self.checkCmd(["push", os.path.realpath(localname), destname])
       if (self.isDir(destname)):
         destname = destname + "/" + os.path.basename(localname)
@@ -493,17 +492,17 @@ class DeviceManagerADB(DeviceManager):
     args.insert(0, "adb")
     return subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 
   def checkCmd(self, args):
     args.insert(0, "adb")
     return subprocess.check_call(args)
 
   def checkCmdAs(self, args):
-    if (self.packageName):
+    if (self.useRunAs):
       args.insert(1, "run-as")
       args.insert(2, self.packageName)
     return self.checkCmd(args)
 
   def chmodDir(self, remoteDir):
     if (self.isDir(remoteDir)):
       files = self.listFiles(remoteDir.strip())
       for f in files:
@@ -513,18 +512,49 @@ class DeviceManagerADB(DeviceManager):
           self.checkCmdAs(["shell", "chmod", "777", remoteDir.strip()])
           print "chmod " + remoteDir.strip()
       self.checkCmdAs(["shell", "chmod", "777", remoteDir])
       print "chmod " + remoteDir
     else:
       self.checkCmdAs(["shell", "chmod", "777", remoteDir.strip()])
       print "chmod " + remoteDir.strip()
 
-  def verifyPackage(self, packageName):
-    # If a valid package name is specified, it will be used for certain
-    # file operations, so that pushed files and directories are created
-    # by the uid associated with the package.
-    self.packageName = None
-    if (packageName):
-      data = self.runCmd(["shell", "run-as", packageName, "pwd"]).stdout.read()
-      if (not re.search('is unknown', data)):
+  def verifyADB(self):
+    # Check to see if adb itself can be executed.
+    try:
+      self.runCmd(["version"])
+    except Exception as (ex):
+      print "unable to execute ADB: ensure Android SDK is installed and adb is in your $PATH"
+    
+  def isCpAvailable(self):
+    # Some Android systems may not have a cp command installed,
+    # or it may not be executable by the user. 
+    data = self.runCmd(["shell", "cp"]).stdout.read()
+    if (re.search('Usage', data)):
+      return True
+    else:
+      print "unable to execute 'cp' on device; consider installing busybox from Android Market"
+      return False
+
+  def verifyRunAs(self, packageName):
+    # If a valid package name is available, and certain other
+    # conditions are met, devicemanagerADB can execute file operations
+    # via the "run-as" command, so that pushed files and directories 
+    # are created by the uid associated with the package, more closely
+    # echoing conditions encountered by Fennec at run time.
+    # Check to see if run-as can be used here, by verifying a 
+    # file copy via run-as.
+    self.useRunAs = False
+    devroot = self.getDeviceRoot()
+    if (packageName and self.isCpAvailable() and devroot):
+      self.tmpDir = devroot + "/tmp"
+      if (not self.dirExists(self.tmpDir)):
+        self.mkDir(self.tmpDir)
+      self.checkCmd(["shell", "run-as", packageName, "mkdir", devroot + "/sanity"])
+      self.checkCmd(["push", os.path.abspath(sys.argv[0]), self.tmpDir + "/tmpfile"])
+      self.checkCmd(["shell", "run-as", packageName, "cp", self.tmpDir + "/tmpfile", devroot + "/sanity"])
+      if (self.fileExists(devroot + "/sanity/tmpfile")):
+        print "will execute commands via run-as " + packageName
         self.packageName = packageName
-        print "package set: " + self.packageName
+        self.useRunAs = True
+      self.checkCmd(["shell", "rm", devroot + "/tmp/tmpfile"])
+      self.checkCmd(["shell", "run-as", packageName, "rm", "-r", devroot + "/sanity"])
+      
--- a/build/win32/Makefile.in
+++ b/build/win32/Makefile.in
@@ -59,17 +59,16 @@ DIRS += \
 PROGRAM = crashinject$(BIN_SUFFIX)
 USE_STATIC_LIBS = 1
 CPPSRCS = crashinject.cpp
 
 endif # ENABLE_TESTS
 
 include $(topsrcdir)/config/rules.mk
 
-ifndef MOZ_MEMORY
 ifdef WIN32_REDIST_DIR
 ifndef MOZ_DEBUG
 
 ifeq (1400,$(_MSC_VER))
 REDIST_FILES = \
 	Microsoft.VC80.CRT.manifest \
 	msvcm80.dll \
 	msvcp80.dll \
@@ -96,9 +95,8 @@ endif
 ifdef REDIST_FILES
 libs::
 	mkdir -p $(FINAL_TARGET)
 	install --preserve-timestamps $(foreach f,$(REDIST_FILES),"$(WIN32_REDIST_DIR)"/$(f)) $(FINAL_TARGET)
 endif
 
 endif # ! MOZ_DEBUG
 endif # WIN32_REDIST_DIR
-endif # ! MOZ_MEMORY
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -622,28 +622,23 @@ USE_GSSAPI	= @USE_GSSAPI@
 MOZILLA_OFFICIAL = @MOZILLA_OFFICIAL@
 
 # Win32 options
 MOZ_BROWSE_INFO	= @MOZ_BROWSE_INFO@
 MOZ_TOOLS_DIR	= @MOZ_TOOLS_DIR@
 MOZ_QUANTIFY	= @MOZ_QUANTIFY@
 MSMANIFEST_TOOL = @MSMANIFEST_TOOL@
 WIN32_REDIST_DIR = @WIN32_REDIST_DIR@
-WIN32_CRT_SRC_DIR = @WIN32_CRT_SRC_DIR@
 MOZ_MEMORY_LDFLAGS = @MOZ_MEMORY_LDFLAGS@
-WIN32_OLD_STYLE_JEMALLOC = @WIN32_OLD_STYLE_JEMALLOC@
 WIN32_CRT_LIBS = @WIN32_CRT_LIBS@
-MOZ_CRT_CPU_ARCH = @MOZ_CRT_CPU_ARCH@
 
 # This is for custom CRT building
 ifdef MOZ_MEMORY
-ifdef WIN32_CRT_SRC_DIR
 DLLFLAGS = @DLLFLAGS@
 endif
-endif
 
 # Codesighs tools option, enables win32 mapfiles.
 MOZ_MAPINFO	= @MOZ_MAPINFO@
 
 MOZ_PHOENIX	= @MOZ_PHOENIX@
 MOZ_XULRUNNER	= @MOZ_XULRUNNER@
 
 MOZ_DISTRIBUTION_ID = @MOZ_DISTRIBUTION_ID@
--- a/config/config.mk
+++ b/config/config.mk
@@ -514,21 +514,26 @@ ifneq (,$(MOZ_DEBUG)$(NS_TRACE_MALLOC))
 ifndef MOZ_NO_DEBUG_RTL
 RTL_FLAGS=-MDd         # Dynamically linked, multithreaded MSVC4.0 debug RTL
 endif 
 endif # MOZ_DEBUG || NS_TRACE_MALLOC
 endif # USE_STATIC_LIBS
 endif # WINNT && !GNU_CC
 
 ifeq ($(OS_ARCH),Darwin)
-# Darwin doesn't cross-compile, so just set both types of flags here.
+# Compiling ObjC requires an Apple compiler anyway, so it's ok to set
+# host CMFLAGS here.
 HOST_CMFLAGS += -fobjc-exceptions
 HOST_CMMFLAGS += -fobjc-exceptions
 OS_COMPILE_CMFLAGS += -fobjc-exceptions
 OS_COMPILE_CMMFLAGS += -fobjc-exceptions
+ifeq ($(MOZ_WIDGET_TOOLKIT),uikit)
+OS_COMPILE_CMFLAGS += -fobjc-abi-version=2 -fobjc-legacy-dispatch
+OS_COMPILE_CMMFLAGS += -fobjc-abi-version=2 -fobjc-legacy-dispatch
+endif
 endif
 
 COMPILE_CFLAGS	= $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CFLAGS)
 COMPILE_CXXFLAGS = $(STL_FLAGS) $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(CXXFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CXXFLAGS)
 COMPILE_CMFLAGS = $(OS_COMPILE_CMFLAGS)
 COMPILE_CMMFLAGS = $(OS_COMPILE_CMMFLAGS)
 
 ifndef CROSS_COMPILE
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -676,16 +676,22 @@ IFLAGS2 = -m 755
 endif
 
 ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
 OUTOPTION = -Fo# eol
 else
 OUTOPTION = -o # eol
 endif # WINNT && !GNU_CC
 
+ifneq (,$(filter ml%,$(AS)))
+ASOUTOPTION = -Fo# eol
+else
+ASOUTOPTION = -o # eol
+endif
+
 ifeq (,$(CROSS_COMPILE))
 HOST_OUTOPTION = $(OUTOPTION)
 else
 HOST_OUTOPTION = -o # eol
 endif
 ################################################################################
 
 # SUBMAKEFILES: List of Makefiles for next level down.
@@ -1281,17 +1287,17 @@ moc_%.cpp: %.h $(GLOBAL_DEPS)
 moc_%.cc: %.cc $(GLOBAL_DEPS)
 	$(REPORT_BUILD)
 	$(ELOG) $(MOC) $(DEFINES) $(ACDEFINES) $(_VPATH_SRCS:.cc=.h) $(OUTOPTION)$@
 
 ifdef ASFILES
 # The AS_DASH_C_FLAG is needed cause not all assemblers (Solaris) accept
 # a '-c' flag.
 %.$(OBJ_SUFFIX): %.$(ASM_SUFFIX) $(GLOBAL_DEPS)
-	$(AS) -o $@ $(ASFLAGS) $(AS_DASH_C_FLAG) $(_VPATH_SRCS)
+	$(AS) $(ASOUTOPTION)$@ $(ASFLAGS) $(AS_DASH_C_FLAG) $(_VPATH_SRCS)
 endif
 
 %.$(OBJ_SUFFIX): %.S $(GLOBAL_DEPS)
 	$(AS) -o $@ $(ASFLAGS) -c $<
 
 %:: %.cpp $(GLOBAL_DEPS)
 	@$(MAKE_DEPS_AUTO_CXX)
 	$(CCC) $(OUTOPTION)$@ $(CXXFLAGS) $(_VPATH_SRCS) $(LDFLAGS)
--- a/configure.in
+++ b/configure.in
@@ -125,17 +125,17 @@ GTK2_VERSION=2.10.0
 WINDRES_VERSION=2.14.90
 W32API_VERSION=3.14
 GNOMEVFS_VERSION=2.0
 GNOMEUI_VERSION=2.2.0
 GCONF_VERSION=1.2.1
 GIO_VERSION=2.18
 STARTUP_NOTIFICATION_VERSION=0.8
 DBUS_VERSION=0.60
-SQLITE_VERSION=3.7.5
+SQLITE_VERSION=3.7.7.1
 LIBNOTIFY_VERSION=0.4
 
 MSMANIFEST_TOOL=
 
 dnl Set various checks
 dnl ========================================================
 MISSING_X=
 AC_PROG_AWK
@@ -2101,17 +2101,27 @@ case "$target" in
     DLL_SUFFIX=".dylib"
     DSO_LDOPTS=''
     STRIP="$STRIP -x -S"
     _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
     TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
     # The ExceptionHandling framework is needed for Objective-C exception
     # logging code in nsObjCExceptions.h. Currently we only use that in debug
     # builds.
-    MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling"
+    _SAVE_LDFLAGS=$LDFLAGS
+     AC_MSG_CHECKING([for -framework ExceptionHandling])
+    LDFLAGS="$LDFLAGS -framework ExceptionHandling"
+    AC_TRY_LINK(,[return 0;],
+                ac_cv_have_framework_exceptionhandling="yes",
+                ac_cv_have_framework_exceptionhandling="no")
+    AC_MSG_RESULT([$ac_cv_have_framework_exceptionhandling])
+    if test "$ac_cv_have_framework_exceptionhandling" = "yes"; then
+      MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling";
+    fi
+    LDFLAGS=$_SAVE_LDFLAGS
     # Debug builds should always have frame pointers
     MOZ_DEBUG_FLAGS="-g -fno-omit-frame-pointer"
 
     if test "x$lto_is_enabled" = "xyes"; then
         echo "Skipping -dead_strip because lto is enabled."
     dnl DTrace and -dead_strip don't interact well. See bug 403132.
     dnl ===================================================================
     elif test "x$enable_dtrace" = "xyes"; then
@@ -3268,17 +3278,17 @@ MOZ_CHECK_HEADERS(gnu/libc-version.h nl_
 MOZ_CHECK_HEADERS(malloc.h)
 MOZ_CHECK_HEADERS(X11/XKBlib.h)
 MOZ_CHECK_HEADERS(io.h)
 
 dnl These are all the places some variant of statfs can be hiding.
 MOZ_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
 
 dnl Quota support
-MOZ_CHECK_HEADERS(sys/quota.h)
+MOZ_CHECK_HEADERS(sys/quota.h sys/sysmacros.h)
 MOZ_CHECK_HEADERS(linux/quota.h)
 
 dnl Try for MMX support
 dnl NB - later gcc versions require -mmmx for this header to be successfully
 dnl included (or another option which implies it, such as -march=pentium-mmx)
 MOZ_CHECK_HEADERS(mmintrin.h)
 
 dnl Check whether the compiler supports the new-style C++ standard
@@ -4782,19 +4792,17 @@ esac
 
 MOZ_ARG_ENABLE_STRING(application,
 [  --enable-application=APP
                           Options include:
                             browser (Firefox)
                             xulrunner
                             content/xslt (Standalone Transformiix XSLT)
                             netwerk (Standalone Necko)
-                            tools/update-packaging (AUS-related packaging tools)
-                            standalone (use this for standalone
-                              xpcom/xpconnect or to manually drive a build)],
+                            tools/update-packaging (AUS-related packaging tools)],
 [ MOZ_BUILD_APP=$enableval ] )
 
 MOZ_ARG_WITH_STRING(xulrunner-stub-name,
 [  --with-xulrunner-stub-name=appname   Create the xulrunner stub with the given name],
   XULRUNNER_STUB_NAME=$withval)
 
 if test -z "$XULRUNNER_STUB_NAME"; then
   case "$target_os" in
@@ -4862,22 +4870,16 @@ browser)
 xulrunner)
   AC_DEFINE(MOZ_XULRUNNER)
   ;;
 
 content/xslt)
   AC_DEFINE(TX_EXE)
   ;;
 
-standalone) 
-  MOZ_APP_NAME=mozilla
-  MOZ_APP_DISPLAYNAME=Mozilla
-  MOZ_APP_VERSION=$MOZILLA_VERSION
-  ;;
-
 esac
 
 AC_SUBST(MOZ_BUILD_APP)
 AC_SUBST(MOZ_PHOENIX)
 AC_SUBST(MOZ_XULRUNNER)
 
 AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP)
 
@@ -4992,23 +4994,37 @@ cairo-os2)
     MOZ_WIDGET_TOOLKIT=os2
     USE_FC_FREETYPE=1
     TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
     TK_LIBS='$(MOZ_CAIRO_LIBS)'
     MOZ_PDF_PRINTING=1
     ;;
 
 cairo-cocoa)
-    MOZ_WIDGET_TOOLKIT=cocoa
-    AC_DEFINE(MOZ_WIDGET_COCOA)
+    # Check if we have the Cocoa framework, or if we're targeting Cocoa Touch
+    _SAVE_LDFLAGS=$LDFLAGS
+    LDFLAGS="$LDFLAGS -framework Cocoa"
+    AC_TRY_LINK(,[return 0;],_HAVE_FRAMEWORK_COCOA=1,_HAVE_FRAMEWORK_COCOA=)
+    if test -z "$_HAVE_FRAMEWORK_COCOA"; then
+        LDFLAGS="$_SAVE_LDFLAGS -framework UIKit";
+        AC_TRY_LINK(,[return 0;],_HAVE_FRAMEWORK_UIKIT=1,
+                    AC_MSG_ERROR([Neither Cocoa nor UIKit frameworks were found. Are you using the correct SDK?]))
+        MOZ_WIDGET_TOOLKIT=uikit
+      AC_DEFINE(MOZ_WIDGET_UIKIT)
+      TK_LIBS='-framework Foundation -framework CoreFoundation -framework CoreGraphics -framework CoreText'
+    else
+      MOZ_WIDGET_TOOLKIT=cocoa
+      AC_DEFINE(MOZ_WIDGET_COCOA)
+      TK_LIBS='-framework QuartzCore -framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook -framework OpenGL'
+    fi
     MOZ_USER_DIR="Mozilla"
     AC_DEFINE(XP_MACOSX)
-    TK_LIBS='-framework QuartzCore -framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook -framework OpenGL'
+
     TK_CFLAGS="-DNO_X11"
-    LDFLAGS="$LDFLAGS -framework Cocoa -lobjc"
+    LDFLAGS="$LDFLAGS -lobjc"
     CFLAGS="$CFLAGS $TK_CFLAGS"
     CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
     LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL'
     MOZ_FS_LAYOUT=bundle
     MOZ_WEBGL=1
     MOZ_INSTRUMENT_EVENT_LOOP=1
     ;;
 
@@ -5108,25 +5124,24 @@ then
     MOZ_ARG_WITH_STRING(qtdir,
     [  --with-qtdir=\$dir       Specify Qt directory ],
     [ QTDIR=$withval])
 
     if test -z "$QTDIR"; then
         PKG_CHECK_MODULES(MOZ_QT, QtGui QtNetwork QtCore QtOpenGL)
         AC_CHECK_PROGS(HOST_MOC, $MOC moc, "")
     else
-        MOZ_QT_LIBS="-L$QTDIR/lib/ -lQtGui -lQtNetwork -lQtCore -lQtDBus -lQtXml -lQtOpenGL"
+        MOZ_QT_LIBS="-L$QTDIR/lib/ -lQtGui -lQtNetwork -lQtCore -lQtXml -lQtOpenGL"
 
         MOZ_QT_CFLAGS="-DQT_SHARED"
         MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include"
         MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/Qt"
         MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtGui"
         MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtCore"
         MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtNetwork"
-        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtDBus"
         MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtXml"
         HOST_MOC="$QTDIR/bin/moc"
     fi
     if test -z "$HOST_MOC"; then
         AC_MSG_ERROR([No acceptable moc preprocessor found. Qt SDK is not installed or --with-qt is
 incorrect])
     fi
     MOC=$HOST_MOC
@@ -5157,17 +5172,17 @@ incorrect])
     PKG_CHECK_MODULES(_QTMOBILITY, QtSensors QtFeedback QtLocation,
                       MOZ_ENABLE_QTMOBILITY=1,
                       MOZ_ENABLE_QTMOBILITY=)
     if test "$MOZ_ENABLE_QTMOBILITY"; then
        MOZ_ENABLE_QTMOBILITY=1
        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QTMOBILITY_CFLAGS"
        MOZ_QT_LIBS="$MOZ_QT_LIBS $_QTMOBILITY_LIBS"
     else
-       AC_CHECK_LIB(QtSensors QtFeedback QtLocation, main, [
+       AC_CHECK_LIB(QtSensors, main, [
           MOZ_ENABLE_QTMOBILITY=1
           MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I/usr/include/qt4/QtMobility"
           MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I/usr/include/qt4/QtSensors"
           MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I/usr/include/qt4/QtFeedback"
           MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I/usr/include/qt4/QtLocation"
           MOZ_QT_LIBS="$MOZ_QT_LIBS -lQtSensors -lQtFeedback -lQtLocation"
        ])
     fi
@@ -7376,78 +7391,44 @@ else
     ;;
   *-*freebsd*)
     AC_DEFINE(MOZ_MEMORY_BSD)
     ;;
   *-android*|*-linuxandroid*)
     AC_DEFINE(MOZ_MEMORY_LINUX)
     AC_DEFINE(MOZ_MEMORY_ANDROID)
     _WRAP_MALLOC=1
-    export WRAP_MALLOC_LIB="-L$_objdir/dist/lib -lmozalloc -lmozutils"
+    export WRAP_MALLOC_LIB="-L$_objdir/dist/lib -lmozutils"
     WRAP_MALLOC_CFLAGS="-Wl,--wrap=dlopen -Wl,--wrap=dlclose -Wl,--wrap=dlerror -Wl,--wrap=dlsym -Wl,--wrap=dladdr"
     ;;
   *-*linux*)
     AC_DEFINE(MOZ_MEMORY_LINUX)
     ;;
   *-netbsd*)
     AC_DEFINE(MOZ_MEMORY_BSD)
     ;;
   *-solaris*)
     AC_DEFINE(MOZ_MEMORY_SOLARIS)
     ;;
   *-mingw*)
     AC_DEFINE(MOZ_MEMORY_WINDOWS)
-    AC_MSG_CHECKING([for VC2005/2008++ CRT source])
-    if test "$CC_VERSION" == "14.00.50727.762" -o "$CC_VERSION" == "15.00.30729.01"; then
-      if test -z "$WIN32_CRT_SRC_DIR" -a -n "$VCINSTALLDIR"; then
-        WIN32_CRT_SRC_DIR="$VCINSTALLDIR\crt\src"
-      fi
-      if test -n "$WIN32_CRT_SRC_DIR" -a -d "$WIN32_CRT_SRC_DIR"; then
-        AC_MSG_RESULT([yes])
-        dnl cpu check
-        case "${target_cpu}" in
-        i*86)
-          MOZ_CRT_CPU_ARCH=intel
-          ;;
-        x86_64)
-          MOZ_CRT_CPU_ARCH=amd64
-          ;;
-        *)
-          AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
-          ;;
-        esac
-        AC_SUBST(MOZ_CRT_CPU_ARCH)
-        WIN32_OLD_STYLE_JEMALLOC=1
-        AC_DEFINE(WIN32_OLD_STYLE_JEMALLOC)
-        WIN32_CRT_SRC_DIR=`cd "$WIN32_CRT_SRC_DIR" && pwd -W`
-        _objdir_win=`pwd -W`
-        WIN32_CUSTOM_CRT_DIR="$_objdir_win/memory/jemalloc/crtsrc/build/$MOZ_CRT_CPU_ARCH"
-        MOZ_MEMORY_LDFLAGS="-MANIFEST:NO -LIBPATH:\"$WIN32_CUSTOM_CRT_DIR\" -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt19 -DEFAULTLIB:mozcpp19"
-      fi
-    fi
-    if test -z "$WIN32_OLD_STYLE_JEMALLOC"; then
-      AC_MSG_RESULT([no])
-      WIN32_NEW_STYLE_JEMALLOC=1
-      AC_DEFINE(WIN32_NEW_STYLE_JEMALLOC)
-      WIN32_CRT_SRC_DIR=
-      if test -z "$MOZ_DEBUG"; then
-        WIN32_CRT_LIBS="msvcrt.lib msvcprt.lib"
-      else
-        WIN32_CRT_LIBS="msvcrtd.lib msvcprtd.lib"
-      fi
-      dnl Look for a broken crtdll.obj
-      WIN32_CRTDLL_FULLPATH=`lib -nologo -list $WIN32_CRT_LIBS | grep crtdll\\.obj`
-      lib -NOLOGO -OUT:crtdll.obj $WIN32_CRT_LIBS -EXTRACT:$WIN32_CRTDLL_FULLPATH
-      if grep -q '__imp__\{0,1\}free' crtdll.obj; then
-        MOZ_MEMORY_LDFLAGS='-LIBPATH:$(DIST)/lib -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt'
-      else
-        MOZ_MEMORY_LDFLAGS='$(DIST)/../memory/jemalloc/jemalloc.lib'
-      fi
-      rm crtdll.obj
-    fi
+    if test -z "$MOZ_DEBUG"; then
+      WIN32_CRT_LIBS="msvcrt.lib msvcprt.lib"
+    else
+      WIN32_CRT_LIBS="msvcrtd.lib msvcprtd.lib"
+    fi
+    dnl Look for a broken crtdll.obj
+    WIN32_CRTDLL_FULLPATH=`lib -nologo -list $WIN32_CRT_LIBS | grep crtdll\\.obj`
+    lib -NOLOGO -OUT:crtdll.obj $WIN32_CRT_LIBS -EXTRACT:$WIN32_CRTDLL_FULLPATH
+    if grep -q '__imp__\{0,1\}free' crtdll.obj; then
+      MOZ_MEMORY_LDFLAGS='-LIBPATH:$(DIST)/lib -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt'
+    else
+      MOZ_MEMORY_LDFLAGS='$(DIST)/../memory/jemalloc/jemalloc.lib'
+    fi
+    rm crtdll.obj
 
     dnl Also pass this to NSPR/NSS
     DLLFLAGS="$DLLFLAGS $MOZ_MEMORY_LDFLAGS"
     export DLLFLAGS
     ;;
   *)
     AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
     ;;
@@ -7457,33 +7438,31 @@ else
     dnl NB: this must be kept in sync with jemalloc.h
     AC_DEFINE(HAVE_JEMALLOC_VALLOC)
   fi
   AC_DEFINE(HAVE_JEMALLOC_POSIX_MEMALIGN)
   AC_DEFINE(HAVE_JEMALLOC_MEMALIGN)
 fi # MOZ_MEMORY
 AC_SUBST(MOZ_MEMORY)
 AC_SUBST(MOZ_MEMORY_LDFLAGS)
-AC_SUBST(WIN32_OLD_STYLE_JEMALLOC)
 AC_SUBST(WIN32_CRT_LIBS)
-AC_SUBST(WIN32_CRT_SRC_DIR)
 dnl Need to set this for make because NSS doesn't have configure
 AC_SUBST(DLLFLAGS)
 
 dnl ========================================================
 dnl = Use malloc wrapper lib
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(wrap-malloc,
 [  --enable-wrap-malloc    Wrap malloc calls (gnu linker only)],
     _WRAP_MALLOC=1,
     _WRAP_MALLOC= )
 
 if test -n "$_WRAP_MALLOC"; then
     if test "$GNU_CC"; then
-    WRAP_MALLOC_CFLAGS="${LDFLAGS} ${WRAP_MALLOC_CFLAGS} -Wl,--wrap -Wl,malloc -Wl,--wrap -Wl,calloc -Wl,--wrap -Wl,valloc -Wl,--wrap -Wl,free -Wl,--wrap -Wl,realloc -Wl,--wrap -Wl,memalign -Wl,--wrap -Wl,__builtin_new -Wl,--wrap -Wl,__builtin_vec_new -Wl,--wrap -Wl,__builtin_delete -Wl,--wrap -Wl,__builtin_vec_delete -Wl,--wrap -Wl,PR_Free -Wl,--wrap -Wl,PR_Malloc -Wl,--wrap -Wl,PR_Calloc -Wl,--wrap -Wl,PR_Realloc -Wl,--wrap -Wl,strdup -Wl,--wrap -Wl,strndup -Wl,--wrap -Wl,posix_memalign"
+    WRAP_MALLOC_CFLAGS="${LDFLAGS} ${WRAP_MALLOC_CFLAGS} -Wl,--wrap -Wl,malloc -Wl,--wrap -Wl,calloc -Wl,--wrap -Wl,valloc -Wl,--wrap -Wl,free -Wl,--wrap -Wl,realloc -Wl,--wrap -Wl,memalign -Wl,--wrap -Wl,__builtin_new -Wl,--wrap -Wl,__builtin_vec_new -Wl,--wrap -Wl,__builtin_delete -Wl,--wrap -Wl,__builtin_vec_delete -Wl,--wrap -Wl,PR_Free -Wl,--wrap -Wl,PR_Malloc -Wl,--wrap -Wl,PR_Calloc -Wl,--wrap -Wl,PR_Realloc -Wl,--wrap -Wl,strdup -Wl,--wrap -Wl,strndup -Wl,--wrap -Wl,posix_memalign -Wl,--wrap,malloc_usable_size"
     MKSHLIB="$MKSHLIB"' $(WRAP_MALLOC_CFLAGS) $(WRAP_MALLOC_LIB)'
     MKCSHLIB="$MKCSHLIB"' $(WRAP_MALLOC_CFLAGS) $(WRAP_MALLOC_LIB)'
     fi
 fi
 
 dnl ========================================================
 dnl = Location of malloc wrapper lib
 dnl ========================================================
@@ -8014,16 +7993,17 @@ if test "$_PEDANTIC"; then
     esac
 fi
 
 dnl ========================================================
 dnl Test for correct temporary object destruction order
 dnl ========================================================
 dnl We want to make sure the compiler follows the C++ spec here as 
 dnl xpcom and the string classes depend on it (bug 235381).
+if test -z "$CROSS_COMPILE"; then
 AC_MSG_CHECKING([for correct temporary object destruction order])
 AC_TRY_RUN([ class A {
              public:  A(int& x) : mValue(x) {}
                       ~A() { mValue--; }
                       operator char**() { return 0; }
              private:  int& mValue;
              };
              void func(char **arg) {}
@@ -8038,16 +8018,17 @@ AC_TRY_RUN([ class A {
              }
              ],
      result="yes", result="no", result="maybe")
 AC_MSG_RESULT([$result])
 
 if test "$result" = "no"; then
     AC_MSG_ERROR([Your compiler does not follow the C++ specification for temporary object destruction order.])
 fi
+fi
 
 dnl ========================================================
 dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
 dnl provide non-const forms of the operator== for comparing nsCOMPtrs to
 dnl raw pointers in nsCOMPtr.h.  (VC++ has the same bug.)
 dnl ========================================================
 _SAVE_CXXFLAGS=$CXXFLAGS
 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
@@ -8521,17 +8502,17 @@ if test "$MOZ_TREE_CAIRO"; then
         FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
         MOZ_ENABLE_CAIRO_FT=1
         CAIRO_FT_CFLAGS="$FT2_CFLAGS"
     fi
     case "$MOZ_WIDGET_TOOLKIT" in
       qt)
         QT_SURFACE_FEATURE="#define CAIRO_HAS_QT_SURFACE 1"
         ;;
-      cocoa)
+      cocoa | uikit)
         QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
         QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1"
         QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1"
         ;;
       windows)
         WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
         WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
         if test "$MOZ_WINSDK_TARGETVER" -ge "06010000"; then
--- a/content/base/public/nsIFrameMessageManager.idl
+++ b/content/base/public/nsIFrameMessageManager.idl
@@ -120,21 +120,26 @@ interface nsIInProcessContentFrameMessag
 
 [scriptable, uuid(6331bbca-2c9f-4766-b3c7-ae75554bf1ec)]
 interface nsITreeItemFrameMessageManager : nsIFrameMessageManager
 {
   readonly attribute unsigned long childCount;
   nsITreeItemFrameMessageManager getChildAt(in unsigned long aIndex);
 };
 
-[scriptable, uuid(23e6ef7b-8cc5-4e8b-9391-453440a3b858)]
+[scriptable, uuid(9e5c0526-aa4c-49f0-afbb-57f489cd9b59)]
 interface nsIChromeFrameMessageManager : nsITreeItemFrameMessageManager
 {
-  /*
+  /**
    * Load a script in the (remote) frame. aURL must be the absolute URL.
    * data: URLs are also supported. For example data:,dump("foo\n");
    * If aAllowDelayedLoad is true, script will be loaded when the
    * remote frame becomes available. Otherwise the script will be loaded
    * only if the frame is already available.
    */
   void loadFrameScript(in AString aURL, in boolean aAllowDelayedLoad);
+
+  /**
+   * Removes aURL from the list of scripts which support delayed load.
+   */
+  void removeDelayedFrameScript(in AString aURL);
 };
 
--- a/content/base/public/nsINode.h
+++ b/content/base/public/nsINode.h
@@ -43,16 +43,17 @@
 #include "nsPropertyTable.h"
 #include "nsTObserverArray.h"
 #include "nsINodeInfo.h"
 #include "nsCOMPtr.h"
 #include "nsWrapperCache.h"
 #include "nsIProgrammingLanguage.h" // for ::JAVASCRIPT
 #include "nsDOMError.h"
 #include "nsDOMString.h"
+#include "jspubtd.h"
 
 class nsIContent;
 class nsIDocument;
 class nsIDOMEvent;
 class nsIDOMNode;
 class nsIDOMNodeList;
 class nsINodeList;
 class nsIPresShell;
@@ -275,18 +276,18 @@ private:
 #define DOM_USER_DATA         1
 #define DOM_USER_DATA_HANDLER 2
 #ifdef MOZ_SMIL
 #define SMIL_MAPPED_ATTR_ANIMVAL 3
 #endif // MOZ_SMIL
 
 // IID for the nsINode interface
 #define NS_INODE_IID \
-{ 0xc7abbb40, 0x2571, 0x4d12, \
- { 0x8f, 0x89, 0x0d, 0x4f, 0x55, 0xc0, 0x92, 0xf6 } }
+{ 0xcdab747e, 0xa58f, 0x4b96, \
+ { 0x8b, 0xae, 0x9d, 0x53, 0xe0, 0xa7, 0x8a, 0x74 } }
 
 /**
  * An internal interface that abstracts some DOMNode-related parts that both
  * nsIContent and nsIDocument share.  An instance of this interface has a list
  * of nsIContent children and provides access to them.
  */
 class nsINode : public nsIDOMEventTarget,
                 public nsWrapperCache
@@ -1361,16 +1362,28 @@ protected:
    * @param aKid The child to insert.
    * @param aIndex The index to insert at.
    * @param aNotify Whether to notify.
    * @param aChildArray The child array to work with
    */
   nsresult doInsertChildAt(nsIContent* aKid, PRUint32 aIndex,
                            PRBool aNotify, nsAttrAndChildArray& aChildArray);
 
+  /* Event stuff that documents and elements share.  This needs to be
+     NS_IMETHOD because some subclasses implement DOM methods with
+     this exact name and signature and then the calling convention
+     needs to match. */
+#define EVENT(name_, id_, type_, struct_)                         \
+  NS_IMETHOD GetOn##name_(JSContext *cx, jsval *vp);              \
+  NS_IMETHOD SetOn##name_(JSContext *cx, const jsval &v);
+#define TOUCH_EVENT EVENT
+#include "nsEventNameList.h"
+#undef TOUCH_EVENT
+#undef EVENT  
+
   nsCOMPtr<nsINodeInfo> mNodeInfo;
 
   nsINode* mParent;
 
   PRUint32 mFlags;
 
 private:
   // Boolean flags.
--- a/content/base/src/contentSecurityPolicy.js
+++ b/content/base/src/contentSecurityPolicy.js
@@ -307,22 +307,16 @@ ContentSecurityPolicy.prototype = {
                     .createInstance(Ci.nsIXMLHttpRequest);  
 
         try {
           req.open("POST", uris[i], true);
           req.setRequestHeader('Content-Type', 'application/json');
           req.upload.addEventListener("error", failure, false);
           req.upload.addEventListener("abort", failure, false);
 
-          // make request anonymous
-          // This prevents sending cookies with the request,
-          // in case the policy URI is injected, it can't be
-          // abused for CSRF.
-          req.channel.loadFlags |= Ci.nsIChannel.LOAD_ANONYMOUS;
-
           req.send(JSON.stringify(report));
           CSPdebug("Sent violation report to " + uris[i]);
         } catch(e) {
           // it's possible that the URI was invalid, just log a
           // warning and skip over that.
           CSPWarning("Tried to send report to invalid URI: \"" + uris[i] + "\"");
         }
       }
--- a/content/base/src/nsAttrAndChildArray.cpp
+++ b/content/base/src/nsAttrAndChildArray.cpp
@@ -570,17 +570,23 @@ nsAttrAndChildArray::IndexOfAttr(nsIAtom
 
 nsresult
 nsAttrAndChildArray::SetAndTakeMappedAttr(nsIAtom* aLocalName,
                                           nsAttrValue& aValue,
                                           nsMappedAttributeElement* aContent,
                                           nsHTMLStyleSheet* aSheet)
 {
   nsRefPtr<nsMappedAttributes> mapped;
-  nsresult rv = GetModifiableMapped(aContent, aSheet, PR_TRUE,
+
+  PRBool willAdd = PR_TRUE;
+  if (mImpl && mImpl->mMappedAttrs) {
+    willAdd = mImpl->mMappedAttrs->GetAttr(aLocalName) == nsnull;
+  }
+
+  nsresult rv = GetModifiableMapped(aContent, aSheet, willAdd,
                                     getter_AddRefs(mapped));
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = mapped->SetAndTakeAttr(aLocalName, aValue);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return MakeMappedUnique(mapped);
 }
--- a/content/base/src/nsContentAreaDragDrop.cpp
+++ b/content/base/src/nsContentAreaDragDrop.cpp
@@ -41,17 +41,16 @@
 // Local Includes
 #include "nsContentAreaDragDrop.h"
 
 // Helper Classes
 #include "nsString.h"
 
 // Interfaces needed to be included
 #include "nsCopySupport.h"
-#include "nsIDOMNSUIEvent.h"
 #include "nsIDOMUIEvent.h"
 #include "nsISelection.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMEvent.h"
 #include "nsIDOMNSEvent.h"
 #include "nsIDOMDragEvent.h"
 #include "nsPIDOMWindow.h"
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -136,17 +136,16 @@ static NS_DEFINE_CID(kXTFServiceCID, NS_
 #include "nsContentCreatorFunctions.h"
 #include "nsGUIEvent.h"
 #include "nsMutationEvent.h"
 #include "nsIMEStateManager.h"
 #include "nsContentErrors.h"
 #include "nsUnicharUtilCIID.h"
 #include "nsCompressedCharMap.h"
 #include "nsINativeKeyBindings.h"
-#include "nsIDOMNSUIEvent.h"
 #include "nsIDOMNSEvent.h"
 #include "nsIPrivateDOMEvent.h"
 #include "nsXULPopupManager.h"
 #include "nsIPermissionManager.h"
 #include "nsIContentPrefService.h"
 #include "nsIScriptObjectPrincipal.h"
 #include "nsIRunnable.h"
 #include "nsDOMJSUtils.h"
@@ -4132,23 +4131,22 @@ nsContentUtils::GetNativeEvent(nsIDOMEve
 }
 
 //static
 PRBool
 nsContentUtils::DOMEventToNativeKeyEvent(nsIDOMKeyEvent* aKeyEvent,
                                          nsNativeKeyEvent* aNativeEvent,
                                          PRBool aGetCharCode)
 {
-  nsCOMPtr<nsIDOMNSUIEvent> uievent = do_QueryInterface(aKeyEvent);
+  nsCOMPtr<nsIDOMNSEvent> nsevent = do_QueryInterface(aKeyEvent);
   PRBool defaultPrevented;
-  uievent->GetPreventDefault(&defaultPrevented);
+  nsevent->GetPreventDefault(&defaultPrevented);
   if (defaultPrevented)
     return PR_FALSE;
 
-  nsCOMPtr<nsIDOMNSEvent> nsevent = do_QueryInterface(aKeyEvent);
   PRBool trusted = PR_FALSE;
   nsevent->GetIsTrusted(&trusted);
   if (!trusted)
     return PR_FALSE;
 
   if (aGetCharCode) {
     aKeyEvent->GetCharCode(&aNativeEvent->charCode);
   } else {
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -1696,16 +1696,18 @@ NS_INTERFACE_TABLE_HEAD(nsDocument)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocumentXBL)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIScriptObjectPrincipal)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMEventTarget)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsISupportsWeakReference)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIRadioGroupContainer)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIMutationObserver)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIApplicationCacheContainer)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocumentTouch)
+    NS_INTERFACE_TABLE_ENTRY(nsDocument, nsITouchEventReceiver)
+    NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIInlineEventHandlers)
   NS_OFFSET_AND_INTERFACE_TABLE_END
   NS_OFFSET_AND_INTERFACE_TABLE_TO_MAP_SEGUE
   NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(nsDocument)
   NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMXPathNSResolver,
                                  new nsNode3Tearoff(this))
   NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMNodeSelector,
                                  new nsNodeSelectorTearoff(this))
   if (aIID.Equals(NS_GET_IID(nsIDOMXPathEvaluator)) ||
@@ -8466,8 +8468,19 @@ nsIDocument::SizeOf() const
 PRInt64
 nsDocument::SizeOf() const
 {
   PRInt64 size = MemoryReporter::GetBasicSize<nsDocument, nsIDocument>(this);
   size += mAttrStyleSheet ? mAttrStyleSheet->DOMSizeOf() : 0;
   return size;
 }
 
+#define EVENT(name_, id_, type_, struct_)                                 \
+  NS_IMETHODIMP nsDocument::GetOn##name_(JSContext *cx, jsval *vp) {      \
+    return nsINode::GetOn##name_(cx, vp);                                 \
+  }                                                                       \
+  NS_IMETHODIMP nsDocument::SetOn##name_(JSContext *cx, const jsval &v) { \
+    return nsINode::SetOn##name_(cx, v);                                  \
+  }
+#define TOUCH_EVENT EVENT
+#include "nsEventNameList.h"
+#undef TOUCH_EVENT
+#undef EVENT
--- a/content/base/src/nsDocument.h
+++ b/content/base/src/nsDocument.h
@@ -93,16 +93,17 @@
 #include "nsIInterfaceRequestor.h"
 #include "nsILoadContext.h"
 #include "nsIProgressEventSink.h"
 #include "nsISecurityEventSink.h"
 #include "nsIChannelEventSink.h"
 #include "imgIRequest.h"
 #include "nsIDOMDOMImplementation.h"
 #include "nsIDOMTouchEvent.h"
+#include "nsIInlineEventHandlers.h"
 #include "nsDataHashtable.h"
 #include "TimeStamp.h"
 
 #define XML_DECLARATION_BITS_DECLARATION_EXISTS   (1 << 0)
 #define XML_DECLARATION_BITS_ENCODING_EXISTS      (1 << 1)
 #define XML_DECLARATION_BITS_STANDALONE_EXISTS    (1 << 2)
 #define XML_DECLARATION_BITS_STANDALONE_YES       (1 << 3)
 
@@ -487,17 +488,18 @@ protected:
 class nsDocument : public nsIDocument,
                    public nsIDOMXMLDocument, // inherits nsIDOMDocument
                    public nsIDOMDocumentXBL,
                    public nsSupportsWeakReference,
                    public nsIScriptObjectPrincipal,
                    public nsIRadioGroupContainer,
                    public nsIApplicationCacheContainer,
                    public nsStubMutationObserver,
-                   public nsIDOMDocumentTouch
+                   public nsIDOMDocumentTouch,
+                   public nsIInlineEventHandlers
 {
 public:
   typedef mozilla::dom::Element Element;
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_DOM_MEMORY_REPORTER_SIZEOF
 
   using nsINode::GetScriptTypeID;
@@ -776,19 +778,25 @@ public:
     GetListenerManager(PRBool aCreateIfNotFound);
 
   // nsIScriptObjectPrincipal
   virtual nsIPrincipal* GetPrincipal();
 
   // nsIApplicationCacheContainer
   NS_DECL_NSIAPPLICATIONCACHECONTAINER
 
+  // nsITouchEventReceiver
+  NS_DECL_NSITOUCHEVENTRECEIVER
+
   // nsIDOMDocumentTouch
   NS_DECL_NSIDOMDOCUMENTTOUCH
 
+  // nsIInlineEventHandlers
+  NS_DECL_NSIINLINEEVENTHANDLERS
+
   virtual nsresult Init();
   
   virtual void AddXMLEventsContent(nsIContent * aXMLEventsElement);
 
   virtual nsresult CreateElem(const nsAString& aName, nsIAtom *aPrefix,
                               PRInt32 aNamespaceID,
                               PRBool aDocumentDefaultType,
                               nsIContent **aResult);
--- a/content/base/src/nsFrameMessageManager.cpp
+++ b/content/base/src/nsFrameMessageManager.cpp
@@ -172,16 +172,23 @@ nsFrameMessageManager::LoadFrameScript(c
       // Use PR_FALSE here, so that child managers don't cache the script, which
       // is already cached in the parent.
       mm->LoadFrameScript(aURL, PR_FALSE);
     }
   }
   return NS_OK;
 }
 
+NS_IMETHODIMP
+nsFrameMessageManager::RemoveDelayedFrameScript(const nsAString& aURL)
+{
+  mPendingScripts.RemoveElement(aURL);
+  return NS_OK;
+}
+
 static JSBool
 JSONCreator(const jschar* aBuf, uint32 aLen, void* aData)
 {
   nsAString* result = static_cast<nsAString*>(aData);
   result->Append((PRUnichar*)aBuf, (PRUint32)aLen);
   return JS_TRUE;
 }
 
--- a/content/base/src/nsGenericElement.cpp
+++ b/content/base/src/nsGenericElement.cpp
@@ -142,16 +142,18 @@
 #include "mozAutoDocUpdate.h"
 
 #include "nsCSSParser.h"
 #include "prprf.h"
 
 #include "nsSVGFeatures.h"
 #include "nsDOMMemoryReporter.h"
 
+#include "xpcpublic.h"
+
 using namespace mozilla::dom;
 namespace css = mozilla::css;
 
 NS_DEFINE_IID(kThisPtrOffsetsSID, NS_THISPTROFFSETS_SID);
 
 PRInt32 nsIContent::sTabFocusModel = eTabFocus_any;
 PRBool nsIContent::sTabFocusModelAppliesToXUL = PR_FALSE;
 PRUint32 nsMutationGuard::sMutationCount = 0;
@@ -2145,16 +2147,38 @@ nsNodeSelectorTearoff::QuerySelector(con
 NS_IMETHODIMP
 nsNodeSelectorTearoff::QuerySelectorAll(const nsAString& aSelector,
                                         nsIDOMNodeList **aReturn)
 {
   return nsGenericElement::doQuerySelectorAll(mNode, aSelector, aReturn);
 }
 
 //----------------------------------------------------------------------
+
+NS_IMPL_CYCLE_COLLECTION_1(nsTouchEventReceiverTearoff, mElement)
+
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsTouchEventReceiverTearoff)
+  NS_INTERFACE_MAP_ENTRY(nsITouchEventReceiver)
+NS_INTERFACE_MAP_END_AGGREGATED(mElement)
+
+NS_IMPL_CYCLE_COLLECTING_ADDREF(nsTouchEventReceiverTearoff)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(nsTouchEventReceiverTearoff)
+
+//----------------------------------------------------------------------
+
+NS_IMPL_CYCLE_COLLECTION_1(nsInlineEventHandlersTearoff, mElement)
+
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsInlineEventHandlersTearoff)
+  NS_INTERFACE_MAP_ENTRY(nsIInlineEventHandlers)
+NS_INTERFACE_MAP_END_AGGREGATED(mElement)
+
+NS_IMPL_CYCLE_COLLECTING_ADDREF(nsInlineEventHandlersTearoff)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(nsInlineEventHandlersTearoff)
+
+//----------------------------------------------------------------------
 nsGenericElement::nsDOMSlots::nsDOMSlots()
   : nsINode::nsSlots(),
     mDataset(nsnull),
     mBindingParent(nsnull)
 {
 }
 
 nsGenericElement::nsDOMSlots::~nsDOMSlots()
@@ -3612,17 +3636,17 @@ nsGenericElement::DispatchClickEvent(nsP
   PRUint32 clickCount = 1;
   float pressure = 0;
   PRUint16 inputSource = 0;
   if (aSourceEvent->eventStructType == NS_MOUSE_EVENT) {
     clickCount = static_cast<nsMouseEvent*>(aSourceEvent)->clickCount;
     pressure = static_cast<nsMouseEvent*>(aSourceEvent)->pressure;
     inputSource = static_cast<nsMouseEvent*>(aSourceEvent)->inputSource;
   } else if (aSourceEvent->eventStructType == NS_KEY_EVENT) {
-    inputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_KEYBOARD;
+    inputSource = nsIDOMMouseEvent::MOZ_SOURCE_KEYBOARD;
   }
   event.pressure = pressure;
   event.clickCount = clickCount;
   event.inputSource = inputSource;
   event.isShift = aSourceEvent->isShift;
   event.isControl = aSourceEvent->isControl;
   event.isAlt = aSourceEvent->isAlt;
   event.isMeta = aSourceEvent->isMeta;
@@ -4260,16 +4284,20 @@ NS_INTERFACE_MAP_BEGIN(nsGenericElement)
   NS_INTERFACE_MAP_ENTRY(nsIDOMEventTarget)
   NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMNSElement, new nsNSElementTearoff(this))
   NS_INTERFACE_MAP_ENTRY_TEAROFF(nsISupportsWeakReference,
                                  new nsNodeSupportsWeakRefTearoff(this))
   NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMNodeSelector,
                                  new nsNodeSelectorTearoff(this))
   NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMXPathNSResolver,
                                  new nsNode3Tearoff(this))
+  NS_INTERFACE_MAP_ENTRY_TEAROFF(nsITouchEventReceiver,
+                                 new nsTouchEventReceiverTearoff(this))
+  NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIInlineEventHandlers,
+                                 new nsInlineEventHandlersTearoff(this))
   // nsNodeSH::PreCreate() depends on the identity pointer being the
   // same as nsINode (which nsIContent inherits), so if you change the
   // below line, make sure nsNodeSH::PreCreate() still does the right
   // thing!
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIContent)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsGenericElement)
@@ -5380,8 +5408,35 @@ nsGenericElement::SizeOf() const
   PRInt64 size = MemoryReporter::GetBasicSize<nsGenericElement, Element>(this);
 
   size -= sizeof(mAttrsAndChildren);
   size += mAttrsAndChildren.SizeOf();
 
   return size;
 }
 
+#define EVENT(name_, id_, type_, struct_)                                    \
+  NS_IMETHODIMP nsINode::GetOn##name_(JSContext *cx, jsval *vp) {            \
+    nsEventListenerManager *elm = GetListenerManager(PR_FALSE);              \
+    if (elm) {                                                               \
+      elm->GetJSEventListener(nsGkAtoms::on##name_, vp);                     \
+    } else {                                                                 \
+      *vp = JSVAL_NULL;                                                      \
+    }                                                                        \
+    return NS_OK;                                                            \
+  }                                                                          \
+  NS_IMETHODIMP nsINode::SetOn##name_(JSContext *cx, const jsval &v) {       \
+    nsEventListenerManager *elm = GetListenerManager(PR_TRUE);               \
+    if (!elm) {                                                              \
+      return NS_ERROR_OUT_OF_MEMORY;                                         \
+    }                                                                        \
+                                                                             \
+    JSObject *obj = GetWrapper();                                            \
+    if (!obj) {                                                              \
+      /* Just silently do nothing */                                         \
+      return NS_OK;                                                          \
+    }                                                                        \
+    return elm->SetJSEventListenerToJsval(nsGkAtoms::on##name_, cx, obj, v); \
+}
+#define TOUCH_EVENT EVENT
+#include "nsEventNameList.h"
+#undef TOUCH_EVENT
+#undef EVENT
--- a/content/base/src/nsGenericElement.h
+++ b/content/base/src/nsGenericElement.h
@@ -59,16 +59,18 @@
 #include "nsCycleCollectionParticipant.h"
 #include "nsIDocument.h"
 #include "nsIDOMNodeSelector.h"
 #include "nsIDOMXPathNSResolver.h"
 #include "nsPresContext.h"
 #include "nsIDOMDOMStringMap.h"
 #include "nsContentList.h"
 #include "nsDOMClassInfoID.h" // DOMCI_DATA
+#include "nsIDOMTouchEvent.h"
+#include "nsIInlineEventHandlers.h"
 
 #ifdef MOZ_SMIL
 #include "nsISMILAttr.h"
 #endif // MOZ_SMIL
 
 class nsIDOMAttr;
 class nsIDOMEventListener;
 class nsIFrame;
@@ -194,18 +196,16 @@ public:
   NS_DECL_NSISUPPORTSWEAKREFERENCE
 
   NS_DECL_CYCLE_COLLECTION_CLASS(nsNodeSupportsWeakRefTearoff)
 
 private:
   nsCOMPtr<nsINode> mNode;
 };
 
-#define NS_EVENT_TEAROFF_CACHE_SIZE 4
-
 /**
  * A tearoff class for nsGenericElement to implement NodeSelector
  */
 class nsNodeSelectorTearoff : public nsIDOMNodeSelector
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
@@ -221,28 +221,32 @@ private:
   ~nsNodeSelectorTearoff() {}
 
 private:
   nsCOMPtr<nsINode> mNode;
 };
 
 // Forward declare to allow being a friend
 class nsNSElementTearoff;
+class nsTouchEventReceiverTearoff;
+class nsInlineEventHandlersTearoff;
 
 /**
  * A generic base class for DOM elements, implementing many nsIContent,
  * nsIDOMNode and nsIDOMElement methods.
  */
 class nsGenericElement : public mozilla::dom::Element
 {
 public:
   nsGenericElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsGenericElement();
 
   friend class nsNSElementTearoff;
+  friend class nsTouchEventReceiverTearoff;
+  friend class nsInlineEventHandlersTearoff;
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   NS_DECL_DOM_MEMORY_REPORTER_SIZEOF
 
   /**
    * Called during QueryInterface to give the binding manager a chance to
    * get an interface for this element.
@@ -1052,16 +1056,56 @@ public:
   nsNSElementTearoff(nsGenericElement *aContent) : mContent(aContent)
   {
   }
 
 private:
   nsRefPtr<nsGenericElement> mContent;
 };
 
+/**
+ * Tearoff class to implement nsITouchEventReceiver
+ */
+class nsTouchEventReceiverTearoff : public nsITouchEventReceiver
+{
+public:
+  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
+
+  NS_FORWARD_NSITOUCHEVENTRECEIVER(mElement->)
+
+  NS_DECL_CYCLE_COLLECTION_CLASS(nsTouchEventReceiverTearoff)
+
+  nsTouchEventReceiverTearoff(nsGenericElement *aElement) : mElement(aElement)
+  {
+  }
+
+private:
+  nsRefPtr<nsGenericElement> mElement;
+};
+
+/**
+ * Tearoff class to implement nsIInlineEventHandlers
+ */
+class nsInlineEventHandlersTearoff : public nsIInlineEventHandlers
+{
+public:
+  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
+
+  NS_FORWARD_NSIINLINEEVENTHANDLERS(mElement->)
+
+  NS_DECL_CYCLE_COLLECTION_CLASS(nsInlineEventHandlersTearoff)
+
+  nsInlineEventHandlersTearoff(nsGenericElement *aElement) : mElement(aElement)
+  {
+  }
+
+private:
+  nsRefPtr<nsGenericElement> mElement;
+};
+
 #define NS_ELEMENT_INTERFACE_TABLE_TO_MAP_SEGUE                               \
     rv = nsGenericElement::QueryInterface(aIID, aInstancePtr);                \
     if (NS_SUCCEEDED(rv))                                                     \
       return rv;                                                              \
                                                                               \
     NS_OFFSET_AND_INTERFACE_TABLE_TO_MAP_SEGUE
 
 #define NS_ELEMENT_INTERFACE_MAP_END                                          \
--- a/content/base/src/nsGkAtomList.h
+++ b/content/base/src/nsGkAtomList.h
@@ -75,17 +75,16 @@ GK_ATOM(_moz_target, "_moz_target")
 GK_ATOM(_moz_type, "_moz-type")
 GK_ATOM(menuactive, "_moz-menuactive")
 GK_ATOM(_poundDefault, "#default")
 GK_ATOM(_asterix, "*")
 GK_ATOM(a, "a")
 GK_ATOM(abbr, "abbr")
 GK_ATOM(abort, "abort")
 GK_ATOM(above, "above")
-GK_ATOM(absoluteList, "Absolute-list")
 GK_ATOM(acceltext, "acceltext")
 GK_ATOM(accept, "accept")
 GK_ATOM(acceptcharset, "accept-charset")
 GK_ATOM(accesskey, "accesskey")
 GK_ATOM(acronym, "acronym")
 GK_ATOM(action, "action")
 GK_ATOM(active, "active")
 GK_ATOM(activetitlebarcolor, "activetitlebarcolor")
@@ -162,24 +161,22 @@ GK_ATOM(bottompadding, "bottompadding")
 GK_ATOM(bottomright, "bottomright")
 GK_ATOM(box, "box")
 GK_ATOM(br, "br")
 GK_ATOM(braille, "braille")
 GK_ATOM(broadcast, "broadcast")
 GK_ATOM(broadcaster, "broadcaster")
 GK_ATOM(broadcasterset, "broadcasterset")
 GK_ATOM(browser, "browser")
-GK_ATOM(bulletList, "Bullet-list")
 GK_ATOM(bulletinboard, "bulletinboard")
 GK_ATOM(button, "button")
 GK_ATOM(callTemplate, "call-template")
 GK_ATOM(cancel, "cancel")
 GK_ATOM(canvas, "canvas")
 GK_ATOM(caption, "caption")
-GK_ATOM(captionList, "Caption-list")
 GK_ATOM(capture, "capture")
 GK_ATOM(caseOrder, "case-order")
 GK_ATOM(cdataSectionElements, "cdata-section-elements")
 GK_ATOM(ceiling, "ceiling")
 GK_ATOM(cell, "cell")
 GK_ATOM(cellpadding, "cellpadding")
 GK_ATOM(cellspacing, "cellspacing")
 GK_ATOM(center, "center")
@@ -210,17 +207,16 @@ GK_ATOM(close, "close")
 GK_ATOM(closed, "closed")
 GK_ATOM(closemenu, "closemenu")
 GK_ATOM(coalesceduplicatearcs, "coalesceduplicatearcs")
 GK_ATOM(code, "code")
 GK_ATOM(codebase, "codebase")
 GK_ATOM(codetype, "codetype")
 GK_ATOM(col, "col")
 GK_ATOM(colgroup, "colgroup")
-GK_ATOM(colGroupList, "ColGroup-list")
 GK_ATOM(collapse, "collapse")
 GK_ATOM(collapsed, "collapsed")
 GK_ATOM(color, "color")
 GK_ATOM(colorIndex, "color-index")
 GK_ATOM(cols, "cols")
 GK_ATOM(colspan, "colspan")
 GK_ATOM(column, "column")
 GK_ATOM(columns, "columns")
@@ -355,38 +351,35 @@ GK_ATOM(enctype, "enctype")
 GK_ATOM(end, "end")
 GK_ATOM(end_after, "end_after")
 GK_ATOM(end_before, "end_before")
 GK_ATOM(equalsize, "equalsize")
 GK_ATOM(error, "error")
 GK_ATOM(even, "even")
 GK_ATOM(event, "event")
 GK_ATOM(events, "events")
-GK_ATOM(excessOverflowContainersList, "ExcessOverflowContainers-list")
 GK_ATOM(excludeResultPrefixes, "exclude-result-prefixes")
 GK_ATOM(excludes, "excludes")
 GK_ATOM(expr, "expr")
 GK_ATOM(extends, "extends")
 GK_ATOM(extensionElementPrefixes, "extension-element-prefixes")
 GK_ATOM(face, "face")
 GK_ATOM(fallback, "fallback")
 GK_ATOM(_false, "false")
 GK_ATOM(farthest, "farthest")
 GK_ATOM(field, "field")
 GK_ATOM(fieldset, "fieldset")
 GK_ATOM(figcaption, "figcaption")
 GK_ATOM(figure, "figure")
 GK_ATOM(fixed, "fixed")
-GK_ATOM(fixedList, "Fixed-list")
 GK_ATOM(flags, "flags")
 GK_ATOM(flex, "flex")
 GK_ATOM(flexgroup, "flexgroup")
 GK_ATOM(flip, "flip")
 GK_ATOM(floating, "floating")
-GK_ATOM(floatList, "Float-list")
 GK_ATOM(floor, "floor")
 GK_ATOM(flowlength, "flowlength")
 GK_ATOM(focus, "focus")
 GK_ATOM(following, "following")
 GK_ATOM(followingSibling, "following-sibling")
 GK_ATOM(font, "font")
 GK_ATOM(fontWeight, "font-weight")
 GK_ATOM(fontpicker, "fontpicker")
@@ -744,20 +737,17 @@ GK_ATOM(option, "option")
 GK_ATOM(_or, "or")
 GK_ATOM(order, "order")
 GK_ATOM(ordinal, "ordinal")
 GK_ATOM(orient, "orient")
 GK_ATOM(orientation, "orientation")
 GK_ATOM(otherwise, "otherwise")
 GK_ATOM(output, "output")
 GK_ATOM(overflow, "overflow")
-GK_ATOM(overflowList, "Overflow-list")
 GK_ATOM(overflowchanged, "overflowchanged")
-GK_ATOM(overflowContainersList, "OverflowContainers-list")
-GK_ATOM(overflowOutOfFlowList, "OverflowOutOfFlow-list")
 GK_ATOM(overlay, "overlay")
 GK_ATOM(overlap, "overlap")
 GK_ATOM(p, "p")
 GK_ATOM(pack, "pack")
 GK_ATOM(page, "page")
 GK_ATOM(pageincrement, "pageincrement")
 GK_ATOM(pagex, "pagex")
 GK_ATOM(pagey, "pagey")
@@ -782,17 +772,16 @@ GK_ATOM(plaintext, "plaintext")
 #ifdef MOZ_MEDIA
 GK_ATOM(playbackrate, "playbackrate")
 GK_ATOM(playcount, "playcount")
 #endif
 GK_ATOM(pointSize, "point-size")
 GK_ATOM(poly, "poly")
 GK_ATOM(polygon, "polygon")
 GK_ATOM(popup, "popup")
-GK_ATOM(popupList, "Popup-list")
 GK_ATOM(popupalign, "popupalign")
 GK_ATOM(popupanchor, "popupanchor")
 GK_ATOM(popupgroup, "popupgroup")
 GK_ATOM(popuphidden, "popuphidden")
 GK_ATOM(popuphiding, "popuphiding")
 GK_ATOM(popuplistener, "popuplistener")
 GK_ATOM(popupset, "popupset")
 GK_ATOM(popupshowing, "popupshowing")
@@ -823,17 +812,16 @@ GK_ATOM(progressmeter, "progressmeter")
 GK_ATOM(progressNormal, "progressNormal")
 GK_ATOM(progressUndetermined, "progressUndetermined")
 GK_ATOM(projection, "projection")
 GK_ATOM(prompt, "prompt")
 GK_ATOM(propagate, "propagate")
 GK_ATOM(properties, "properties")
 GK_ATOM(property, "property")
 GK_ATOM(pubdate, "pubdate")
-GK_ATOM(pushedFloatsList, "PushedFloats-list")
 GK_ATOM(q, "q")
 GK_ATOM(query, "query")
 GK_ATOM(queryset, "queryset")
 GK_ATOM(querytype, "querytype")
 GK_ATOM(radio, "radio")
 GK_ATOM(radiogroup, "radiogroup")
 GK_ATOM(readonly, "readonly")
 GK_ATOM(rect, "rect")
@@ -888,17 +876,16 @@ GK_ATOM(script, "script")
 GK_ATOM(scriptEnabledBeforePrintOrPreview, "scriptEnabledBeforePrintOrPreview")
 GK_ATOM(scrollbar, "scrollbar")
 GK_ATOM(scrollbarbutton, "scrollbarbutton")
 GK_ATOM(scrollbox, "scrollbox")
 GK_ATOM(scrollcorner, "scrollcorner")
 GK_ATOM(scrolling, "scrolling")
 GK_ATOM(section, "section")
 GK_ATOM(select, "select")
-GK_ATOM(selectPopupList, "selectPopupList")
 GK_ATOM(selectable, "selectable")
 GK_ATOM(selected, "selected")
 GK_ATOM(selectedIndex, "selectedIndex")
 GK_ATOM(selectedindex, "selectedindex")
 GK_ATOM(self, "self")
 GK_ATOM(seltype, "seltype")
 GK_ATOM(setcookie, "set-cookie")
 GK_ATOM(setter, "setter")
--- a/content/base/src/nsXMLHttpRequest.cpp
+++ b/content/base/src/nsXMLHttpRequest.cpp
@@ -1225,33 +1225,30 @@ nsXMLHttpRequest::GetResponseHeader(cons
     // Means no header
     _retval.SetIsVoid(PR_TRUE);
     rv = NS_OK;
   }
 
   return rv;
 }
 
-nsresult
-nsXMLHttpRequest::GetLoadGroup(nsILoadGroup **aLoadGroup)
+already_AddRefed<nsILoadGroup>
+nsXMLHttpRequest::GetLoadGroup() const
 {
-  NS_ENSURE_ARG_POINTER(aLoadGroup);
-  *aLoadGroup = nsnull;
-
   if (mState & XML_HTTP_REQUEST_BACKGROUND) {
-    return NS_OK;
+    return nsnull;
   }
 
   nsCOMPtr<nsIDocument> doc =
     nsContentUtils::GetDocumentFromScriptContext(mScriptContext);
   if (doc) {
-    *aLoadGroup = doc->GetDocumentLoadGroup().get();  // already_AddRefed
+    return doc->GetDocumentLoadGroup();
   }
 
-  return NS_OK;
+  return nsnull;
 }
 
 nsresult
 nsXMLHttpRequest::CreateReadystatechangeEvent(nsIDOMEvent** aDOMEvent)
 {
   nsresult rv = nsEventDispatcher::CreateEvent(nsnull, nsnull,
                                                NS_LITERAL_STRING("Events"),
                                                aDOMEvent);
@@ -1488,18 +1485,17 @@ nsXMLHttpRequest::Open(const nsACString&
     }
     uri->SetUserPass(userpass);
     authp = PR_TRUE;
   }
 
   // When we are called from JS we can find the load group for the page,
   // and add ourselves to it. This way any pending requests
   // will be automatically aborted if the user leaves the page.
-  nsCOMPtr<nsILoadGroup> loadGroup;
-  GetLoadGroup(getter_AddRefs(loadGroup));
+  nsCOMPtr<nsILoadGroup> loadGroup = GetLoadGroup();
 
   // get Content Security Policy from principal to pass into channel
   nsCOMPtr<nsIChannelPolicy> channelPolicy;
   nsCOMPtr<nsIContentSecurityPolicy> csp;
   rv = mPrincipal->GetCsp(getter_AddRefs(csp));
   NS_ENSURE_SUCCESS(rv, rv);
   if (csp) {
     channelPolicy = do_CreateInstance("@mozilla.org/nschannelpolicy;1");
@@ -1723,16 +1719,17 @@ nsXMLHttpRequest::OnStartRequest(nsIRequ
     DispatchProgressEvent(mUpload, NS_LITERAL_STRING(LOAD_STR),
                           PR_TRUE, mUploadTotal, mUploadTotal);
   }
 
   // Reset responseBody
   mResponseBody.Truncate();
   mResponseBodyUnicode.SetIsVoid(PR_TRUE);
   mResponseBlob = nsnull;
+  mResultArrayBuffer = nsnull;
 
   // Set up responseXML
   PRBool parseBody = mResponseType == XML_HTTP_RESPONSE_TYPE_DEFAULT ||
                      mResponseType == XML_HTTP_RESPONSE_TYPE_DOCUMENT;
   nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(mChannel));
   if (parseBody && httpChannel) {
     nsCAutoString method;
     httpChannel->GetRequestMethod(method);
@@ -2070,17 +2067,17 @@ GetRequestBody(nsIVariant* aBody, nsIInp
 
       return NS_NewCStringInputStream(aResult,
                                       NS_ConvertUTF16toUTF8(string));
     }
 
     // nsIInputStream?
     nsCOMPtr<nsIInputStream> stream = do_QueryInterface(supports);
     if (stream) {
-      *aResult = stream.forget().get();
+      stream.forget(aResult);
       aCharset.Truncate();
 
       return NS_OK;
     }
 
     // nsIXHRSendable?
     nsCOMPtr<nsIXHRSendable> sendable = do_QueryInterface(supports);
     if (sendable) {
--- a/content/base/src/nsXMLHttpRequest.h
+++ b/content/base/src/nsXMLHttpRequest.h
@@ -209,17 +209,17 @@ protected:
                 PRUint32 toOffset,
                 PRUint32 count,
                 PRUint32 *writeCount);
   nsresult CreateResponseArrayBuffer(JSContext* aCx);
   void CreateResponseBlob(nsIRequest *request);
   // Change the state of the object with this. The broadcast argument
   // determines if the onreadystatechange listener should be called.
   nsresult ChangeState(PRUint32 aState, PRBool aBroadcast = PR_TRUE);
-  nsresult GetLoadGroup(nsILoadGroup **aLoadGroup);
+  already_AddRefed<nsILoadGroup> GetLoadGroup() const;
   nsIURI *GetBaseURI();
 
   nsresult RemoveAddEventListener(const nsAString& aType,
                                   nsRefPtr<nsDOMEventListenerWrapper>& aCurrent,
                                   nsIDOMEventListener* aNew);
 
   nsresult GetInnerEventListener(nsRefPtr<nsDOMEventListenerWrapper>& aWrapper,
                                  nsIDOMEventListener** aListener);
--- a/content/base/test/chrome/file_bug549682.xul
+++ b/content/base/test/chrome/file_bug549682.xul
@@ -62,16 +62,26 @@ https://bugzilla.mozilla.org/show_bug.cg
     localmm.loadFrameScript("data:,sendAsyncMessage('lasync', { data: 2345 })", false);
 
     messageManager.addMessageListener("async", asyncL);
     messageManager.addMessageListener("sync", syncL);
     global.addMessageListener("async", globalListener);
     global.addMessageListener("sync", globalListener);
     global.addMessageListener("global-sync", globalListener);
     global.loadFrameScript("data:,sendSyncMessage('global-sync', { data: 1234 });", true);
+    var toBeRemovedScript = "data:,sendAsyncMessage('toberemoved', { data: 2345 })";
+    var c = 0;
+    messageManager.addMessageListener("toberemoved", function() {
+      ++c;
+      opener.wrappedJSObject.is(c, 1, "Should be called only once!");
+    });
+    // This loads the script in the existing <browser>
+    messageManager.loadFrameScript(toBeRemovedScript, true);
+    // But it won't be loaded in the dynamically created <browser>
+    messageManager.removeDelayedFrameScript(toBeRemovedScript);
 
     var oldValue = globalListenerCallCount;
     var b = document.createElement("browser");
     b.setAttribute("type", "content");
     document.documentElement.appendChild(b);
     opener.wrappedJSObject.is(globalListenerCallCount, oldValue + 1,
                               "Wrong message count");
 
--- a/content/base/test/test_XHR.html
+++ b/content/base/test/test_XHR.html
@@ -116,16 +116,27 @@ xhr.responseType = 'arraybuffer';
 xhr.send(null);
 is(xhr.status, 200, "wrong status");
 checkResponseTextAccessThrows(xhr);
 checkResponseXMLAccessThrows(xhr);
 ab = xhr.response;
 ok(ab != null, "should have a non-null arraybuffer");
 arraybuffer_equals_to(ab, "hello pass\n");
 
+// test reusing the same XHR (Bug 680816)
+xhr.open("GET", 'file_XHR_binary1.bin', false);
+xhr.responseType = 'arraybuffer';
+xhr.send(null);
+is(xhr.status, 200, "wrong status");
+ab2 = xhr.response;
+ok(ab2 != null, "should have a non-null arraybuffer");
+ok(ab2 != ab, "arraybuffer on XHR reuse should be distinct");
+arraybuffer_equals_to(ab, "hello pass\n");
+arraybuffer_equals_to(ab2, "\xaa\xee\0\x03\xff\xff\xff\xff\xbb\xbb\xbb\xbb");
+
 // with a binary file
 xhr = new XMLHttpRequest();
 xhr.open("GET", 'file_XHR_binary1.bin', false); 
 xhr.responseType = 'arraybuffer';
 xhr.send(null)
 is(xhr.status, 200, "wrong status");
 checkResponseTextAccessThrows(xhr);
 checkResponseXMLAccessThrows(xhr);
--- a/content/canvas/src/WebGLContext.h
+++ b/content/canvas/src/WebGLContext.h
@@ -487,17 +487,19 @@ protected:
     PRBool ValidateFaceEnum(WebGLenum face, const char *info);
     PRBool ValidateBufferUsageEnum(WebGLenum target, const char *info);
     PRBool ValidateTexFormatAndType(WebGLenum format, WebGLenum type, int jsArrayType,
                                       PRUint32 *texelSize, const char *info);
     PRBool ValidateDrawModeEnum(WebGLenum mode, const char *info);
     PRBool ValidateAttribIndex(WebGLuint index, const char *info);
     PRBool ValidateStencilParamsForDrawCall();
     
-    bool  ValidateGLSLIdentifier(const nsAString& name, const char *info);
+    bool ValidateGLSLVariableName(const nsAString& name, const char *info);
+    bool ValidateGLSLCharacter(PRUnichar c);
+    bool ValidateGLSLString(const nsAString& string, const char *info);
 
     static PRUint32 GetTexelSize(WebGLenum format, WebGLenum type);
 
     void Invalidate();
     void DestroyResourcesAndContext();
 
     void MakeContextCurrent() { gl->MakeCurrent(); }
 
--- a/content/canvas/src/WebGLContextGL.cpp
+++ b/content/canvas/src/WebGLContextGL.cpp
@@ -57,16 +57,17 @@
 #include "jstypedarray.h"
 
 #if defined(USE_ANGLE)
 // shader translator
 #include "angle/ShaderLang.h"
 #endif
 
 #include "WebGLTexelConversions.h"
+#include "WebGLValidateStrings.h"
 
 using namespace mozilla;
 
 static PRBool BaseTypeAndSizeFromUniformType(WebGLenum uType, WebGLenum *baseType, WebGLint *unitSize);
 static WebGLenum InternalFormatForFormatAndType(WebGLenum format, WebGLenum type, bool isGLES2);
 
 /* Helper macros for when we're just wrapping a gl method, so that
  * we can avoid having to type this 500 times.  Note that these MUST
@@ -177,18 +178,18 @@ WebGLContext::AttachShader(nsIWebGLProgr
 
 NS_IMETHODIMP
 WebGLContext::BindAttribLocation(nsIWebGLProgram *pobj, WebGLuint location, const nsAString& name)
 {
     WebGLuint progname;
     if (!GetGLName<WebGLProgram>("bindAttribLocation: program", pobj, &progname))
         return NS_OK;
 
-    if (name.IsEmpty())
-        return ErrorInvalidValue("BindAttribLocation: name can't be null or empty");
+    if (!ValidateGLSLVariableName(name, "bindAttribLocation"))
+        return NS_OK;
 
     if (!ValidateAttribIndex(location, "bindAttribLocation"))
         return NS_OK;
 
     MakeContextCurrent();
 
     gl->fBindAttribLocation(progname, location, NS_LossyConvertUTF16toASCII(name).get());
 
@@ -1834,17 +1835,17 @@ WebGLContext::GetAttribLocation(nsIWebGL
                                 PRInt32 *retval)
 {
     *retval = 0;
 
     WebGLuint progname;
     if (!GetGLName<WebGLProgram>("getAttribLocation: program", pobj, &progname))
         return NS_OK;
 
-    if (!ValidateGLSLIdentifier(name, "getAttribLocation"))
+    if (!ValidateGLSLVariableName(name, "getAttribLocation"))
         return NS_OK; 
 
     MakeContextCurrent();
     *retval = gl->fGetAttribLocation(progname, NS_LossyConvertUTF16toASCII(name).get());
     return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -2659,17 +2660,17 @@ WebGLContext::GetUniformLocation(nsIWebG
 {
     *retval = nsnull;
 
     WebGLuint progname;
     WebGLProgram *prog;
     if (!GetConcreteObjectAndGLName("getUniformLocation: program", pobj, &prog, &progname))
         return NS_OK;
 
-    if (!ValidateGLSLIdentifier(name, "getUniformLocation"))
+    if (!ValidateGLSLVariableName(name, "getUniformLocation"))
         return NS_OK; 
 
     MakeContextCurrent();
 
     GLint intlocation = gl->fGetUniformLocation(progname, NS_LossyConvertUTF16toASCII(name).get());
 
     nsRefPtr<nsIWebGLUniformLocation> loc = prog->GetUniformLocationObject(intlocation);
     *retval = loc.forget().get();
@@ -3161,18 +3162,18 @@ WebGLContext::RenderbufferStorage(WebGLe
 {
 
     if (!mBoundRenderbuffer || !mBoundRenderbuffer->GLName())
         return ErrorInvalidOperation("renderbufferStorage called on renderbuffer 0");
 
     if (target != LOCAL_GL_RENDERBUFFER)
         return ErrorInvalidEnumInfo("renderbufferStorage: target", target);
 
-    if (width <= 0 || height <= 0)
-        return ErrorInvalidValue("renderbufferStorage: width and height must be > 0");
+    if (width < 0 || height < 0)
+        return ErrorInvalidValue("renderbufferStorage: width and height must be >= 0");
 
     if (!mBoundRenderbuffer || !mBoundRenderbuffer->GLName())
         return ErrorInvalidOperation("renderbufferStorage called on renderbuffer 0");
 
     // certain OpenGL ES renderbuffer formats may not exist on desktop OpenGL
     WebGLenum internalformatForGL = internalformat;
 
     switch (internalformat) {
@@ -4126,17 +4127,20 @@ WebGLContext::GetShaderSource(nsIWebGLSh
 
 NS_IMETHODIMP
 WebGLContext::ShaderSource(nsIWebGLShader *sobj, const nsAString& source)
 {
     WebGLShader *shader;
     WebGLuint shadername;
     if (!GetConcreteObjectAndGLName("shaderSource: shader", sobj, &shader, &shadername))
         return NS_OK;
-    
+
+    if (!ValidateGLSLString(source, "shaderSource"))
+        return NS_OK;
+
     const nsPromiseFlatString& flatSource = PromiseFlatString(source);
 
     if (!NS_IsAscii(flatSource.get()))
         return ErrorInvalidValue("shaderSource: non-ascii characters found in source");
 
     const nsCString& sourceCString = NS_LossyConvertUTF16toASCII(flatSource);
     
     const PRUint32 maxSourceLength = (PRUint32(1)<<18) - 1;
--- a/content/canvas/src/WebGLContextValidate.cpp
+++ b/content/canvas/src/WebGLContextValidate.cpp
@@ -323,24 +323,41 @@ PRBool WebGLContext::ValidateDrawModeEnu
         case LOCAL_GL_LINES:
             return PR_TRUE;
         default:
             ErrorInvalidEnumInfo(info, mode);
             return PR_FALSE;
     }
 }
 
-bool WebGLContext::ValidateGLSLIdentifier(const nsAString& name, const char *info)
+bool WebGLContext::ValidateGLSLVariableName(const nsAString& name, const char *info)
 {
-    const PRUint32 maxSize = 4095;
+    const PRUint32 maxSize = 255;
     if (name.Length() > maxSize) {
         ErrorInvalidValue("%s: identifier is %d characters long, exceeds the maximum allowed length of %d characters",
                           info, name.Length(), maxSize);
         return false;
     }
+
+    if (!ValidateGLSLString(name, info)) {
+        return false;
+    }
+
+    return true;
+}
+
+bool WebGLContext::ValidateGLSLString(const nsAString& string, const char *info)
+{
+    for (PRUint32 i = 0; i < string.Length(); ++i) {
+        if (!ValidateGLSLCharacter(string.CharAt(i))) {
+             ErrorInvalidValue("%s: string contains the illegal character '%d'", info, string.CharAt(i));
+             return false;
+        }
+    }
+
     return true;
 }
 
 PRUint32 WebGLContext::GetTexelSize(WebGLenum format, WebGLenum type)
 {
     if (type == LOCAL_GL_UNSIGNED_BYTE || type == LOCAL_GL_FLOAT) {
         int multiplier = type == LOCAL_GL_FLOAT ? 4 : 1;
         switch (format) {
new file mode 100644
--- /dev/null
+++ b/content/canvas/src/WebGLValidateStrings.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011 Mozilla Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WEBGLVALIDATESTRINGS_H_
+#define WEBGLVALIDATESTRINGS_H_
+
+#include "WebGLContext.h"
+
+namespace mozilla {
+
+// The following function was taken from the WebKit WebGL implementation,
+// which can be found here:
+// http://trac.webkit.org/browser/trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp#L123
+/****** BEGIN CODE TAKEN FROM WEBKIT ******/
+bool WebGLContext::ValidateGLSLCharacter(PRUnichar c)
+{
+    // Printing characters are valid except " $ ` @ \ ' DEL.
+    if (c >= 32 && c <= 126 &&
+        c != '"' && c != '$' && c != '`' && c != '@' && c != '\\' && c != '\'')
+    {
+        return true;
+    }
+
+    // Horizontal tab, line feed, vertical tab, form feed, carriage return are also valid.
+    if (c >= 9 && c <= 13) {
+        return true;
+    }
+
+    return false;
+}
+/****** END CODE TAKEN FROM WEBKIT ******/
+
+} // end namespace mozilla
+
+#endif // WEBGLVALIDATESTRINGS_H_
--- a/content/canvas/test/webgl/00_test_list.txt
+++ b/content/canvas/test/webgl/00_test_list.txt
@@ -1,5 +1,6 @@
 // files that end in .txt list other tests
 // other lines are assumed to be .html files
 
 conformance/00_test_list.txt
+conformance/more/00_test_list.txt
 
--- a/content/canvas/test/webgl/README.mozilla
+++ b/content/canvas/test/webgl/README.mozilla
@@ -1,13 +1,15 @@
-This is a local copy of the WebGL conformance suite, version 1.0.0.
+This is a local copy of the WebGL conformance suite, SVN revision 15318
 
 The canonical location for this testsuite is:
 
-  https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/conformance-suites/1.0.0/webgl-conformance-tests.html
+  https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/webgl-conformance-tests.html
 
 All files and directories in this directory, with the exceptions listed below, come from
 upstream and should not be modified without corresponding upstream fixes and/or a
 patch file in this directory. The exceptions (the Mozilla-specific files) are:
+ * the crossorigin directory is not from upstream (not easy to share, as it relies on special features of the HTTP server used for our test framework)
  * README.mozilla (this file)
  * failing_tests_*.txt
  * Makefile.in
  * *.patch files, if any
+
--- a/content/canvas/test/webgl/conformance/00_test_list.txt
+++ b/content/canvas/test/webgl/conformance/00_test_list.txt
@@ -1,56 +1,65 @@
 array-buffer-crash.html
 array-buffer-view-crash.html
 array-unit-tests.html
 bad-arguments-test.html
 buffer-bind-test.html
 buffer-data-array-buffer.html
 buffer-preserve-test.html
+buffer-offscreen-test.html
 canvas-test.html
+canvas-zero-size.html
 constants.html
 context-attributes-alpha-depth-stencil-antialias.html
 context-lost-restored.html
 context-lost.html
 context-type-test.html
 copy-tex-image-and-sub-image-2d.html
 draw-arrays-out-of-bounds.html
 draw-elements-out-of-bounds.html
+drawingbuffer-static-canvas-test.html
+drawingbuffer-test.html
 error-reporting.html
 framebuffer-object-attachment.html
 framebuffer-test.html
 get-active-test.html
 gl-bind-attrib-location-test.html
 gl-clear.html
 gl-drawelements.html
 gl-enable-enum-test.html
 gl-enable-vertex-attrib.html
 gl-enum-tests.html
+gl-fragcoord.html
+shaders/00_test_list.txt
 gl-get-active-attribute.html
 gl-get-active-uniform.html
 gl-get-calls.html
+gl-geterror.html
 gl-getshadersource.html
 gl-getstring.html
 gl-min-attribs.html
-# gl-min-textures.html
+gl-min-textures.html
 gl-min-uniforms.html
 gl-object-get-calls.html
 gl-pixelstorei.html
 gl-scissor-test.html
 gl-shader-test.html
 gl-teximage.html
 gl-uniform-arrays.html
 gl-uniform-bool.html
 gl-uniformmatrix4fv.html
 gl-unknown-uniform.html
+gl-vertex-attrib-zero-issues.html
 gl-vertex-attrib.html
-gl-vertex-attrib-zero-issues.html
 gl-vertexattribpointer.html
+gl-vertexattribpointer-offsets.html
 #glsl-2types-of-textures-on-same-unit.html
 glsl-conformance.html
+glsl-long-variable-names.html
 incorrect-context-object-behaviour.html
 index-validation-copies-indices.html
 index-validation-crash-with-buffer-sub-data.html
 index-validation-verifies-too-many-indices.html
 index-validation-with-resized-buffer.html
 index-validation.html
 instanceof-test.html
 invalid-UTF-16.html
@@ -59,41 +68,42 @@ is-object.html
 methods.html
 more-than-65536-points.html
 null-object-behaviour.html
 null-uniform-location.html
 object-deletion-behaviour.html
 oes-standard-derivatives.html
 oes-texture-float.html
 oes-vertex-array-object.html
-# origin-clean-conformance.html # is obsolete because of bug 656277
+origin-clean-conformance.html
 point-size.html
+premultiplyalpha-test.html
 program-test.html
 read-pixels-pack-alignment.html
 read-pixels-test.html
 renderbuffer-initialization.html
 resource-sharing-test.html
 tex-image-and-sub-image-2d-with-array-buffer-view.html
+tex-image-and-sub-image-2d-with-canvas.html
 tex-image-and-sub-image-2d-with-image-data.html
 tex-image-and-sub-image-2d-with-image.html
 tex-image-and-sub-image-2d-with-video.html
 tex-image-and-uniform-binding-bugs.html
 tex-image-with-format-and-type.html
 tex-image-with-invalid-data.html
 tex-input-validation.html
 tex-sub-image-2d-bad-args.html
 tex-sub-image-2d.html
 texparameter-test.html
 texture-active-bind-2.html
 texture-active-bind.html
 texture-complete.html
 texture-formats-test.html
 texture-npot.html
+texture-npot-video.html
 texture-transparent-pixels-initialized.html
 triangle.html
 type-conversion-test.html
 uniform-location.html
 uniform-samplers-test.html
 uninitialized-test.html
 viewport-unchanged-upon-resize.html
 webgl-specific.html
-more/00_test_list.txt
-
--- a/content/canvas/test/webgl/conformance/array-buffer-crash.html
+++ b/content/canvas/test/webgl/conformance/array-buffer-crash.html
@@ -1,15 +1,16 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
@@ -28,14 +29,10 @@ try {
 } catch (e) {
 }
 
 testPassed("new ArrayBuffer().byteLength did not crash");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
-
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/array-buffer-view-crash.html
+++ b/content/canvas/test/webgl/conformance/array-buffer-view-crash.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
 met:
 
    * Redistributions of source code must retain the above copyright
 notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above
@@ -22,18 +22,20 @@ A PARTICULAR PURPOSE ARE DISCLAIMED. IN 
 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
@@ -54,13 +56,10 @@ try {
 }
 
 testPassed("new Uint32Array().length did not crash");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/array-unit-tests.html
+++ b/content/canvas/test/webgl/conformance/array-unit-tests.html
@@ -1,11 +1,11 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
-Copyright (C) 2009 Apple Computer, Inc.  All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
+Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
 met:
 
    * Redistributions of source code must retain the above copyright
 notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above
@@ -23,18 +23,20 @@ A PARTICULAR PURPOSE ARE DISCLAIMED. IN 
 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
@@ -505,17 +507,21 @@ function shouldThrowIndexSizeErr(func, t
         testPassed(text + " threw an exception");
     }
 }
 
 function testConstructionWithOutOfRangeValues(type, name) {
     shouldThrowIndexSizeErr(function() {
         var buffer = new ArrayBuffer(4);
         var array = new type(buffer, 4, 0x3FFFFFFF);
-    }, "Construction of " + name + " with out-of-range values");
+    }, "Construction of " + name + " with out-of-range number of elements");
+    shouldThrowIndexSizeErr(function() {
+        var buffer = new ArrayBuffer(4);
+        var array = new type(buffer, 8);
+    }, "Construction of " + name + " with out-of-range offset");
 }
 
 function testConstructionWithNegativeOutOfRangeValues(type, name) {
     try {
         var buffer = new ArrayBuffer(-1);
         testFailed("Construction of ArrayBuffer with negative size should throw exception");
     } catch (e) {
         testPassed("Construction of ArrayBuffer with negative size threw exception");
@@ -570,16 +576,31 @@ function testConstructionWithBothArrayBu
     var array2 = new type(bufByteLength / elementSizeInBytes);
     if (array1.length == array2.length) {
         testPassed("Array lengths matched with explicit and implicit creation of ArrayBuffer");
     } else {
         testFailed("Array lengths DID NOT MATCH with explicit and implicit creation of ArrayBuffer");
     }
 }
 
+function testConstructionWithSubPortionOfArrayBuffer(type, name, elementSizeInBytes) {
+    if (elementSizeInBytes > 1) {
+        // Test construction with a valid sub-portion of an array buffer
+        // (whose size is not an integral multiple of the element size).
+        var size = 4 * elementSizeInBytes + (elementSizeInBytes / 2);
+        var buf = new ArrayBuffer(size);
+        try {
+            var array = new type(buf, 0, 2);
+            testPassed("new " + name + "(new ArrayBuffer(" + size + "), 0, 2) succeeded");
+        } catch (e) {
+            testFailed("new " + name + "(new ArrayBuffer(" + size + "), 0, 2) failed: " + e);
+        }
+    }
+}
+
 // These need to be global for shouldBe to see them
 var array;
 var typeSize;
 
 function testSubarrayWithOutOfRangeValues(type, name, sz) {
     debug("Testing subarray of " + name);
     try {
         var buffer = new ArrayBuffer(32);
@@ -699,16 +720,22 @@ function testNaNConversion(type, name) {
   try {
     switch (type) {
     case Float32Array:
       for (var i = 0; i < array.length; ++i) {
         array[i] = NaN;
         results[i] = array[i];
       }
       break;
+    case Float64Array:
+      for (var i = 0; i < array.length; ++i) {
+        array[i] = NaN;
+        results[i] = array[i];
+      }
+      break;
     case Int8Array:
       for (var i = 0; i < array.length; ++i) {
         array[i] = NaN;
         results[i] = array[i];
       }
       break;
     case Int16Array:
       for (var i = 0; i < array.length; ++i) {
@@ -741,17 +768,17 @@ function testNaNConversion(type, name) {
       }
       break;
     default:
       fail("Unhandled type");
       break;
     }
 
     // Some types preserve NaN values; all other types convert NaN to zero.
-    if (type === Float32Array) {
+    if (type === Float32Array || type === Float64Array) {
       assert('initial NaN preserved', isNaN(new type([NaN])[0]));
       for (var i = 0; i < array.length; ++i)
         assert('NaN preserved via setter', isNaN(results[i]));
     } else {
       assertEq('initial NaN converted to zero', 0, new type([NaN])[0]);
       for (var i = 0; i < array.length; ++i)
         assertEq('NaN converted to zero by setter', 0, results[i]);
     }
@@ -774,16 +801,23 @@ function runTests() {
   var testCases =
     [ {name: "Float32Array",
        unsigned: false,
        integral: false,
        elementSizeInBytes: 4,
        testValues:     [ -500.5, 500.5 ],
        expectedValues: [ -500.5, 500.5 ]
       },
+      {name: "Float64Array",
+       unsigned: false,
+       integral: false,
+       elementSizeInBytes: 8,
+       testValues:     [ -500.5, 500.5 ],
+       expectedValues: [ -500.5, 500.5 ]
+      },
       {name: "Int8Array",
        unsigned: false,
        integral: true,
        elementSizeInBytes: 1,
        testValues:     [ -128, 127, -129,  128 ],
        expectedValues: [ -128, 127,  127, -128 ]
       },
       {name: "Int16Array",
@@ -861,16 +895,17 @@ function runTests() {
                                        testCase.expectedValues);
     testConstructionWithNullBuffer(type, name);
     testConstructionWithOutOfRangeValues(type, name);
     testConstructionWithNegativeOutOfRangeValues(type, name);
     testConstructionWithUnalignedOffset(type, name, testCase.elementSizeInBytes);
     testConstructionWithUnalignedLength(type, name, testCase.elementSizeInBytes);
     testConstructionOfHugeArray(type, name, testCase.elementSizeInBytes);
     testConstructionWithBothArrayBufferAndLength(type, name, testCase.elementSizeInBytes);
+    testConstructionWithSubPortionOfArrayBuffer(type, name, testCase.elementSizeInBytes);
     testSubarrayWithOutOfRangeValues(type, name, testCase.elementSizeInBytes);
     testSubarrayWithDefaultValues(type, name, testCase.elementSizeInBytes);
     testSettingFromArrayWithOutOfRangeOffset(type, name);
     testSettingFromFakeArrayWithOutOfRangeLength(type, name);
     testSettingFromTypedArrayWithOutOfRangeOffset(type, name);
     negativeTestGetAndSetMethods(type, name);
     testNaNConversion(type, name);
   }
--- a/content/canvas/test/webgl/conformance/bad-arguments-test.html
+++ b/content/canvas/test/webgl/conformance/bad-arguments-test.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (C) 2009 Apple Computer, Inc.  All rights reserved.
+Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
@@ -17,18 +17,20 @@ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHA
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script src="resources/webgl-test-utils.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
--- a/content/canvas/test/webgl/conformance/buffer-bind-test.html
+++ b/content/canvas/test/webgl/conformance/buffer-bind-test.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
   <head>
+<meta charset="utf-8">
     <title>WebGL BindBuffer conformance test.</title>
     <link rel="stylesheet" href="../resources/js-test-style.css"/>
     <script src="../resources/js-test-pre.js"></script>
     <script src="resources/webgl-test.js"> </script>
 </head>
 <body>
 <canvas id="example" width="40" height="40" style="width: 40px; height: 40px;"></canvas>
 <div id="description"></div>
@@ -51,17 +51,13 @@ if (!gl) {
   gl.bindBuffer(gl.ARRAY_BUFFER, buf);
   glErrorShouldBe(gl, gl.INVALID_OPERATION,
             "should get INVALID_OPERATION if attempting to bind buffer to different target");
 }
 
 debug("");
 successfullyParsed = true;
 </script>
-</body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
--- a/content/canvas/test/webgl/conformance/buffer-data-array-buffer.html
+++ b/content/canvas/test/webgl/conformance/buffer-data-array-buffer.html
@@ -1,15 +1,17 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
new file mode 100644
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/buffer-offscreen-test.html
@@ -0,0 +1,92 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL required buffer clear behaviour test</title>
+<link rel="stylesheet" href="../resources/js-test-style.css"/>
+<script src="../resources/js-test-pre.js"></script>
+<script src="resources/webgl-test.js"> </script>
+<script src="resources/webgl-test-utils.js"> </script>
+<style type="text/css">
+body {
+    height: 3000px;
+}
+</style>
+<script type="text/javascript">
+
+var iter = 0;
+var gl1;
+var gl2;
+
+var wtu = WebGLTestUtils;
+
+function timer() {
+    if (iter == 0) {
+        // some random hacky stuff to make sure that we get a compositing step
+        window.scrollBy(0, 10);
+        window.scrollBy(0, -10);
+        iter++;
+
+        setTimeout(timer, 500);
+    } else if (iter == 1) {
+        function clear(gl) {
+            // scissor was set earlier
+            gl.clearColor(0, 0, 1, 1);
+            gl.clear(gl.COLOR_BUFFER_BIT);
+        }
+        clear(gl1);
+        clear(gl2);
+
+        debug("check on screen canvas");
+        wtu.checkCanvasRect(gl1, 0, 10, 10, 10, [0, 0, 255, 255], "cleared corner should be blue, stencil should be preserved");
+        wtu.checkCanvasRect(gl1, 0, 0, 10, 10, [0, 0, 0, 0], "remainder of buffer should be cleared");
+        debug("check off screen canvas");
+        wtu.checkCanvasRect(gl2, 0, 10, 10, 10, [0, 0, 255, 255], "cleared corner should be blue, stencil should be preserved");
+        wtu.checkCanvasRect(gl2, 0, 0, 10, 10, [255, 0, 0, 255], "remainder of buffer should be un-cleared red");
+
+        finishTest();
+    }
+}
+
+function go() {
+    description("This test ensures WebGL implementations correctly clear the drawing buffer on composite if preserveDrawingBuffer is false.");
+
+    debug("");
+
+    gl1 = create3DContext(document.getElementById("c"));
+    c2 = document.createElement('canvas');
+    gl2 = create3DContext(c2);
+    shouldBeTrue("gl1 != null");
+    shouldBeTrue("gl2 != null");
+
+    shouldBeTrue('gl1.getContextAttributes().preserveDrawingBuffer == false');
+    shouldBeTrue('gl2.getContextAttributes().preserveDrawingBuffer == false');
+
+    function init(gl) {
+        gl.clearColor(1, 0, 0, 1);
+        gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+        // enable scissor here, before compositing, to make sure it's correctly
+        // ignored and restored
+        gl.scissor(0, 10, 10, 10);
+        gl.enable(gl.SCISSOR_TEST);
+    }
+
+    init(gl1);
+    init(gl2);
+
+    setTimeout(timer, 500);
+}
+
+window.addEventListener("load", go, false);
+
+successfullyParsed = true;
+</script>
+</head>
+<body>
+<div id="description"></div>
+<canvas width="20" height="20" style="border: 1px solid blue;" id="c"></canvas>
+<div id="console"></div>
+</body>
+</html>
+
--- a/content/canvas/test/webgl/conformance/buffer-preserve-test.html
+++ b/content/canvas/test/webgl/conformance/buffer-preserve-test.html
@@ -1,78 +1,77 @@
 <!DOCTYPE HTML>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL required buffer clear behaviour test</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 <style type="text/css">
 body {
     height: 3000px;
 }
 </style>
 <script type="text/javascript">
 
 var iter = 0;
-var gl;
+var gl1;
 
 var wtu = WebGLTestUtils;
 
-function checkPixel(gl, x, y, c) {
-    var buf = new Uint8Array(4);
-    gl.readPixels(x, y, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buf);
-
-    return buf[0] == c[0] &&
-	buf[1] == c[1] &&
-	buf[2] == c[2] &&
-	buf[3] == c[3];
-}
-
 function timer() {
     if (iter == 0) {
-	// some random hacky stuff to make sure that we get a compositing step
-	window.scrollBy(0, 10);
-	window.scrollBy(0, -10);
-	iter++;
+        // some random hacky stuff to make sure that we get a compositing step
+        window.scrollBy(0, 10);
+        window.scrollBy(0, -10);
+        iter++;
 
-	setTimeout(timer, 500);
+        setTimeout(timer, 500);
     } else if (iter == 1) {
-	// scissor was set earlier
-	gl.clearColor(0, 0, 1, 1);
-	gl.clear(gl.COLOR_BUFFER_BIT);
+        function clear(gl) {
+            // scissor was set earlier
+            gl.clearColor(0, 0, 1, 1);
+            gl.clear(gl.COLOR_BUFFER_BIT);
 
-	wtu.checkCanvasRect(gl, 0, 10, 10, 10, [0, 0, 255, 255], "cleared corner should be blue, stencil should be preserved");
-	wtu.checkCanvasRect(gl, 0, 0, 10, 10, [0, 0, 0, 0], "remainder of buffer should be cleared");
+            wtu.checkCanvasRect(gl, 0, 10, 10, 10, [0, 0, 255, 255], "cleared corner should be blue, stencil should be preserved");
+            wtu.checkCanvasRect(gl, 0, 0, 10, 10, [0, 0, 0, 0], "remainder of buffer should be cleared");
+        }
+        clear(gl1);
 
-	finishTest();
+        finishTest();
     }
 }
 
 function go() {
     description("This test ensures WebGL implementations correctly clear the drawing buffer on composite if preserveDrawingBuffer is false.");
 
     debug("");
 
-    gl = create3DContext(document.getElementById("c"));
-    if (!gl) {
-	finishTest();
-	return;
+    gl1 = create3DContext(document.getElementById("c"));
+    if (!gl1) {
+        finishTest();
+        return;
     }
 
-    shouldBeTrue('gl.getContextAttributes().preserveDrawingBuffer == false');
+    shouldBeTrue("gl1 != null");
+    shouldBeTrue('gl1.getContextAttributes().preserveDrawingBuffer == false');
 
-    gl.clearColor(1, 0, 0, 1);
-    gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+    function init(gl) {
+        gl.clearColor(1, 0, 0, 1);
+        gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
 
-    // enable scissor here, before compositing, to make sure it's correctly
-    // ignored and restored
-    gl.scissor(0, 10, 10, 10);
-    gl.enable(gl.SCISSOR_TEST);
+        // enable scissor here, before compositing, to make sure it's correctly
+        // ignored and restored
+        gl.scissor(0, 10, 10, 10);
+        gl.enable(gl.SCISSOR_TEST);
+    }
+
+    init(gl1);
 
     setTimeout(timer, 500);
 }
 
 window.addEventListener("load", go, false);
 
 successfullyParsed = true;
 </script>
--- a/content/canvas/test/webgl/conformance/canvas-test.html
+++ b/content/canvas/test/webgl/conformance/canvas-test.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL Canvas Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
@@ -183,13 +182,11 @@ if (!gl) {
       }
 
       debug("");
       finishTest();
     }
    }, 1000/30);
 }
 </script>
-<script>
-</script>
 
 </body>
 </html>
new file mode 100644
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/canvas-zero-size.html
@@ -0,0 +1,42 @@
+<!--
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+  found in the LICENSE file.
+ -->
+<!DOCTYPE html>
+<html>
+  <head>
+  <meta charset="utf-8">
+    <title>Zero Size Canvas Test</title>
+    <link rel="stylesheet" href="../resources/js-test-style.css"/>
+    <script src="../resources/js-test-pre.js"></script>
+    <script src="resources/webgl-test.js"> </script>
+    <script src="resources/webgl-test-utils.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+description("Tests that a zero size canvas does not fail.");
+var wtu = WebGLTestUtils;
+var canvas = document.createElement('canvas');
+var gl = wtu.create3DContext(canvas);
+canvas.width = 0;
+canvas.height = 0;
+gl.viewport(0, 0, 0, 0);
+var program = wtu.setupTexturedQuad(gl);
+shouldBeTrue("program != null");
+var tex = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex);
+var pixel = new Uint8Array([0, 255, 0, 255]);
+gl.texImage2D(
+  gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, pixel);
+wtu.drawQuad(gl);
+
+glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+successfullyParsed = true;
+</script>
+<script src="../resources/js-test-post.js"></script>
+
+</body>
+</html>
--- a/content/canvas/test/webgl/conformance/constants.html
+++ b/content/canvas/test/webgl/conformance/constants.html
@@ -1,16 +1,17 @@
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <!--
-Copyright (c) 2009 Ilmari Heikkinen. All rights reserved.
+Copyright (c) 2011 Ilmari Heikkinen. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
 -->
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <title>WebGL Constants Test</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
@@ -476,13 +477,11 @@ for (var i in gl) {
     debug(i);
   }
 }
 
 debug("");
 successfullyParsed = true;
 </script>
 <script src="../resources/js-test-post.js"></script>
-<script>
-</script>
 
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/context-attributes-alpha-depth-stencil-antialias.html
+++ b/content/canvas/test/webgl/conformance/context-attributes-alpha-depth-stencil-antialias.html
@@ -1,71 +1,91 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script id="vshader" type="x-shader/x-vertex">
 attribute vec3 pos;
 attribute vec4 colorIn;
 varying vec4 color;
 
 void main()
 {
     color = colorIn;
     gl_Position = vec4(pos.xyz, 1.0);
 }
 </script>
 
 <script id="fshader" type="x-shader/x-fragment">
-#ifdef GL_ES
-precision highp float;
-#endif
+precision mediump float;
+
 varying vec4 color;
 
 void main()
 {
     gl_FragColor = color;
 }
 </script>
 
 <script>
 var successfullyParsed = false;
 
 // These four declarations need to be global for "shouldBe" to see them
 var webGL = null;
 var contextAttribs = null;
 var pixel = [0, 0, 0, 1];
 var correctColor = null;
+var value;
 
 function init()
 {
     if (window.initNonKhronosFramework) {
         window.initNonKhronosFramework(true);
     }
 
     description('Verify WebGLContextAttributes are working as specified, including alpha, depth, stencil, antialias, but not premultipliedAlpha');
 
     runTest();
 }
 
-function getWebGL(canvasName, contextAttribs, clearColor, clearDepth, clearStencil)
+function getWebGL(canvasWidth, canvasHeight, contextAttribs, clearColor, clearDepth, clearStencil)
 {
-    var context = initWebGL(canvasName, "vshader", "fshader", ["pos", "colorIn"], clearColor, clearDepth, contextAttribs);
-    if (context) {
-        context.clearStencil(clearStencil);
-        context.enable(context.STENCIL_TEST);
-        context.disable(context.BLEND);
-        context.clear(context.COLOR_BUFFER_BIT | context.DEPTH_BUFFER_BIT | context.STENCIL_BUFFER_BIT);
-    }
+    var canvas = document.createElement("canvas");
+    if (!canvas)
+        return null;
+    canvas.width = canvasWidth;
+    canvas.height = canvasHeight;
+
+    var context = create3DContext(canvas, contextAttribs);
+    if (!context)
+        return null;
+
+    context.program = createProgram(context, "vshader", "fshader", ["pos", "colorIn"]);
+    if (!context.program)
+        return null;
+
+    context.useProgram(context.program);
+
+    context.enable(context.DEPTH_TEST);
+    context.enable(context.STENCIL_TEST);
+    context.disable(context.BLEND);
+
+    context.clearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
+    context.clearDepth(clearDepth);
+    context.clearStencil(clearStencil);
+    context.clear(context.COLOR_BUFFER_BIT | context.DEPTH_BUFFER_BIT | context.STENCIL_BUFFER_BIT);
+
     return context;
 }
 
 function drawAndReadPixel(gl, vertices, colors, x, y)
 {
     var colorOffset = vertices.byteLength;
 
     var vbo = gl.createBuffer();
@@ -85,38 +105,39 @@ function drawAndReadPixel(gl, vertices, 
     gl.readPixels(x, y, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buf);
     return buf;
 }
 
 function testAlpha(alpha)
 {
     debug("Testing alpha = " + alpha);
     if (alpha)
-        shouldBeNonNull("webGL = getWebGL('alphaOn', { alpha: true, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
+        shouldBeNonNull("webGL = getWebGL(1, 1, { alpha: true, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
     else
-        shouldBeNonNull("webGL = getWebGL('alphaOff', { alpha: false, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
+        shouldBeNonNull("webGL = getWebGL(1, 1, { alpha: false, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
     shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
+    shouldBeTrue("contextAttribs.alpha == " + alpha);
 
     var buf = new Uint8Array(1 * 1 * 4);
     webGL.readPixels(0, 0, 1, 1, webGL.RGBA, webGL.UNSIGNED_BYTE, buf);
     pixel[0] = buf[0];
     pixel[1] = buf[1];
     pixel[2] = buf[2];
     pixel[3] = buf[3];
     correctColor = (contextAttribs.alpha ? [0, 0, 0, 0] : [0, 0, 0, 255]);
     shouldBe("pixel", "correctColor");
 }
 
 function testDepth(depth)
 {
     debug("Testing depth = " + depth);
     if (depth)
-        shouldBeNonNull("webGL = getWebGL('depthOn', { stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
+        shouldBeNonNull("webGL = getWebGL(1, 1, { stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
     else
-        shouldBeNonNull("webGL = getWebGL('depthOff', { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
+        shouldBeNonNull("webGL = getWebGL(1, 1, { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
     shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
 
     webGL.depthFunc(webGL.NEVER);
 
     var vertices = new Float32Array([
          1.0,  1.0, 0.0,
         -1.0,  1.0, 0.0,
         -1.0, -1.0, 0.0,
@@ -139,19 +160,19 @@ function testDepth(depth)
     correctColor = (contextAttribs.depth ? [0, 0, 0, 255] : [255, 0, 0, 255]);
     shouldBe("pixel", "correctColor");
 }
 
 function testStencil(stencil)
 {
     debug("Testing stencil = " + stencil);
     if (stencil)
-        shouldBeNonNull("webGL = getWebGL('stencilOn', { depth: false, stencil: true, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
+        shouldBeNonNull("webGL = getWebGL(1, 1, { depth: false, stencil: true, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
     else
-        shouldBeNonNull("webGL = getWebGL('stencilOff', { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
+        shouldBeNonNull("webGL = getWebGL(1, 1, { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
     shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
 
     webGL.depthFunc(webGL.ALWAYS);
 
     webGL.stencilFunc(webGL.NEVER, 1, 1);
     webGL.stencilOp(webGL.KEEP, webGL.KEEP, webGL.KEEP);
 
     var vertices = new Float32Array([
@@ -177,19 +198,19 @@ function testStencil(stencil)
     correctColor = (contextAttribs.stencil ? [0, 0, 0, 255] : [255, 0, 0, 255]);
     shouldBe("pixel", "correctColor");
 }
 
 function testAntialias(antialias)
 {
     debug("Testing antialias = " + antialias);
     if (antialias)
-        shouldBeNonNull("webGL = getWebGL('antialiasOn', { depth: false, stencil: false, alpha: false, antialias: true }, [ 0, 0, 0, 1 ], 1, 0)");
+        shouldBeNonNull("webGL = getWebGL(2, 2, { depth: false, stencil: false, alpha: false, antialias: true }, [ 0, 0, 0, 1 ], 1, 0)");
     else
-        shouldBeNonNull("webGL = getWebGL('antialiasOff', { depth: false, stencil: false, alpha: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
+        shouldBeNonNull("webGL = getWebGL(2, 2, { depth: false, stencil: false, alpha: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
     shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
 
     var vertices = new Float32Array([
          1.0, 1.0, 0.0,
         -1.0, 1.0, 0.0,
         -1.0, -1.0, 0.0]);
     var colors = new Uint8Array([
         255, 0, 0, 255,
@@ -213,20 +234,12 @@ function runTest()
     testAntialias(false);
 
     finishTest()
 }
 
 </script>
 </head>
 <body onload="init()">
-<canvas id="alphaOn" width="1px" height="1px"></canvas>
-<canvas id="alphaOff" width="1px" height="1px"></canvas>
-<canvas id="depthOn" width="1px" height="1px"></canvas>
-<canvas id="depthOff" width="1px" height="1px"></canvas>
-<canvas id="stencilOn" width="1px" height="1px"></canvas>
-<canvas id="stencilOff" width="1px" height="1px"></canvas>
-<canvas id="antialiasOn" width="2px" height="2px"></canvas>
-<canvas id="antialiasOff" width="2px" height="2px"></canvas>
 <div id="description"></div>
 <div id="console"></div>
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/context-lost-restored.html
+++ b/content/canvas/test/webgl/conformance/context-lost-restored.html
@@ -1,50 +1,95 @@
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script src="resources/webgl-test-utils.js"></script>
 <script>
 var wtu = WebGLTestUtils;
 var canvas;
 var gl;
 var shouldGenerateGLError;
 var extension_name = "WEBKIT_lose_context";
 var extension;
 var bufferObjects;
 var program;
 var texture;
 var texColor = [255, 10, 20, 255];
+var allowRestore;
 
 function init()
 {
     if (window.initNonKhronosFramework) {
         window.initNonKhronosFramework(true);
     }
 
-    description("Tests behavior under a restored context");
+    description("Tests behavior under a restored context.");
+
+    shouldGenerateGLError = wtu.shouldGenerateGLError;
+    runTests();
+}
 
-    canvas = document.getElementById("canvas");
-    canvas.addEventListener("webglcontextlost", testLostContext, false);
-    canvas.addEventListener("webglcontextrestored", testRestoredContext, false);
+function runTests()
+{
+    testLosingContext();
+    testLosingAndRestoringContext();
 
+    finish();
+}
+
+function setupTest()
+{
+    canvas = document.createElement("canvas");
+    canvas.width = 1;
+    canvas.height = 1;
     gl = wtu.create3DContext(canvas);
-    shouldGenerateGLError = wtu.shouldGenerateGLError;
-
     extension = gl.getExtension(extension_name);
     if (!extension) {
         debug(extension_name + " extension not found.");
-        finish();
+        return false;
+    }
+    return true;
+}
+
+function testLosingContext()
+{
+    if (!setupTest())
         return;
-    }
+
+    debug("Test losing a context and inability to restore it.");
+
+    canvas.addEventListener("webglcontextlost", testLostContext);
+    canvas.addEventListener("webglcontextrestored", testShouldNotRestoreContext);
+    allowRestore = false;
 
     testOriginalContext();
     extension.loseContext();
+    shouldGenerateGLError(gl, gl.INVALID_OPERATION, "extension.restoreContext()");
+    debug("");
+}
+
+function testLosingAndRestoringContext()
+{
+    if (!setupTest())
+        return;
+
+    debug("Test losing and restoring a context.");
+
+    canvas.addEventListener("webglcontextlost", testLostContext);
+    canvas.addEventListener("webglcontextrestored", testRestoredContext);
+    allowRestore = true;
+
+    testOriginalContext();
+    extension.loseContext();
+    shouldGenerateGLError(gl, gl.NO_ERROR, "extension.restoreContext()");
+    debug("");
 }
 
 function testRendering()
 {
     gl.clearColor(0, 0, 0, 255);
     gl.colorMask(1, 1, 1, 0);
     gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
 
@@ -65,23 +110,31 @@ function testOriginalContext()
 {
     debug("Test valid context");
     shouldBeFalse("gl.isContextLost()");
     shouldBe("gl.getError()", "gl.NO_ERROR");
     testRendering();
     debug("");
 }
 
-function testLostContext()
+function testLostContext(e)
 {
     debug("Test lost context");
     shouldBeTrue("gl.isContextLost()");
     shouldBe("gl.getError()", "gl.CONTEXT_LOST_WEBGL");
     shouldBe("gl.getError()", "gl.NO_ERROR");
     debug("");
+    if (allowRestore)
+        e.preventDefault();
+}
+
+function testShouldNotRestoreContext(e)
+{
+    testFailed("Should not restore the context unless preventDefault is called on the context lost event");
+    debug("");
 }
 
 function testResources(expected)
 {
     var tests = [
         "gl.bindTexture(gl.TEXTURE_2D, texture)",
         "gl.useProgram(program)",
         "gl.bindBuffer(gl.ARRAY_BUFFER, bufferObjects[0])",
@@ -100,18 +153,16 @@ function testRestoredContext()
     // Validate that using old resources fails.
     testResources(gl.INVALID_OPERATION);
 
     testRendering();
 
     // Validate new resources created in testRendering().
     testResources(gl.NO_ERROR);
     debug("");
-
-    finish();
 }
 
 function finish() {
     successfullyParsed = true;
     var epilogue = document.createElement("script");
     epilogue.onload = function() {
         if (window.nonKhronosFrameworkNotifyDone)
             window.nonKhronosFrameworkNotifyDone();
@@ -120,11 +171,10 @@ function finish() {
     document.body.appendChild(epilogue);
 }
 
 </script>
 </head>
 <body onload="init()">
 <div id="description"></div>
 <div id="console"></div>
-<canvas id="canvas" width="1px" height="1px"></canvas>
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/context-lost.html
+++ b/content/canvas/test/webgl/conformance/context-lost.html
@@ -1,10 +1,12 @@
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script src="resources/webgl-test-utils.js"></script>
 <script>
 var wtu;
 var canvas;
 var gl;
@@ -57,16 +59,19 @@ function init()
 
     loseContext();
 }
 
 function loseContext()
 {
     debug("");
     debug("Lose context");
+
+    // Note: this will cause the context to be lost, and the
+    // webglcontextlost event listener to be called, immediately.
     shouldGenerateGLError(gl, gl.NO_ERROR, "extension.loseContext()");
     debug("");
 }
 
 function testValidContext()
 {
     debug("Test valid context");
 
@@ -130,18 +135,18 @@ function testLostContext()
         "gl.attachShader(program, shader)",
         "gl.bindBuffer(gl.ARRAY_BUFFER, buffer)",
         "gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer)",
         "gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer)",
         "gl.bindTexture(gl.TEXTURE_2D, texture)",
         "gl.blendColor(1.0, 1.0, 1.0, 1.0)",
         "gl.blendEquation(gl.FUNC_ADD)",
         "gl.blendEquationSeparate(gl.FUNC_ADD, gl.FUNC_ADD)",
-        "gl.blendFunc(gl.ONE)",
-        "gl.blendFuncSeparate(gl.ONE, gl.ONE)",
+        "gl.blendFunc(gl.ONE, gl.ONE)",
+        "gl.blendFuncSeparate(gl.ONE, gl.ONE, gl.ONE, gl.ONE)",
         "gl.bufferData(gl.ARRAY_BUFFER, 0, gl.STATIC_DRAW)",
         "gl.bufferData(gl.ARRAY_BUFFER, arrayBufferView, gl.STATIC_DRAW)",
         "gl.bufferData(gl.ARRAY_BUFFER, arrayBuffer, gl.STATIC_DRAW)",
         "gl.bufferSubData(gl.ARRAY_BUFFRE, 0, arrayBufferView)",
         "gl.bufferSubData(gl.ARRAY_BUFFRE, 0, arrayBuffer)",
         "gl.clear(gl.COLOR_BUFFER_BIT)",
         "gl.clearColor(1, 1, 1, 1)",
         "gl.clearDepth(1)",
@@ -290,16 +295,18 @@ function testLostContext()
     shouldBeFalse("gl.isFramebuffer(framebuffer)");
     shouldBeFalse("gl.isProgram(program)");
     shouldBeFalse("gl.isRenderbuffer(renderbuffer)");
     shouldBeFalse("gl.isShader(shader)");
     shouldBeFalse("gl.isTexture(texture)");
 
     shouldBe("gl.getError()", "gl.NO_ERROR");
 
+    debug("");
+
     finish();
 }
 
 function finish() {
     successfullyParsed = true;
     var epilogue = document.createElement("script");
     epilogue.onload = function() {
         if (window.nonKhronosFrameworkNotifyDone)
--- a/content/canvas/test/webgl/conformance/context-type-test.html
+++ b/content/canvas/test/webgl/conformance/context-type-test.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL Canvas Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
@@ -20,28 +19,31 @@ found in the LICENSE file.
 <canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
 <canvas id="canvas2d" width="40" height="40"> </canvas>
 <script>
 description("This test ensures WebGL implementations interact correctly with the canvas tag.");
 
 debug("");
 debug("Canvas.getContext");
 
+assertMsg(window.WebGLRenderingContext,
+          "WebGLRenderingContext should be a member of window");
+assertMsg('WebGLRenderingContext' in window,
+          "WebGLRenderingContext should be 'in' window");
+
 var canvas = document.getElementById("canvas");
 var gl = create3DContext(canvas);
 if (!gl) {
   testFailed("context does not exist");
 } else {
   testPassed("context exists");
 
   debug("Checking context type");
   assertMsg(gl instanceof WebGLRenderingContext,
             "context type should be WebGLRenderingContext");
 }
 debug("");
 successfullyParsed = true;
 </script>
 <script src="../resources/js-test-post.js"></script>
-<script>
-</script>
 
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/copy-tex-image-and-sub-image-2d.html
+++ b/content/canvas/test/webgl/conformance/copy-tex-image-and-sub-image-2d.html
@@ -1,15 +1,17 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script src="resources/webgl-test-utils.js"></script>
 
 <script>
 var successfullyParsed = false;
 
--- a/content/canvas/test/webgl/conformance/draw-arrays-out-of-bounds.html
+++ b/content/canvas/test/webgl/conformance/draw-arrays-out-of-bounds.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (C) 2009 Apple Computer, Inc.  All rights reserved.
+Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
@@ -17,18 +17,20 @@ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHA
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
--- a/content/canvas/test/webgl/conformance/draw-elements-out-of-bounds.html
+++ b/content/canvas/test/webgl/conformance/draw-elements-out-of-bounds.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (C) 2009 Apple Computer, Inc.  All rights reserved.
+Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
@@ -17,18 +17,20 @@ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHA
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
new file mode 100644
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/drawingbuffer-static-canvas-test.html
@@ -0,0 +1,61 @@
+<!--
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file.
+ -->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Canvas Conformance Tests</title>
+<link rel="stylesheet" href="../resources/js-test-style.css"/>
+<script src="../resources/js-test-pre.js"></script>
+<script src="resources/webgl-test.js"></script>
+<script src="resources/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
+<script>
+description("This test ensures WebGL implementations correctly implement drawingbufferWidth/Height with compositing.");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var err;
+var maxSize;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas);
+if (!gl) {
+  testFailed("context does not exist");
+} else {
+  testPassed("context exists");
+
+  debug("");
+  debug("Checking drawingBufferWidth/drawingBufferHeight");
+
+  // Check that a canvas with no width or height is 300x150 pixels
+  shouldBe('gl.drawingBufferWidth', 'canvas.width');
+  shouldBe('gl.drawingBufferHeight', 'canvas.height');
+
+  // Check that changing the canvas size to something too large falls back to reasonable values.
+  maxSize = gl.getParameter(gl.MAX_VIEWPORT_DIMS);
+  shouldBeTrue('maxSize[0] > 0');
+  shouldBeTrue('maxSize[1] > 0');
+
+  // debug("MAX_VIEWPORT_DIMS = " + maxSize[0] + "x" + maxSize[1]);
+  canvas.width = maxSize[0] * 4;
+  canvas.height = maxSize[1] * 4;
+  shouldBeTrue('gl.drawingBufferWidth > 0');
+  shouldBeTrue('gl.drawingBufferHeight > 0');
+  shouldBeTrue('gl.drawingBufferWidth <= maxSize[0]');
+  shouldBeTrue('gl.drawingBufferHeight <= maxSize[1]');
+  shouldBe('gl.getError()', 'gl.NO_ERROR');
+}
+debug("")
+successfullyParsed = true;
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/drawingbuffer-test.html
@@ -0,0 +1,60 @@
+<!--
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file.
+ -->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Canvas Conformance Tests</title>
+<link rel="stylesheet" href="../resources/js-test-style.css"/>
+<script src="../resources/js-test-pre.js"></script>
+<script src="resources/webgl-test.js"></script>
+<script src="resources/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+description("This test ensures WebGL implementations correctly implement drawingbufferWidth/Height.");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var err;
+var maxSize;
+var canvas = document.createElement("canvas");
+var gl = wtu.create3DContext(canvas);
+if (!gl) {
+  testFailed("context does not exist");
+} else {
+  testPassed("context exists");
+
+  debug("");
+  debug("Checking drawingBufferWidth/drawingBufferHeight");
+
+  // Check that a canvas with no width or height is 300x150 pixels
+  shouldBe('gl.drawingBufferWidth', 'canvas.width');
+  shouldBe('gl.drawingBufferHeight', 'canvas.height');
+
+  // Check that changing the canvas size to something too large falls back to reasonable values.
+  maxSize = gl.getParameter(gl.MAX_VIEWPORT_DIMS);
+  shouldBeTrue('maxSize[0] > 0');
+  shouldBeTrue('maxSize[1] > 0');
+
+  // debug("MAX_VIEWPORT_DIMS = " + maxSize[0] + "x" + maxSize[1]);
+  canvas.width = maxSize[0] * 4;
+  canvas.height = maxSize[1] * 4;
+  shouldBeTrue('gl.drawingBufferWidth > 0');
+  shouldBeTrue('gl.drawingBufferHeight > 0');
+  shouldBeTrue('gl.drawingBufferWidth <= maxSize[0]');
+  shouldBeTrue('gl.drawingBufferHeight <= maxSize[1]');
+  shouldBe('gl.getError()', 'gl.NO_ERROR');
+}
+debug("")
+successfullyParsed = true;
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
--- a/content/canvas/test/webgl/conformance/error-reporting.html
+++ b/content/canvas/test/webgl/conformance/error-reporting.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
 met:
 
    * Redistributions of source code must retain the above copyright
 notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above
@@ -22,18 +22,20 @@ A PARTICULAR PURPOSE ARE DISCLAIMED. IN 
 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
--- a/content/canvas/test/webgl/conformance/framebuffer-object-attachment.html
+++ b/content/canvas/test/webgl/conformance/framebuffer-object-attachment.html
@@ -1,42 +1,50 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
 <script>
 
 var gl;
 var fbo;
 var depthBuffer;
 var stencilBuffer;
 var depthStencilBuffer;
 var colorBuffer;
-var width = 2;
-var height = 2;
+var width;
+var height;
 
 function testAttachment(attachment, buffer, isConflicted)
 {
     shouldBeNonNull("fbo = gl.createFramebuffer()");
     gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
     gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer);
     gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, buffer);
     glErrorShouldBe(gl, gl.NO_ERROR);
-    if (isConflicted) {
+    // If the framebuffer is in an error state for multiple reasons,
+    // we can't guarantee which one will be reported.
+    if ((width == 0 || height == 0) && !isConflicted) {
+        // Zero-sized renderbuffers are supposed to result in an incomplete attachment.
+        // However, certain combination may violate implementation specific restrictions.
+        shouldBeTrue("gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT || gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_UNSUPPORTED");
+    } else if (isConflicted) {
         shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_UNSUPPORTED");
         gl.clear(gl.COLOR_BUFFER_BIT);
         glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION);
         gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(width * height * 4));
         glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION);
     }
 }
 
@@ -44,18 +52,25 @@ function testAttachments(attachment0, bu
 {
     shouldBeNonNull("fbo = gl.createFramebuffer()");
     gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
     gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer);
     gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment0, gl.RENDERBUFFER, buffer0);
     glErrorShouldBe(gl, gl.NO_ERROR);
     gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment1, gl.RENDERBUFFER, buffer1);
     glErrorShouldBe(gl, gl.NO_ERROR);
-    if (isConflicted)
+    // If the framebuffer is in an error state for multiple reasons,
+    // we can't guarantee which one will be reported.
+    if ((width == 0 || height == 0) && !isConflicted) {
+        // Zero-sized renderbuffers are supposed to result in an incomplete attachment.
+        // However, certain combination may violate implementation specific restrictions.
+        shouldBeTrue("gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT || gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_UNSUPPORTED");
+    } else if (isConflicted) {
         shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_UNSUPPORTED");
+    }
 }
 
 function testColorRenderbuffer(internalformat)
 {
     shouldBeNonNull("colorBuffer = gl.createRenderbuffer()");
     gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer);
     gl.renderbufferStorage(gl.RENDERBUFFER, internalformat, width, height);
     glErrorShouldBe(gl, gl.NO_ERROR);
@@ -63,92 +78,109 @@ function testColorRenderbuffer(internalf
 }
 
 function testDepthStencilRenderbuffer()
 {
     shouldBeNonNull("depthStencilBuffer = gl.createRenderbuffer()");
     gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer);
     gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);
     glErrorShouldBe(gl, gl.NO_ERROR);
-    shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_WIDTH)", "width");
-    shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_HEIGHT)", "height");
+
+    // OpenGL itself doesn't seem to guarantee that e.g. a 2 x 0
+    // renderbuffer will report 2 for its width when queried.
+    if (!(height == 0 && width > 0))
+        shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_WIDTH)", "width");
+    if (!(width == 0 && height > 0))
+        shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_HEIGHT)", "height");
     shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_INTERNAL_FORMAT)", "gl.DEPTH_STENCIL");
     shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_RED_SIZE)", "0");
     shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_GREEN_SIZE)", "0");
     shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_BLUE_SIZE)", "0");
     shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_ALPHA_SIZE)", "0");
-    shouldBeTrue("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_DEPTH_SIZE) > 0");
-    shouldBeTrue("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_STENCIL_SIZE) > 0");
+    // Avoid verifying these for zero-sized renderbuffers for the time
+    // being since it appears that even OpenGL doesn't guarantee them.
+    if (width > 0 && height > 0) {
+        shouldBeTrue("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_DEPTH_SIZE) > 0");
+        shouldBeTrue("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_STENCIL_SIZE) > 0");
+    }
     glErrorShouldBe(gl, gl.NO_ERROR);
     testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, false);
 }
 
 description("Test framebuffer object attachment behaviors");
 
-debug("Create renderbuffers");
-shouldBeNonNull("gl = create3DContext()");
-shouldBeNonNull("colorBuffer = gl.createRenderbuffer()");
-gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer);
-gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, width, height);
-glErrorShouldBe(gl, gl.NO_ERROR);
-shouldBeNonNull("depthBuffer = gl.createRenderbuffer()");
-gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer);
-gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, width, height);
-glErrorShouldBe(gl, gl.NO_ERROR);
-shouldBeNonNull("stencilBuffer = gl.createRenderbuffer()");
-gl.bindRenderbuffer(gl.RENDERBUFFER, stencilBuffer);
-gl.renderbufferStorage(gl.RENDERBUFFER, gl.STENCIL_INDEX8, width, height);
-glErrorShouldBe(gl, gl.NO_ERROR);
-shouldBeNonNull("depthStencilBuffer = gl.createRenderbuffer()");
-gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer);
-gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);
-glErrorShouldBe(gl, gl.NO_ERROR);
+for (width = 0; width <= 2; width += 2)
+{
+    for (height = 0; height <= 2; height += 2)
+    {
+        debug("Dimensions " + width + " x " + height);
+
+        debug("Create renderbuffers");
+        shouldBeNonNull("gl = create3DContext()");
+        shouldBeNonNull("colorBuffer = gl.createRenderbuffer()");
+        gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer);
+        gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, width, height);
+        glErrorShouldBe(gl, gl.NO_ERROR);
+        shouldBeNonNull("depthBuffer = gl.createRenderbuffer()");
+        gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer);
+        gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, width, height);
+        glErrorShouldBe(gl, gl.NO_ERROR);
+        shouldBeNonNull("stencilBuffer = gl.createRenderbuffer()");
+        gl.bindRenderbuffer(gl.RENDERBUFFER, stencilBuffer);
+        gl.renderbufferStorage(gl.RENDERBUFFER, gl.STENCIL_INDEX8, width, height);
+        glErrorShouldBe(gl, gl.NO_ERROR);
+        shouldBeNonNull("depthStencilBuffer = gl.createRenderbuffer()");
+        gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer);
+        gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);
+        glErrorShouldBe(gl, gl.NO_ERROR);
 
-debug("Attach depth using DEPTH_ATTACHMENT");
-testAttachment(gl.DEPTH_ATTACHMENT, depthBuffer, false);
-debug("Attach depth using STENCIL_ATTACHMENT");
-testAttachment(gl.STENCIL_ATTACHMENT, depthBuffer, true);
-debug("Attach depth using DEPTH_STENCIL_ATTACHMENT");
-testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthBuffer, true);
-debug("Attach stencil using STENCIL_ATTACHMENT");
-testAttachment(gl.STENCIL_ATTACHMENT, stencilBuffer, false);
-debug("Attach stencil using DEPTH_ATTACHMENT");
-testAttachment(gl.DEPTH_ATTACHMENT, stencilBuffer, true);
-debug("Attach stencil using DEPTH_STENCIL_ATTACHMENT");
-testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, stencilBuffer, true);
-debug("Attach depthStencil using DEPTH_STENCIL_ATTACHMENT");
-testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, false);
-debug("Attach depthStencil using DEPTH_ATTACHMENT");
-testAttachment(gl.DEPTH_ATTACHMENT, depthStencilBuffer, true);
-debug("Attach depthStencil using STENCIL_ATTACHMENT");
-testAttachment(gl.STENCIL_ATTACHMENT, depthStencilBuffer, true);
+        debug("Attach depth using DEPTH_ATTACHMENT");
+        testAttachment(gl.DEPTH_ATTACHMENT, depthBuffer, false);
+        debug("Attach depth using STENCIL_ATTACHMENT");
+        testAttachment(gl.STENCIL_ATTACHMENT, depthBuffer, true);
+        debug("Attach depth using DEPTH_STENCIL_ATTACHMENT");
+        testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthBuffer, true);
+        debug("Attach stencil using STENCIL_ATTACHMENT");
+        testAttachment(gl.STENCIL_ATTACHMENT, stencilBuffer, false);
+        debug("Attach stencil using DEPTH_ATTACHMENT");
+        testAttachment(gl.DEPTH_ATTACHMENT, stencilBuffer, true);
+        debug("Attach stencil using DEPTH_STENCIL_ATTACHMENT");
+        testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, stencilBuffer, true);
+        debug("Attach depthStencil using DEPTH_STENCIL_ATTACHMENT");
+        testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, false);
+        debug("Attach depthStencil using DEPTH_ATTACHMENT");
+        testAttachment(gl.DEPTH_ATTACHMENT, depthStencilBuffer, true);
+        debug("Attach depthStencil using STENCIL_ATTACHMENT");
+        testAttachment(gl.STENCIL_ATTACHMENT, depthStencilBuffer, true);
 
-debug("Attach depth, then stencil, causing conflict");
-testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.STENCIL_ATTACHMENT, stencilBuffer, true);
-debug("Attach stencil, then depth, causing conflict");
-testAttachments(gl.STENCIL_ATTACHMENT, stencilBuffer, gl.DEPTH_ATTACHMENT, depthBuffer, true);
-debug("Attach depth, then depthStencil, causing conflict");
-testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, true);
-debug("Attach depthStencil, then depth, causing conflict");
-testAttachments(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, gl.DEPTH_ATTACHMENT, depthBuffer, true);
-debug("Attach stencil, then depthStencil, causing conflict");
-testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, true);
-debug("Attach depthStencil, then stencil, causing conflict");
-testAttachments(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, gl.STENCIL_ATTACHMENT, stencilBuffer, true);
+        debug("Attach depth, then stencil, causing conflict");
+        testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.STENCIL_ATTACHMENT, stencilBuffer, true);
+        debug("Attach stencil, then depth, causing conflict");
+        testAttachments(gl.STENCIL_ATTACHMENT, stencilBuffer, gl.DEPTH_ATTACHMENT, depthBuffer, true);
+        debug("Attach depth, then depthStencil, causing conflict");
+        testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, true);
+        debug("Attach depthStencil, then depth, causing conflict");
+        testAttachments(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, gl.DEPTH_ATTACHMENT, depthBuffer, true);
+        debug("Attach stencil, then depthStencil, causing conflict");
+        testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, true);
+        debug("Attach depthStencil, then stencil, causing conflict");
+        testAttachments(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, gl.STENCIL_ATTACHMENT, stencilBuffer, true);
 
-debug("Attach color renderbuffer with internalformat == RGBA4");
-testColorRenderbuffer(gl.RGBA4);
+        debug("Attach color renderbuffer with internalformat == RGBA4");
+        testColorRenderbuffer(gl.RGBA4);
 
-debug("Attach color renderbuffer with internalformat == RGB5_A1");
-testColorRenderbuffer(gl.RGB5_A1);
+        debug("Attach color renderbuffer with internalformat == RGB5_A1");
+        testColorRenderbuffer(gl.RGB5_A1);
 
-debug("Attach color renderbuffer with internalformat == RGB565");
-testColorRenderbuffer(gl.RGB565);
+        debug("Attach color renderbuffer with internalformat == RGB565");
+        testColorRenderbuffer(gl.RGB565);
 
-debug("Create and attach depthStencil renderbuffer");
-testDepthStencilRenderbuffer();
+        debug("Create and attach depthStencil renderbuffer");
+        testDepthStencilRenderbuffer();
+    }
+}
 
 successfullyParsed = true;
 </script>
 
 <script src="../resources/js-test-post.js"></script>
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/framebuffer-test.html
+++ b/content/canvas/test/webgl/conformance/framebuffer-test.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL Framebuffer Test</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
@@ -163,13 +162,11 @@ if (!gl) {
             "binding default (null) framebuffer should succeed.");
 }
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
-<script>
-</script>
 
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/get-active-test.html
+++ b/content/canvas/test/webgl/conformance/get-active-test.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (C) 2009 Apple Computer, Inc.  All rights reserved.
+Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
@@ -17,19 +17,20 @@ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHA
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
-
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
--- a/content/canvas/test/webgl/conformance/gl-bind-attrib-location-test.html
+++ b/content/canvas/test/webgl/conformance/gl-bind-attrib-location-test.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL BindAttribLocation Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
@@ -23,19 +22,18 @@ attribute vec4 vColor;
 varying vec4 color;
 void main()
 {
   gl_Position = vPosition;
   color = vColor;
 }
 </script>
 <script id="fshader" type="text/something-not-javascript">
-#ifdef GL_ES
-precision highp float;
-#endif
+precision mediump float;
+
 varying vec4 color;
 void main()
 {
   gl_FragColor = color;
 }
 </script>
 <script>
 description("This test ensures WebGL implementations don't allow names that start with 'gl_' when calling bindAttribLocation.");
--- a/content/canvas/test/webgl/conformance/gl-clear.html
+++ b/content/canvas/test/webgl/conformance/gl-clear.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
   found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL clear conformance test.</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="example" width="1" height="1" style="width: 256px; height: 48px;"></canvas>
--- a/content/canvas/test/webgl/conformance/gl-drawelements.html
+++ b/content/canvas/test/webgl/conformance/gl-drawelements.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
 -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
   <head>
+<meta charset="utf-8">
     <title>WebGL drawElements Test</title>
     <link rel="stylesheet" href="../resources/js-test-style.css"/>
     <script src="../resources/js-test-pre.js"></script>
     <script src="resources/webgl-test.js"> </script>
     <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 </head>
 <body>
 <canvas id="example" width="50" height="50"></canvas>
@@ -85,16 +85,12 @@ found in the LICENSE file.
                 gl.TRIANGLES, 3, gl.UNSIGNED_INT,
                 gl.INVALID_ENUM, "gl.DrawElements should return INVALID_ENUM with UNSIGNED_INT");
 
        }
 
        init();
        successfullyParsed = true;
     </script>
-</body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/gl-enable-enum-test.html
+++ b/content/canvas/test/webgl/conformance/gl-enable-enum-test.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL gl.ENABLE enums Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
@@ -125,13 +124,10 @@ if (!gl) {
 }
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/gl-enable-vertex-attrib.html
+++ b/content/canvas/test/webgl/conformance/gl-enable-vertex-attrib.html
@@ -1,16 +1,17 @@
 <!--
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 -->
 <!DOCTYPE html>
 <html>
   <head>
+<meta charset="utf-8">
     <title>WebGL Enable Vertex Attrib Test</title>
     <link rel="stylesheet" href="../resources/js-test-style.css"/>
     <script src="../resources/js-test-pre.js"></script>
     <script src="resources/webgl-test.js"> </script>
 </head>
 <body>
 <canvas id="example" width="50" height="50">
 </canvas>
@@ -44,17 +45,13 @@ gl.vertexAttribPointer(0, 3, gl.FLOAT, f
 gl.enableVertexAttribArray(3);
 glErrorShouldBe(gl, gl.NO_ERROR);
 
 gl.drawArrays(gl.TRIANGLES, 0, 3);
 glErrorShouldBe(gl, gl.INVALID_OPERATION);
 
 successfullyParsed = true;
 </script>
-</body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
--- a/content/canvas/test/webgl/conformance/gl-enum-tests.html
+++ b/content/canvas/test/webgl/conformance/gl-enum-tests.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL gl enums Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
@@ -78,14 +77,11 @@ if (!gl) {
 }
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
new file mode 100644
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/gl-fragcoord.html
@@ -0,0 +1,84 @@
+<!--
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file.
+ -->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+  <title>gl-fragcoord Test</title>
+  <link rel="stylesheet" href="../resources/js-test-style.css"/>
+  <script src="../resources/js-test-pre.js"></script>
+  <script src="resources/webgl-test.js"> </script>
+  <script src="resources/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="32" height="32">
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
+  <script id="vshader" type="x-shader/x-vertex">
+    attribute vec4 vPosition;
+    void main()
+    {
+      gl_Position = vPosition;
+    }
+  </script>
+
+  <script id="fshader" type="x-shader/x-fragment">
+    precision mediump float;
+    void main()
+    {
+      gl_FragColor = vec4(
+        floor(gl_FragCoord.x * 4.0 / 32.0) / 4.0,
+        floor(gl_FragCoord.y * 4.0 / 32.0) / 4.0,
+        floor(gl_FragCoord.z * 4.0) / 4.0,
+        1);
+    }
+  </script>
+
+  <script>
+    function init()
+    {
+      if (window.initNonKhronosFramework) {
+        window.initNonKhronosFramework(false);
+      }
+
+      wtu = WebGLTestUtils;
+      gl = initWebGL("example", "vshader", "fshader", [ "vPosition"], [ 0, 0, 0, 1 ], 1);
+
+      var vertexObject = gl.createBuffer();
+      gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+      gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(
+        [-1, -1, -1,  1, -1,  0, -1,  1,  0,
+         -1,  1,  0,  1, -1,  0,  1,  1,  1]),
+                    gl.STATIC_DRAW);
+      gl.enableVertexAttribArray(0);
+      gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+      gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+      gl.drawArrays(gl.TRIANGLES, 0, 6);
+
+      for (var xx = 0; xx < 32; xx += 4) {
+        for (var yy = 0; yy < 32; yy += 4) {
+          var zz = (xx / 64) + (yy / 64);
+          var color = [
+             Math.floor(Math.floor(xx * 4.0 / 32.0) / 4 * 256),
+             Math.floor(Math.floor(yy * 4.0 / 32.0) / 4 * 256),
+             Math.floor(Math.floor(zz * 4.0) / 4 * 256)
+          ];
+          var msg = "should be " + color;
+          wtu.checkCanvasRect(
+              gl, xx, yy, 1, 1, color, msg, 4);
+        }
+      }
+    }
+
+    init();
+    successfullyParsed = true;
+  </script>
+<script src="../resources/js-test-post.js"></script>
+
+</body>
+</html>
--- a/content/canvas/test/webgl/conformance/gl-get-active-attribute.html
+++ b/content/canvas/test/webgl/conformance/gl-get-active-attribute.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL getActiveAttrib conformance test.</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="example" width="16" height="16"></canvas>
@@ -72,18 +72,14 @@ for (var tt = 0; tt < tests.length; ++tt
   }
   if (!found) {
     testFailed("attrib 'attr0' not found");
   }
 }
 
 successfullyParsed = true;
 </script>
-</body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
 
--- a/content/canvas/test/webgl/conformance/gl-get-active-uniform.html
+++ b/content/canvas/test/webgl/conformance/gl-get-active-uniform.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL getActiveUniform conformance test.</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="example" width="16" height="16"></canvas>
@@ -133,18 +133,14 @@ gl.useProgram(p2);
 gl.uniform1f(l2, 1);
 glErrorShouldBe(gl, gl.NO_ERROR, "no errors setting uniform 0");
 gl.uniform1f(l1, 2);
 glErrorShouldBe(gl, gl.INVALID_OPERATION,
                 "setting a uniform using a location from another program");
 
 successfullyParsed = true;
 </script>
-</body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
 
--- a/content/canvas/test/webgl/conformance/gl-get-calls.html
+++ b/content/canvas/test/webgl/conformance/gl-get-calls.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (C) 2009 Apple Computer, Inc.  All rights reserved.
+Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
@@ -18,19 +18,20 @@ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, I
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
 
-<html xmlns="http://www.w3.org/1999/xhtml">
+<!DOCTYPE html>
+<html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL gl calls Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
@@ -142,13 +143,10 @@ else {
 }
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
new file mode 100644
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/gl-geterror.html
@@ -0,0 +1,77 @@
+<!--
+Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+  found in the LICENSE file.
+ -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+  "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<title>WebGL get error conformance test.</title>
+<link rel="stylesheet" href="../resources/js-test-style.css"/>
+<script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
+<script src="../resources/js-test-pre.js"></script>
+<script src="resources/webgl-test.js"> </script>
+<script src="resources/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="1" height="1" style="width: 256px; height: 48px;"></canvas>
+<div id="description"></div><div id="console"></div>
+<script>
+description("Test getError.");
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("example");
+var gl = wtu.create3DContext(canvas);
+var tex = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex);
+
+gl.enable(desktopGL.ALPHA_TEST);
+glErrorShouldBe(gl, gl.INVALID_ENUM, "should generate INVALID_ENUM");
+gl.viewport(-1, -1, -1, -1);
+glErrorShouldBe(gl, gl.INVALID_VALUE, "should generate INVALID_VALUE");
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+glErrorShouldBe(gl, gl.INVALID_OPERATION, "should generate INVALID_OPERATION");
+
+// Generate 2 errors of each type for 6 total possible errors.
+// The OpenGL ES 2.0 spec section 2.5 says the implementation is allowed to
+// either return the first error or many errors in an unspecied order.
+gl.viewport(-1, -1, -1, -1);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+gl.enable(desktopGL.ALPHA_TEST);
+gl.viewport(-1, -1, -1, -1);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+// Note: This error is specifically last because we know it will be synthasized
+// by WebGL at least when implemented on top of Desktop OpenGL
+gl.enable(desktopGL.ALPHA_TEST);
+
+var err1 = gl.getError();
+var err2 = gl.getError();
+var err3 = gl.getError();
+var err4 = gl.getError();
+var err5 = gl.getError();
+var err6 = gl.getError();
+
+debug("");
+if (err2 == gl.NO_ERROR) {
+  debug("This WebGL implementation looks like it uses the 'first error' method");
+  debug("There should be 1 error, the first one generated");
+  shouldBeTrue('err1 == gl.INVALID_VALUE && err2 == gl.NO_ERROR && err3 == gl.NO_ERROR');
+} else {
+  debug("This WebGL implementation looks like it uses the many error method");
+  debug("Check is that at least one of the errors is the first error");
+  shouldBeTrue('err1 == gl.INVALID_VALUE || ' +
+               'err2 == gl.INVALID_VALUE || ' +
+               'err3 == gl.INVALID_VALUE || ' +
+               'err4 == gl.INVALID_VALUE || ' +
+               'err5 == gl.INVALID_VALUE || ' +
+               'err6 == gl.INVALID_VALUE');
+  shouldBeTrue('gl.getError() == gl.NO_ERROR');
+}
+
+debug("");
+successfullyParsed = true;
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
+
--- a/content/canvas/test/webgl/conformance/gl-getshadersource.html
+++ b/content/canvas/test/webgl/conformance/gl-getshadersource.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'/>
+<meta charset="utf-8">
    <title>WebGL getShaderSource conformance test.</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
@@ -27,19 +26,14 @@ var gl = wtu.create3DContext(canvas);
 var original = document.getElementById("vshader").text;
 var shader = gl.createShader(gl.VERTEX_SHADER);
 gl.shaderSource(shader, original);
 var source = gl.getShaderSource(shader);
 shouldBe("source", "original");
 glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors.");
 successfullyParsed = true;
 </script>
-</body>
-</body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
 
--- a/content/canvas/test/webgl/conformance/gl-getstring.html
+++ b/content/canvas/test/webgl/conformance/gl-getstring.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL gl.getParameter Strings Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
@@ -50,13 +49,10 @@ function checkPrefix(expected, enum_val)
 }
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/gl-min-attribs.html
+++ b/content/canvas/test/webgl/conformance/gl-min-attribs.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL the minimum number of attributes are supported.</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
@@ -30,19 +30,17 @@ varying vec4 color;
 void main()
 {
     gl_Position = vPosition;
     color = v0 + v1 + v2 + v3 + v4 + v5 + v6;
 }
 </script>
 
 <script id="fshader" type="x-shader/x-fragment">
-#ifdef GL_ES
 precision mediump float;
-#endif
 varying vec4 color;
 void main()
 {
     gl_FragColor = color;
 }
 </script>
 <script>
 var wtu = WebGLTestUtils;
@@ -77,15 +75,12 @@ glErrorShouldBe(gl, gl.NO_ERROR, "Should
 wtu.checkCanvasRect(gl, 0, 0, canvas.width, canvas.height, [255, 127, 64, 32], "Should render 255,127,64,32 (+/-1)", 1);
 
 successfullyParsed = true;
 
 </script>
 </body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
 
deleted file mode 100644
--- a/content/canvas/test/webgl/conformance/gl-min-textures-unroll.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
-Use of this source code is governed by a BSD-style license that can be
-found in the LICENSE file.
- -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>WebGL the minimum number of uniforms are supported.</title>
-<link rel="stylesheet" href="../resources/js-test-style.css"/>
-<script src="../resources/js-test-pre.js"></script>
-<script src="resources/webgl-test.js"> </script>
-<script src="resources/webgl-test-utils.js"> </script>
-</head>
-<body>
-<canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
-<div id="description"></div>
-<div id="console"></div>
-<script id="vshader" type="x-shader/x-vertex">
-attribute vec4 vPosition;
-void main()
-{
-    gl_Position = vPosition;
-}
-</script>
-
-<script id="fshader" type="x-shader/x-fragment">
-#define NUM_TEXTURES 8 // See spec
-#ifdef GL_ES
-precision mediump float;
-#endif
-uniform sampler2D uni[8];
-void main()
-{
-    vec4 c = vec4(0,0,0,0);
-    c += texture2D(uni[0], vec2(0.5, 0.5));
-    c += texture2D(uni[1], vec2(0.5, 0.5));
-    c += texture2D(uni[2], vec2(0.5, 0.5));
-    c += texture2D(uni[3], vec2(0.5, 0.5));
-    c += texture2D(uni[4], vec2(0.5, 0.5));
-    c += texture2D(uni[5], vec2(0.5, 0.5));
-    c += texture2D(uni[6], vec2(0.5, 0.5));
-    c += texture2D(uni[7], vec2(0.5, 0.5));
-    gl_FragColor = c;
-}
-</script>
-<script>
-var wtu = WebGLTestUtils;
-var canvas = document.getElementById("example");
-var gl = wtu.create3DContext(canvas);
-var program = wtu.setupTexturedQuad(gl);
-
-//------------------------------------------------------------------------------
-var program = wtu.setupProgram(
-    gl,
-    [wtu.loadShaderFromScript(gl, 'vshader', gl.VERTEX_SHADER),
-     wtu.loadShaderFromScript(gl, 'fshader', gl.FRAGMENT_SHADER)],
-    ['vPosition'], [0]);
-
-for (var ii = 0; ii < 8; ++ii) {
-  var loc = gl.getUniformLocation(program, "uni[" + ii + "]");
-  gl.activeTexture(gl.TEXTURE0 + ii);
-  var tex = gl.createTexture();
-  wtu.fillTexture(gl, tex, 1, 1, [32, 16, 8, ii * 9], 0);
-  gl.uniform1i(loc, ii);
-}
-
-wtu.drawQuad(gl);
-glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
-wtu.checkCanvas(gl, [255, 128, 64, 252],
-                "Should render using all texture units");
-
-successfullyParsed = true;
-
-</script>
-</body>
-<script src="../resources/js-test-post.js"></script>
-
-<script>
-</script>
-
-</body>
-</html>
-
-
--- a/content/canvas/test/webgl/conformance/gl-min-textures.html
+++ b/content/canvas/test/webgl/conformance/gl-min-textures.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL the minimum number of uniforms are supported.</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
@@ -22,19 +22,17 @@ attribute vec4 vPosition;
 void main()
 {
     gl_Position = vPosition;
 }
 </script>
 
 <script id="fshader" type="x-shader/x-fragment">
 #define NUM_TEXTURES 8 // See spec
-#ifdef GL_ES
 precision mediump float;
-#endif
 uniform sampler2D uni[8];
 void main()
 {
     vec4 c = vec4(0,0,0,0);
     for (int ii = 0; ii < NUM_TEXTURES; ++ii) {
       c += texture2D(uni[ii], vec2(0.5, 0.5));
     }
     gl_FragColor = c;
@@ -64,18 +62,14 @@ for (var ii = 0; ii < 8; ++ii) {
 wtu.drawQuad(gl);
 glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
 wtu.checkCanvas(gl, [255, 128, 64, 252],
                 "Should render using all texture units");
 
 successfullyParsed = true;
 
 </script>
-</body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
 
--- a/content/canvas/test/webgl/conformance/gl-min-uniforms.html
+++ b/content/canvas/test/webgl/conformance/gl-min-uniforms.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL the minimum number of uniforms are supported.</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
@@ -29,37 +29,33 @@ void main()
     for (int ii = 0; ii < NUM_UNIFORMS; ++ii) {
       c += uni[ii];
     }
     color = c;
 }
 </script>
 
 <script id="fshader" type="x-shader/x-fragment">
-#ifdef GL_ES
 precision mediump float;
-#endif
 varying vec4 color;
 void main()
 {
     gl_FragColor = color;
 }
 </script>
 <script id="vshader2" type="x-shader/x-vertex">
 attribute vec4 vPosition;
 void main()
 {
     gl_Position = vPosition;
 }
 </script>
 
 <script id="fshader2" type="x-shader/x-fragment">
-#ifdef GL_ES
 precision mediump float;
-#endif
 #define NUM_UNIFORMS 16 // See spec
 uniform vec4 uni[NUM_UNIFORMS];
 void main()
 {
     vec4 c = vec4(0,0,0,0);
     for (int ii = 0; ii < NUM_UNIFORMS; ++ii) {
        c += uni[ii];
     }
@@ -103,18 +99,14 @@ for (var ii = 0; ii < 16; ++ii) {
 glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
 wtu.drawQuad(gl);
 glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
 wtu.checkCanvasRect(gl, 0, 0, canvas.width, canvas.height, [32, 64, 127, 255], "Should render 32,64,127,255 (+/-1)", 1);
 
 successfullyParsed = true;
 
 </script>
-</body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
 
--- a/content/canvas/test/webgl/conformance/gl-object-get-calls.html
+++ b/content/canvas/test/webgl/conformance/gl-object-get-calls.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (C) 2009 Apple Computer, Inc.  All rights reserved.
+Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
@@ -17,18 +17,20 @@ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHA
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
@@ -254,19 +256,19 @@ shouldBe('gl.getVertexAttribOffset(1, gl
 gl.disableVertexAttribArray(1);
 shouldBe('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_ENABLED)', 'false');
 gl.vertexAttrib4f(1, 5, 6, 7, 8);
 shouldBe('gl.getVertexAttrib(1, gl.CURRENT_VERTEX_ATTRIB)', '[5, 6, 7, 8]');
 glErrorShouldBe(gl, gl.NO_ERROR);
 
 // Test cases where name == 0
 gl.deleteTexture(texture);
-shouldBeNull('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)');
+shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)', 'gl.NONE');
 gl.deleteRenderbuffer(renderbuffer);
-shouldBeNull('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)');
+shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)', 'gl.NONE');
 gl.deleteBuffer(buffer);
 shouldBeNull('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING)');
 glErrorShouldBe(gl, gl.NO_ERROR);
 
 successfullyParsed = true;
 </script>
 
 <script src="../resources/js-test-post.js"></script>
--- a/content/canvas/test/webgl/conformance/gl-pixelstorei.html
+++ b/content/canvas/test/webgl/conformance/gl-pixelstorei.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
 -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL pixelStorei Test</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 </head>
 <body>
 <canvas id="example" width="50" height="50"></canvas>
@@ -114,16 +114,12 @@ function init() {
     assertMsg(gl.getParameter(gl.PACK_ALIGNMENT) == table[ii],
         "PACK_ALIGNMENT is " + table[ii]);
   }
 }
 
 init();
 successfullyParsed = true;
 </script>
-</body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/gl-scissor-test.html
+++ b/content/canvas/test/webgl/conformance/gl-scissor-test.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL Scissor Test</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../../debug/webgl-debug.js"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test-utils.js"></script>
 </head>
 <body>
@@ -65,13 +64,10 @@ if (!gl) {
 }
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/gl-shader-test.html
+++ b/content/canvas/test/webgl/conformance/gl-shader-test.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
 -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL ShaderL Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
@@ -40,13 +39,10 @@ if (!gl) {
 }
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/gl-teximage.html
+++ b/content/canvas/test/webgl/conformance/gl-teximage.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
   found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL texImage2D conformance test.</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="example" width="256" height="16" style="width: 256px; height: 48px;"></canvas>
--- a/content/canvas/test/webgl/conformance/gl-uniform-arrays.html
+++ b/content/canvas/test/webgl/conformance/gl-uniform-arrays.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL uniform array Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
@@ -21,19 +20,17 @@ found in the LICENSE file.
     attribute vec4 vPosition;
     void main()
     {
         gl_Position = vPosition;
     }
 </script>
 
 <script id="fshader" type="x-shader/x-fragment">
-    #ifdef GL_ES
     precision mediump float;
-    #endif
     uniform $type color[3];
     void main()
     {
         gl_FragColor = vec4(color[0]$elem, color[1]$elem, color[2]$elem, 1);
     }
 </script>
 <script>
 function loadShader(ctx, shaderType, shaderSource) {
@@ -296,13 +293,10 @@ for (var tt = 0; tt < typeInfos.length; 
                   "can call gl.useProgram(null)");
 }
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/gl-uniform-bool.html
+++ b/content/canvas/test/webgl/conformance/gl-uniform-bool.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL uniformMatrix Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
@@ -48,13 +47,10 @@ glErrorShouldBe(gl, gl.NO_ERROR,
                 "should be able to set bool with gl.uniform1f");
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/gl-uniformmatrix4fv.html
+++ b/content/canvas/test/webgl/conformance/gl-uniformmatrix4fv.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL uniformMatrix Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
--- a/content/canvas/test/webgl/conformance/gl-unknown-uniform.html
+++ b/content/canvas/test/webgl/conformance/gl-unknown-uniform.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
 -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL Unknown Uniform Conformance Test</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
@@ -57,13 +56,10 @@ if (!gl) {
 }
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/gl-vertex-attrib-zero-issues.html
+++ b/content/canvas/test/webgl/conformance/gl-vertex-attrib-zero-issues.html
@@ -1,16 +1,17 @@
 <!--
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 -->
 <!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL Enable Vertex Attrib Zero Test</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="example" width="50" height="50">
@@ -84,14 +85,11 @@ for (var ii = 0; ii < 5; ++ii) {
 }
 
 wtu.checkCanvas(gl, [0, 0, 0, 0], "canvas should be 0, 0, 0, 0");
 
 successfullyParsed = true;
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
--- a/content/canvas/test/webgl/conformance/gl-vertex-attrib.html
+++ b/content/canvas/test/webgl/conformance/gl-vertex-attrib.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL vertexAttrib Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
new file mode 100644
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/gl-vertexattribpointer-offsets.html
@@ -0,0 +1,192 @@
+<!--
+Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<!DOCTYPE html>
+<html>
+  <head>
+<meta charset="utf-8">
+    <title>Rendering Test</title>
+    <link rel="stylesheet" href="../resources/js-test-style.css"/>
+    <script src="../resources/js-test-pre.js"></script>
+    <script src="resources/webgl-test.js"> </script>
+    <script src="resources/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="50" height="50">
+There is supposed to be an example drawing here, but it's not important.
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
+    <script id="vshader" type="x-shader/x-vertex">
+        attribute vec4 vPosition;
+        void main()
+        {
+            gl_Position = vPosition;
+        }
+    </script>
+
+    <script id="fshader" type="x-shader/x-fragment">
+        precision mediump float;
+        uniform vec4 color;
+        void main()
+        {
+            gl_FragColor = color;
+        }
+    </script>
+
+    <script>
+        function fail(x,y, buf, shouldBe)
+        {
+            var i = (y*50+x) * 4;
+            var reason = "pixel at ("+x+","+y+") is ("+buf[i]+","+buf[i+1]+","+buf[i+2]+","+buf[i+3]+"), should be "+shouldBe;
+            testFailed(reason);
+        }
+
+        function pass()
+        {
+            testPassed("drawing is correct");
+        }
+
+        function init()
+        {
+            if (window.initNonKhronosFramework) {
+                window.initNonKhronosFramework(false);
+            }
+
+            wtu = WebGLTestUtils;
+            gl = initWebGL("example", "vshader", "fshader", [ "vPosition"], [ 0, 0, 0, 1 ], 1);
+
+            var tests = [
+              { data: new Float32Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
+                type: gl.FLOAT,
+                componentSize: 4,
+                normalize: false,
+              },
+              { data: new Float32Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
+                type: gl.FLOAT,
+                componentSize: 4,
+                normalize: false,
+              },
+              { data: new Uint16Array([ 0, 32767, 0, 32767, 0, 0, 0, 0, 0 ]),
+                type: gl.SHORT,
+                componentSize: 2,
+                normalize: true,
+              },
+              { data: new Uint16Array([ 0, 65535, 0, 65535, 0, 0, 0, 0, 0 ]),
+                type: gl.UNSIGNED_SHORT,
+                componentSize: 2,
+                normalize: true,
+              },
+              { data: new Uint16Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
+                type: gl.UNSIGNED_SHORT,
+                componentSize: 2,
+                normalize: false,
+              },
+              { data: new Uint16Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
+                type: gl.SHORT,
+                componentSize: 2,
+                normalize: false,
+              },
+              { data: new Uint8Array([ 0, 127, 0, 127, 0, 0, 0, 0, 0 ]),
+                type: gl.BYTE,
+                componentSize: 1,
+                normalize: true,
+              },
+              { data: new Uint8Array([ 0, 255, 0, 255, 0, 0, 0, 0, 0 ]),
+                type: gl.UNSIGNED_BYTE,
+                componentSize: 1,
+                normalize: true,
+              },
+              { data: new Uint8Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
+                type: gl.BYTE,
+                componentSize: 1,
+                normalize: false,
+              },
+              { data: new Uint8Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
+                type: gl.UNSIGNED_BYTE,
+                componentSize: 1,
+                normalize: false,
+              }
+            ];
+
+            var vertexObject = gl.createBuffer();
+            gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+            gl.bufferData(gl.ARRAY_BUFFER, 1024, gl.STATIC_DRAW);
+            gl.enableVertexAttribArray(0);
+
+            var colorLoc = gl.getUniformLocation(gl.program, "color");
+            var kNumVerts = 3;
+            var kNumComponents = 3;
+
+            var count = 0;
+            for (var tt = 0; tt < tests.length; ++tt) {
+              var test = tests[tt];
+              for (var oo = 0; oo < 3; ++oo) {
+                for (var ss = 0; ss < 3; ++ss) {
+                  var offset = (oo + 1) * test.componentSize;
+                  var color = (count % 2) ? [1, 0, 0, 1] : [0, 1, 0, 1];
+                  var stride = test.componentSize * kNumComponents + test.componentSize * ss;
+                  debug("");
+                  debug("check with " + wtu.glEnumToString(gl, test.type) + " at offset: " + offset + " with stride:" + stride + " normalize: " + test.normalize);
+                  gl.uniform4fv(colorLoc, color);
+                  var data = new Uint8Array(test.componentSize * kNumVerts * kNumComponents + stride * (kNumVerts - 1));
+                  var view = new Uint8Array(test.data.buffer);
+                  var size = test.componentSize * kNumComponents;
+                  for (var jj = 0; jj < kNumVerts; ++jj) {
+                    var off1 = jj * size;
+                    var off2 = jj * stride;
+                    for (var zz = 0; zz < size; ++zz) {
+                      data[off2 + zz] = view[off1 + zz];
+                    }
+                  }
+                  gl.bufferSubData(gl.ARRAY_BUFFER, offset, data);
+                  gl.vertexAttribPointer(0, 3, test.type, test.normalize, stride, offset);
+                  gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+                  gl.drawArrays(gl.TRIANGLES, 0, 3);
+
+                  var buf = new Uint8Array(50 * 50 * 4);
+                  gl.readPixels(0, 0, 50, 50, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+
+                  var black = [0, 0, 0, 255];
+                  var other = [color[0] * 255, color[1] * 255, color[2] * 255, color[3] * 255];
+                  var otherMsg = "should be " + ((count % 2) ? "red" : "green")
+                  wtu.checkCanvasRect(gl, 0, 0, 1, 1, black, "should be black", 0);
+                  wtu.checkCanvasRect(gl, 0, 49, 1, 1, black, "should be black", 0);
+                  wtu.checkCanvasRect(gl, 26, 40, 1, 1, other, otherMsg, 0);
+                  wtu.checkCanvasRect(gl, 26, 27, 1, 1, other, otherMsg, 0);
+                  wtu.checkCanvasRect(gl, 40, 27, 1, 1, other, otherMsg, 0);
+                  ++count;
+                }
+              }
+            }
+       }
+
+       init();
+       successfullyParsed = true;
+    </script>
+<script src="../resources/js-test-post.js"></script>
+
+</body>
+</html>
--- a/content/canvas/test/webgl/conformance/gl-vertexattribpointer.html
+++ b/content/canvas/test/webgl/conformance/gl-vertexattribpointer.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL vertexAttribPointer Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script src="resources/webgl-test-utils.js"></script>
 </head>
 <body>
@@ -125,13 +124,10 @@ if (!gl) {
 }
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/glsl-2types-of-textures-on-same-unit.html
+++ b/content/canvas/test/webgl/conformance/glsl-2types-of-textures-on-same-unit.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
   <head>
+<meta charset="utf-8">
     <title>WebGL GLSL 2 types of textures on same unit conformance test.</title>
     <link rel="stylesheet" href="../resources/js-test-style.css"/>
     <script src="../resources/js-test-pre.js"></script>
     <script src="resources/webgl-test.js"> </script>
     <script src="../../debug/webgl-debug.js"> </script>
 </head>
 <body>
 <canvas id="example" width="2" height="2" style="width: 40px; height: 40px;"></canvas>
@@ -25,19 +25,18 @@ varying vec2 texCoord;
 void main()
 {
   gl_Position = vPosition;
   texCoord = texCoord0;
 }
 </script>
 
 <script id="fshader" type="x-shader/x-fragment">
-#ifdef GL_ES
-precision highp float;
-#endif
+precision mediump float;
+
 uniform sampler2D tex2d;
 uniform samplerCube texCube;
 varying vec2 texCoord;
 void main()
 {
   gl_FragColor =  texture2D(tex2d, texCoord) +
                   textureCube(texCube, vec3(0,1,0));
 }
@@ -126,17 +125,13 @@ function init()
     glErrorShouldBe(gl, gl.INVALID_OPERATION,
               "drawing with 2 different targets on the same texture unit should generate INVALID_VALUE");
   }
 }
 
 init();
 successfullyParsed = true;
 </script>
-</body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
--- a/content/canvas/test/webgl/conformance/glsl-conformance.html
+++ b/content/canvas/test/webgl/conformance/glsl-conformance.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
 -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL GLSL Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test-utils.js"></script>
 </head>
 <body>
 <div id="description"></div>
@@ -29,17 +28,18 @@ precision mediump float;
 void main()
 {
     gl_FragColor = vec4(1.0,0.0,0.0,1.0);
 }
 </script>
 <script id="fshaderWithPrecision" type="text/something-not-javascript">
 void main()
 {
-    gl_FragColor = mediump vec4(1.0,0.0,0.0,1.0);
+    mediump vec4 color = vec4(1.0, 0.0, 0.0, 1.0);
+    gl_FragColor = color;
 }
 </script>
 <script id="vshaderWithDefaultPrecision" type="text/something-not-javascript">
 precision mediump float;
 attribute vec4 vPosition;
 void main()
 {
     gl_Position = vPosition;
@@ -186,17 +186,17 @@ void main()
 {
     gl_Position = _webgl_vPosition;
 }
 </script>
 <script id="vshaderWithImplicitVec3Cast" type="text/something-not-javascript">
 attribute vec4 vPosition;
 void main()
 {
-    highp vec3 k = vec3(1, 2, 3);
+    mediump vec3 k = vec3(1, 2, 3);
     gl_Position = k;
 }
 </script>
 <script id="vshaderWithExplicitIntCast" type="text/something-not-javascript">
 attribute vec4 vPosition;
 void main()
 {
     int k = 123;
@@ -302,16 +302,153 @@ void main()
 </script>
 <script id="fshaderWithNonASCIIErrorDirective" type="text/something-not-javascript">
 #error ͂`rbhhł͂Ȃ // will return INVALID_VALUE. See WebGL 6.18
 void main()
 {
     gl_FragColor = vec4(0,0,0,0);
 }
 </script>
+<script id="fshaderWithFunctionRecursion" type="text/something-not-javascript">
+void a();
+void b();
+void main()
+{
+    a();
+}
+void a()
+{
+    b();
+}
+void b()
+{
+    a();
+}
+</script>
+<script id="fshaderWithIntReturnValue" type="text/something-not-javascript">
+int functionResult();
+
+void main()
+{
+    int r = functionResult();
+    gl_FragColor = vec4(r, r, r, r);
+}
+
+int functionResult()
+{
+    return 1;
+}
+</script>
+<script id="fshaderWithIVec2ReturnValue" type="text/something-not-javascript">
+ivec2 functionResult();
+
+void main()
+{
+    ivec2 r = functionResult();
+    gl_FragColor = vec4(r.x, r.y, r.x, r.y);
+}
+
+ivec2 functionResult()
+{
+    return ivec2(1, 1);
+}
+</script>
+<script id="fshaderWithIVec3ReturnValue" type="text/something-not-javascript">
+ivec3 functionResult();
+
+void main()
+{
+    ivec3 r = functionResult();
+    gl_FragColor = vec4(r.x, r.y, r.z, r.x);
+}
+
+ivec3 functionResult()
+{
+    return ivec3(1, 1, 1);
+}
+</script>
+<script id="fshaderWithIVec4ReturnValue" type="text/something-not-javascript">
+ivec4 functionResult();
+
+void main()
+{
+    ivec4 r = functionResult();
+    gl_FragColor = vec4(r.x, r.y, r.z, r.w);
+}
+
+ivec4 functionResult()
+{
+    return ivec4(1, 1, 1, 1);
+}
+
+</script>
+<script id="fshaderWithFloatReturnValue" type="text/something-not-javascript">
+precision mediump float;
+
+float functionResult();
+
+void main()
+{
+    float r = functionResult();
+    gl_FragColor = vec4(r, r, r, r);
+}
+
+float functionResult()
+{
+    return 1.0;
+}
+</script>
+<script id="fshaderWithVec2ReturnValue" type="text/something-not-javascript">
+precision mediump float;
+
+vec2 functionResult();
+
+void main()
+{
+    vec2 r = functionResult();
+    gl_FragColor = vec4(r.x, r.y, r.x, r.y);
+}
+
+vec2 functionResult()
+{
+    return vec2(1.0, 1.0);
+}
+</script>
+<script id="fshaderWithVec3ReturnValue" type="text/something-not-javascript">
+precision mediump float;
+
+vec3 functionResult();
+
+void main()
+{
+    vec3 r = functionResult();
+    gl_FragColor = vec4(r.x, r.y, r.z, r.x);
+}
+
+vec3 functionResult()
+{
+    return vec3(1.0, 1.0, 1.0);
+}
+</script>
+<script id="fshaderWithVec4ReturnValue" type="text/something-not-javascript">
+precision mediump float;
+
+vec4 functionResult();
+
+void main()
+{
+    vec4 r = functionResult();
+    gl_FragColor = vec4(r.x, r.y, r.z, r.w);
+}
+
+vec4 functionResult()
+{
+    return vec4(1.0, 1.0, 1.0, 1.0);
+}
+</script>
 <canvas id="canvas" width="2" height="2"> </canvas>
 <script>
 description("This test ensures WebGL implementations allow proper GLES2 shaders compile and improper ones fail.");
 
 debug("");
 debug("Canvas.getContext");
 
 var wtu = WebGLTestUtils;
@@ -523,43 +660,44 @@ if (!gl) {
     },
     { vShaderId: 'vshaderWithIncludeDirective',
       vShaderSuccess: false,
       fShaderId: 'fshader',
       fShaderSuccess: true,
       linkSuccess: false,
       passMsg: 'vertex shader uses #include should fail',
     },
-    //{ vShaderId: 'vshader',
-    //  vShaderSuccess: true,
-    //  fShaderId: 'fshaderWith257CharacterIdentifier',
-    //  fShaderSuccess: false,
-    //  linkSuccess: false,
-    //  passMsg: 'shader that uses 257 character identifier should fail',
-    //},
-    //{ vShaderId: 'vshader',
-    //  vShaderSuccess: true,
-    //  fShaderId: 'fshaderWith256CharacterIdentifier',
-    //  fShaderSuccess: true,
-    //  linkSuccess: true,
-    //  passMsg: 'shader that uses 256 character identifier should succeed',
-    //},
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWith257CharacterIdentifier',
+      fShaderSuccess: false,
+      linkSuccess: false,
+      passMsg: 'shader that uses 257 character identifier should fail',
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWith256CharacterIdentifier',
+      fShaderSuccess: true,
+      linkSuccess: true,
+      passMsg: 'shader that uses 256 character identifier should succeed',
+    },
     { vShaderId: 'vshader',
       vShaderSuccess: true,
       fShaderId: 'fshaderWithLongLine',
       fShaderSuccess: true,
       fShaderPrep: function(str) {
         function expand(str, re, replacement, count) {
           for (var ii = 0; ii < count; ++ii) {
             str = str.replace(re, replacement);
           }
           return str;
         }
         str = expand(str, new RegExp(" ", 'g'), "  ", 12);
-        str = expand(str, new RegExp("0", 'g'), "00", 8);
+        var manyZeros = expand("0", new RegExp("0", 'g'), "00", 8).substring(2);
+        str = expand(str, new RegExp("0", 'g'), manyZeros, 1);
         str = expand(str, new RegExp("fooo", 'g'), "fooofooo", 6);
         str = expand(str, new RegExp("long", 'g'), "longlong", 6);
         //debug("len:" + str.length);
         //debug(str);
         return str;
       },
       linkSuccess: true,
       passMsg: 'shader that uses long lines should succeed',
@@ -581,113 +719,203 @@ if (!gl) {
       passMsg: "error directive using quotes fails",
     },
     { vShaderId: 'vshader',
       vShaderSuccess: true,
       fShaderId: 'fshaderWithNonASCIIErrorDirective',
       fShaderSuccess: false,
       linkSuccess: false,
       passMsg: "error directive using characters outside of allowed set fails",
-    }
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWithFunctionRecursion',
+      fShaderSuccess: false,
+      linkSuccess: false,
+      passMsg: "Shaders with recursive function calls should fail",
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWithIntReturnValue',
+      fShaderSuccess: true,
+      linkSuccess: true,
+      passMsg: "Shader with int return value from function call should succeed",
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWithIVec2ReturnValue',
+      fShaderSuccess: true,
+      linkSuccess: true,
+      passMsg: "Shader with ivec2 return value from function call should succeed",
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWithIVec3ReturnValue',
+      fShaderSuccess: true,
+      linkSuccess: true,
+      passMsg: "Shader with ivec3 return value from function call should succeed",
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWithIVec4ReturnValue',
+      fShaderSuccess: true,
+      linkSuccess: true,
+      passMsg: "Shader with ivec4 return value from function call should succeed",
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWithFloatReturnValue',
+      fShaderSuccess: true,
+      linkSuccess: true,
+      passMsg: "Shader with float return value from function call should succeed",
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWithVec2ReturnValue',
+      fShaderSuccess: true,
+      linkSuccess: true,
+      passMsg: "Shader with vec2 return value from function call should succeed",
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWithVec3ReturnValue',
+      fShaderSuccess: true,
+      linkSuccess: true,
+      passMsg: "Shader with vec3 return value from function call should succeed",
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWithVec4ReturnValue',
+      fShaderSuccess: true,
+      linkSuccess: true,
+      passMsg: "Shader with vec4 return value from function call should succeed",
+    },
   ];
 
   // Read in all the shader source.
   for (var ii = 0; ii < shaderInfo.length; ++ii) {
     var si = shaderInfo[ii];
     si.vShaderSource = document.getElementById(si.vShaderId).text;
     si.fShaderSource = document.getElementById(si.fShaderId).text;
   }
 
   // Add more tests from external file
   var simpleVertShader = document.getElementById('vshader').text;
   var simpleFragShader = document.getElementById('fshader').text;
 
   function addExternalShaders(filename, passMsg) {
-    var files = wtu.readFileList(filename);
-    for (var ii = 0; ii < files.length; ++ii) {
-      var file = files[ii];
-      var shaderSource = wtu.readFile(file);
-      var firstLine = shaderSource.split("\n")[0];
-      var success = undefined;
-      if (wtu.endsWith(firstLine, " fail") ||
-          wtu.endsWith(firstLine, " fail.")) {
-        success = false;
-      } else if (wtu.endsWith(firstLine, " succeed") ||
-                 wtu.endsWith(firstLine, " succeed.")) {
-        success = true;
-      }
-      if (success === undefined) {
-        testFailed("bad first line in " + file);
-        continue;
-      }
-      if (!wtu.startsWith(firstLine, "// ")) {
-        testFailed("bad first line in " + file);
-        continue;
+    var lines = wtu.readFileList(filename);
+    for (var ii = 0; ii < lines.length; ++ii) {
+      var info = {
+        vShaderId:      'vshader',
+        vShaderSource:  simpleVertShader,
+        vShaderSuccess: true,
+        fShaderId:      'fshader',
+        fShaderSource:  simpleFragShader,
+        fShaderSuccess: true,
+        linkSuccess:    true,
+      };
+
+      var line = lines[ii];
+      var files = line.split(/ +/);
+      var passMsg = "";
+      for (var jj = 0; jj < files.length; ++jj) {
+        var file = files[jj];
+        var shaderSource = wtu.readFile(file);
+        var firstLine = shaderSource.split("\n")[0];
+        var success = undefined;
+        if (wtu.endsWith(firstLine, " fail") ||
+            wtu.endsWith(firstLine, " fail.")) {
+          success = false;
+        } else if (wtu.endsWith(firstLine, " succeed") ||
+                   wtu.endsWith(firstLine, " succeed.")) {
+          success = true;
+        }
+        if (success === undefined) {
+          testFailed("bad first line in " + file + ":" + firstLine);
+          continue;
+        }
+        if (!wtu.startsWith(firstLine, "// ")) {
+          testFailed("bad first line in " + file + ":" + firstLine);
+          continue;
+        }
+        passMsg = passMsg + (passMsg.length ? ", " : "") + firstLine.substr(3);
+        if (wtu.endsWith(file, ".vert")) {
+          info.vShaderId = file;
+          info.vShaderSource = shaderSource;
+          info.vShaderSuccess = success;
+        } else if (wtu.endsWith(file, ".frag")) {
+          info.fShaderId = file;
+          info.fShaderSource = shaderSource;
+          info.fShaderSuccess = success;
+        }
       }
-      var passMsg = firstLine.substr(3);
-      if (wtu.endsWith(file, ".vert")) {
-        shaderInfo.push({
-            vShaderId: file,
-            vShaderSource: shaderSource,
-            vShaderSuccess: success,
-            fShaderId: 'fshader',
-            fShaderSource: simpleFragShader,
-            fShaderSuccess: true,
-            linkSuccess: success,
-            passMsg: passMsg,
-          });
-      } else if (wtu.endsWith(file, ".frag")) {
-        shaderInfo.push({
-            vShaderId: 'vshader',
-            vShaderSource: simpleVertShader,
-            vShaderSuccess: true,
-            fShaderId: file,
-            fShaderSource: shaderSource,
-            fShaderSuccess: success,
-            linkSuccess: success,
-            passMsg: passMsg,
-          });
-      }
+      info.linkSuccess = info.vShaderSuccess && info.fShaderSuccess;
+      info.passMsg = passMsg;
+      shaderInfo.push(info);
     }
   }
 
   addExternalShaders('shaders/00_shaders.txt');
 
+  var vShaderDB = { };
+  var fShaderDB = { };
+
   for (var ii = 0; ii < shaderInfo.length; ++ii) {
     var info = shaderInfo[ii];
     var passMsg = '[' + info.vShaderId + '/' + info.fShaderId + ']: ' +
                   info.passMsg
     log(passMsg);
+
     //debug(info.fShaderId);
     var vSource = info.vShaderPrep ? info.vShaderPrep(info.vShaderSource) :
       info.vShaderSource;
-    var vShader = wtu.loadShader(gl, vSource, gl.VERTEX_SHADER);
-    if (info.vShaderTest) {
-      if (!info.vShaderTest(vShader)) {
+
+    // Reuse identical shaders so we test shared shader.
+    var vShader = vShaderDB[vSource];
+    if (!vShader) {
+      vShader = wtu.loadShader(gl, vSource, gl.VERTEX_SHADER);
+      if (info.vShaderTest) {
+        if (!info.vShaderTest(vShader)) {
+          testFailed(passMsg);
+          continue;
+        }
+      }
+      if ((vShader != null) != info.vShaderSuccess) {
         testFailed(passMsg);
         continue;
       }
+      // Save the shaders so we test shared shader.
+      if (vShader) {
+        vShaderDB[vSource] = vShader;
+      }
     }
-    if ((vShader != null) != info.vShaderSuccess) {
-      testFailed(passMsg);
-      continue;
-    }
+
     var fSource = info.fShaderPrep ? info.fShaderPrep(info.fShaderSource) :
       info.fShaderSource;
-    var fShader = wtu.loadShader(gl, fSource, gl.FRAGMENT_SHADER);
-    if (info.fShaderTest) {
-      if (!info.fShaderTest(fShader)) {
+
+    // Reuse identical shaders so we test shared shader.
+    var fShader = fShaderDB[fSource];
+    if (!fShader) {
+      fShader = wtu.loadShader(gl, fSource, gl.FRAGMENT_SHADER);
+      if (info.fShaderTest) {
+        if (!info.fShaderTest(fShader)) {
+          testFailed(passMsg);
+          continue;
+        }
+      }
+      //debug(fShader == null ? "fail" : "succeed");
+      if ((fShader != null) != info.fShaderSuccess) {
         testFailed(passMsg);
         continue;
       }
-    }
-    //debug(fShader == null ? "fail" : "succeed");
-    if ((fShader != null) != info.fShaderSuccess) {
-      testFailed(passMsg);
-      continue;
+      // Safe the shaders so we test shared shader.
+      if (fShader) {
+        fShaderDB[fSource] = fShader;
+      }
     }
 
     if (vShader && fShader) {
       var program = gl.createProgram();
       gl.attachShader(program, vShader);
       gl.attachShader(program, fShader);
       gl.linkProgram(program);
       var linked = (gl.getProgramParameter(program, gl.LINK_STATUS) != 0);
@@ -710,13 +938,10 @@ if (!gl) {
 }
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
new file mode 100644
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/glsl-features.html
@@ -0,0 +1,234 @@
+<!--
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file.
+
+Note: To use this sample pass arguments through the URL.
+
+Arguments:
+  feature:  name of the feature being testing
+
+  res:      number of subdivisions in quad. default: 2
+
+  refvs:    relative url to reference vertex shader
+            default shaders/glsl-features/base.vert
+
+  reffs:    relative url to reference fragment shader
+            default shaders/glsl-features/base.frag
+
+  testvs:   relative url to test vertex shader
+            default shaders/glsl-features/base.vert
+
+  testfs:   relative url to test fragment shader
+            default shaders/glsl-features/base.frag
+
+Example:
+glsl-feature.html?feature=abs&refvs=shader/abs-ref.vert&testvs=shader/abs-test.vert
+
+The idea is to provide 2 shaders that should generate the same image. One shader
+uses the actual feature you want to test. Another emluates that feature to
+provide a reference image.
+
+For example, a test of abs would use "abs" in the test and "v < 0 ? -v : v" in
+the reference.
+
+Both shaders are passed a unit square that covers the entire canvas and 
+texcoords that go from 0.0 to 1.0 over the canvas. A vColor value is also passed
+from the vertex shader to the fragment shader to give the vertex shader
+a chance to generate something.
+ -->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+  <title>GLSL feature Test</title>
+  <link rel="stylesheet" href="../resources/js-test-style.css"/>
+  <script src="../resources/js-test-pre.js"></script>
+  <script src="resources/webgl-test.js"> </script>
+  <script src="resources/webgl-test-utils.js"> </script>
+  <style>
+canvas {
+  background-color: white;
+  background-image: linear-gradient(0, rgba(200, 200, 200, .5) 50%, transparent 50%), linear-gradient(rgba(200, 200, 200, .5) 50%, transparent 50%);
+  background-size: 8px 8px;
+}
+  </style>
+</head>
+<body>
+<table>
+<tr><td>ref</td><td>test</td><td>diff</td></tr>
+<tr>
+<td><canvas id="canvas1" width="32" height="32"></canvas></td>
+<td><canvas id="canvas2" width="32" height="32"></canvas></td>
+<td><canvas id="diff" width="32" height="32"></canvas></td>
+</tr>
+</table>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+function init()
+{
+  if (window.initNonKhronosFramework) {
+    window.initNonKhronosFramework(false);
+  }
+
+  wtu = WebGLTestUtils;
+  var args = wtu.getUrlArguments();
+  var feature = args.feature || "**unset**";
+  var refVS = args.refvs || "shaders/glsl-features/base.vert";
+  var refFS = args.reffs || "shaders/glsl-features/base.frag";
+  var testVS = args.testvs || "shaders/glsl-features/base.vert";
+  var testFS = args.testfs || "shaders/glsl-features/base.frag";
+  var gridRes = args.res ? parseInt(args.res) : 2;
+
+  description("Testing GLSL feature: " + feature);
+  debug("");
+  debug("using reference shaders:");
+  debug("  " + makeLink(refVS));
+  debug("  " + makeLink(refFS));
+  debug("");
+  debug("using test shaders:");
+  debug("  " + makeLink(testVS));
+  debug("  " + makeLink(testFS));
+  debug("");
+
+  function makeLink(url) {
+    return '<a target="_blank" href="' + url + '">' + url + '</a>';
+  }
+
+  var canvas1 = document.getElementById("canvas1");
+  var canvas2 = document.getElementById("canvas2");
+  var diff = document.getElementById("diff");
+
+  var width = canvas1.width;
+  var height = canvas1.height;
+
+  function draw(canvas, vsURL, fsURL) {
+    var gl = wtu.create3DContext(canvas);
+    if (!gl) {
+      testFailed("context does not exist");
+      return;
+    }
+
+    var program = wtu.loadProgramFromFile(gl, vsURL, fsURL);
+
+    var posLoc = gl.getAttribLocation(program, "aPosition");
+    var refLoc = gl.getAttribLocation(program, "aTexcoord");
+    setupQuad(gl, posLoc, refLoc);
+
+    gl.useProgram(program);
+    gl.clearColor(0, 0, 1, 1);
+    gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+    gl.drawElements(gl.TRIANGLES, gridRes * gridRes * 6, gl.UNSIGNED_SHORT, 0);
+    wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors from draw");
+
+    var img = new Uint8Array(width * height * 4);
+    gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, img);
+    return img;
+  }
+
+  function setupQuad(gl, positionLocation, texcoordLocation) {
+    var objects = [];
+
+    var vertsAcross = gridRes + 1;
+    var numVerts = vertsAcross * vertsAcross;
+    var positions = new Float32Array(numVerts * 3);
+    var texcoords = new Float32Array(numVerts * 2);
+    var indices = new Uint16Array(6 * gridRes * gridRes);
+
+    var poffset = 0;
+    var toffset = 0;
+
+    for (var yy = 0; yy <= gridRes; ++yy) {
+      for (var xx = 0; xx <= gridRes; ++xx) {
+        positions[poffset + 0] = -1 + 2 * xx / gridRes;
+        positions[poffset + 1] = -1 + 2 * yy / gridRes;
+        positions[poffset + 2] = 0;
+
+        texcoords[toffset + 0] = xx / gridRes;
+        texcoords[toffset + 1] = yy / gridRes;
+
+        poffset += 3;
+        toffset += 2;
+      }
+    }
+
+    var tbase = 0;
+    for (var yy = 0; yy < gridRes; ++yy) {
+      var index = yy * vertsAcross;
+      for (var xx = 0; xx < gridRes; ++xx) {
+        indices[tbase + 0] = index + 0;
+        indices[tbase + 1] = index + 1;
+        indices[tbase + 2] = index + vertsAcross;
+        indices[tbase + 3] = index + vertsAcross;
+        indices[tbase + 4] = index + 1;
+        indices[tbase + 5] = index + vertsAcross + 1;
+
+        index += 1;
+        tbase += 6;
+      }
+    }
+
+    var buf = gl.createBuffer();
+    gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+    gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);
+    gl.enableVertexAttribArray(positionLocation);
+    gl.vertexAttribPointer(positionLocation, 3, gl.FLOAT, false, 0, 0);
+    objects.push(buf);
+  
+    var buf = gl.createBuffer();
+    gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+    gl.bufferData(gl.ARRAY_BUFFER, texcoords, gl.STATIC_DRAW);
+    gl.enableVertexAttribArray(texcoordLocation);
+    gl.vertexAttribPointer(texcoordLocation, 2, gl.FLOAT, false, 0, 0);
+    objects.push(buf);
+
+    var buf = gl.createBuffer();
+    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buf);
+    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);
+    objects.push(buf);
+
+    return objects;
+  }
+
+  var refImage = draw(canvas1, refVS, refFS);
+  var testImage = draw(canvas2, testVS, testFS);
+
+  var ctx = diff.getContext("2d");
+  var imgData = ctx.getImageData(0, 0, width, height);
+
+  var same = true;
+  for (var yy = 0; yy < height; ++yy) {
+    for (var xx = 0; xx < width; ++xx) {
+      var offset = (yy * width + xx) * 4;
+      var imgOffset = ((height - yy - 1) * width + xx) * 4;
+      imgData.data[imgOffset + 0] = 0;
+      imgData.data[imgOffset + 1] = 0;
+      imgData.data[imgOffset + 2] = 0;
+      imgData.data[imgOffset + 3] = 255;
+      if (refImage[offset + 0] != testImage[offset + 0] ||
+          refImage[offset + 1] != testImage[offset + 1] ||
+          refImage[offset + 2] != testImage[offset + 2] ||
+          refImage[offset + 3] != testImage[offset + 3]) {
+        imgData.data[imgOffset] = 255;
+        same = false;
+      }
+    }
+  }
+
+  if (!same) {
+    ctx.putImageData(imgData, 0, 0);
+    testFailed("images are different");
+  } else {
+    testPassed("images are the same");
+  }
+}
+
+init();
+successfullyParsed = true;
+</script>
+<script src="../resources/js-test-post.js"></script>
+
+</body>
+</html>
+
new file mode 100644
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/glsl-long-variable-names.html
@@ -0,0 +1,130 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>glsl long variable name mapping tests</title>
+    <link rel="stylesheet" href="../resources/js-test-style.css"/>
+    <script src="../resources/js-test-pre.js"></script>
+    <script src="resources/webgl-test.js"> </script>
+</head>
+<body>
+    <canvas id="example" width="50" height="50">
+    There is supposed to be an example drawing here, but it's not important.
+    </canvas>
+    <div id="description">Verify that shader long variable names works fine if they are within 256 characters.</div>
+    <div id="console"></div>
+    <script id="vshader" type="x-shader/x-vertex">
+        attribute vec4 vPosition0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456;
+        varying float alpha01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890;
+        void main()
+        {
+            alpha01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 = 1.0;
+            gl_Position = vPosition0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456;
+        }
+    </script>
+
+    <script id="fshader" type="x-shader/x-fragment">
+        precision mediump float;
+        varying float alpha01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890;
+        uniform float color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[3];
+        void main()
+        {
+            for (int i012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234 = 0; i012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234 < 1; ++i012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234)
+            {
+                gl_FragColor = vec4(color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[0], color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[1], color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[2], alpha01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890);
+            }
+        }
+    </script>
+
+    <script>
+        function fail(x,y, buf, shouldBe)
+        {
+            var i = (y*50+x) * 4;
+            var reason = "pixel at ("+x+","+y+") is ("+buf[i]+","+buf[i+1]+","+buf[i+2]+","+buf[i+3]+"), should be "+shouldBe;
+            testFailed(reason);
+        }
+
+        function pass()
+        {
+            testPassed("drawing is correct");
+        }
+
+        if (window.initNonKhronosFramework) {
+            window.initNonKhronosFramework(false);
+        }
+
+        gl = initWebGL("example", "vshader", "fshader", [ "vPosition0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456"], [ 0, 0, 0, 1 ], 1);
+
+        var prog = gl.getParameter(gl.CURRENT_PROGRAM);
+        shouldBeNonNull(prog);
+        var redLoc = gl.getUniformLocation(prog, "color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[0]");
+        shouldBeNonNull(redLoc);
+        var greenLoc = gl.getUniformLocation(prog, "color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[1]");
+        shouldBeNonNull(greenLoc);
+        var blueLoc = gl.getUniformLocation(prog, "color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[2]");
+        shouldBeNonNull(blueLoc);
+
+        shouldBe("gl.getProgramParameter(prog, gl.ACTIVE_ATTRIBUTES)", "1");
+        var activeAttrib = gl.getActiveAttrib(prog, 0);
+        shouldBeNonNull(activeAttrib);
+        shouldBe("activeAttrib.size", "1");
+        shouldBe("activeAttrib.type", "gl.FLOAT_VEC4");
+        shouldBe("activeAttrib.name", "'vPosition0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456'");
+
+        shouldBe("gl.getProgramParameter(prog, gl.ACTIVE_UNIFORMS)", "1");
+        var activeUniform = gl.getActiveUniform(prog, 0);
+        shouldBeNonNull(activeUniform);
+        shouldBe("activeUniform.size", "3");
+        shouldBe("activeUniform.type", "gl.FLOAT");
+        shouldBe("activeUniform.name", "'color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[0]'");
+
+        gl.uniform1f(redLoc, 1.0); 
+        gl.uniform1f(greenLoc, 0.0);
+        gl.uniform1f(blueLoc, 1.0);
+
+        var vertexObject = gl.createBuffer();
+        gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+        gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0.5,0, -0.5,-0.5,0, 0.5,-0.5,0 ]), gl.STATIC_DRAW);
+        gl.enableVertexAttribArray(0);
+        gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+        gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+        gl.drawArrays(gl.TRIANGLES, 0, 3);
+
+        var buf = new Uint8Array(50 * 50 * 4);
+        gl.readPixels(0, 0, 50, 50, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+        shouldBe("gl.getError()", "gl.NO_ERROR");
+
+        function checkPixels()
+        {
+            // Test several locations
+            // First line should be all black
+            for (var i = 0; i < 50; ++i)
+                if (buf[i*4] != 0 || buf[i*4+1] != 0 || buf[i*4+2] != 0 || buf[i*4+3] != 255) {
+                    fail(i, 0, buf, "(0,0,0,255)");
+                    return;
+                }
+
+            // Line 15 should be red for at least 10 red pixels starting 20 pixels in
+            var offset = (15*50+20) * 4;
+            for (var i = 0; i < 10; ++i)
+                if (buf[offset+i*4] != 255 || buf[offset+i*4+1] != 0 || buf[offset+i*4+2] != 255 || buf[offset+i*4+3] != 255) {
+                    fail(20 + i, 15, buf, "(255,0,255,255)");
+                    return;
+                }
+            // Last line should be all black
+            offset = (49*50) * 4;
+            for (var i = 0; i < 50; ++i)
+                if (buf[offset+i*4] != 0 || buf[offset+i*4+1] != 0 || buf[offset+i*4+2] != 0 || buf[offset+i*4+3] != 255) {
+                    fail(i, 49, buf, "(0,0,0,255)");
+                    return;
+                }
+
+            pass();
+        }
+        checkPixels();
+        successfullyParsed = true;
+    </script>
+    <script src="../resources/js-test-post.js"></script>
+</body>
+</html>
--- a/content/canvas/test/webgl/conformance/incorrect-context-object-behaviour.html
+++ b/content/canvas/test/webgl/conformance/incorrect-context-object-behaviour.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (C) 2009 Apple Computer, Inc.  All rights reserved.
+Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
@@ -17,18 +17,20 @@ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHA
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
--- a/content/canvas/test/webgl/conformance/index-validation-copies-indices.html
+++ b/content/canvas/test/webgl/conformance/index-validation-copies-indices.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
 met:
 
    * Redistributions of source code must retain the above copyright
 notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above
@@ -22,18 +22,20 @@ A PARTICULAR PURPOSE ARE DISCLAIMED. IN 
 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
--- a/content/canvas/test/webgl/conformance/index-validation-crash-with-buffer-sub-data.html
+++ b/content/canvas/test/webgl/conformance/index-validation-crash-with-buffer-sub-data.html
@@ -1,15 +1,17 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
--- a/content/canvas/test/webgl/conformance/index-validation-verifies-too-many-indices.html
+++ b/content/canvas/test/webgl/conformance/index-validation-verifies-too-many-indices.html
@@ -1,15 +1,17 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
--- a/content/canvas/test/webgl/conformance/index-validation-with-resized-buffer.html
+++ b/content/canvas/test/webgl/conformance/index-validation-with-resized-buffer.html
@@ -1,15 +1,17 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <canvas id="example" width="1px" height="1px"></canvas>
 <div id="description"></div>
 <div id="console"></div>
@@ -19,19 +21,17 @@ attribute vec4 vPosition;
 attribute vec4 vColor;
 varying vec4 color;
 void main() {
     gl_Position = vPosition;
     color = vColor;
 }
 </script>
 <script id="fs" type="x-shader/x-fragment">
-#if defined(GL_ES)
 precision mediump float;
-#endif
 varying vec4 color;
 void main() {
   gl_FragColor = color;
 }
 </script>
 <script>
 description('Test that updating the size of a vertex buffer is properly noticed by the WebGL implementation.')
 
--- a/content/canvas/test/webgl/conformance/index-validation.html
+++ b/content/canvas/test/webgl/conformance/index-validation.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
 met:
 
    * Redistributions of source code must retain the above copyright
 notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above
@@ -22,18 +22,20 @@ A PARTICULAR PURPOSE ARE DISCLAIMED. IN 
 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
--- a/content/canvas/test/webgl/conformance/instanceof-test.html
+++ b/content/canvas/test/webgl/conformance/instanceof-test.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL instanceof test.</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="canvas" width="2" height="2" style="width: 40px; height: 40px;"></canvas>
@@ -22,19 +22,17 @@ attribute vec4 vPosition;
 varying vec2 texCoord;
 void main()
 {
     gl_Position = vPosition;
 }
 </script>
 
 <script id="fshader" type="x-shader/x-fragment">
-#ifdef GL_ES
 precision mediump float;
-#endif
 uniform vec4 color;
 void main()
 {
     gl_FragColor = color;
 }
 </script>
 <script>
 var wtu = WebGLTestUtils;
@@ -80,18 +78,14 @@ shouldThrowWithNew(WebGLFramebuffer, 'We
 shouldThrowWithNew(WebGLProgram, 'WebGLProgram');
 shouldThrowWithNew(WebGLRenderbuffer, 'WebGLRenderbuffer');
 shouldThrowWithNew(WebGLShader, 'WebGLShader');
 shouldThrowWithNew(WebGLTexture, 'WebGLTexture');
 shouldThrowWithNew(WebGLUniformLocation, 'WebGLUniformLocation');
 
 successfullyParsed = true;
 </script>
-</body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
 
--- a/content/canvas/test/webgl/conformance/invalid-UTF-16.html
+++ b/content/canvas/test/webgl/conformance/invalid-UTF-16.html
@@ -1,15 +1,17 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css">
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <p id="description"></p>
 <div id="console"></div>
 <script>
--- a/content/canvas/test/webgl/conformance/invalid-passed-params.html
+++ b/content/canvas/test/webgl/conformance/invalid-passed-params.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (C) 2009 Apple Computer, Inc.  All rights reserved.
+Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
@@ -17,18 +17,20 @@ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHA
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script src="../resources/desktop-gl-constants.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
@@ -120,17 +122,17 @@ function generateShaderSource(opt_invali
                           + "gl_Position = vec4(0.0, 0.0, 0.0, 1.0); }\n";
                           + "//.+-/*%<>[](){}^|&~=!:;,?# " + invalidCommentString;
 }
 var vShader = context.createShader(context.VERTEX_SHADER);
 context.shaderSource(vShader, generateShaderSource());
 context.compileShader(vShader);
 shouldBe("context.getError()", "context.NO_ERROR");
 var fShader = context.createShader(context.FRAGMENT_SHADER);
-context.shaderSource(fShader, "precision highp float;\n"
+context.shaderSource(fShader, "precision mediump float;\n"
                               + "varying float " + validAttribName + ";\n"
                               + "void main() {\n"
                               + "gl_FragColor = vec4(" + validAttribName + ", 0.0, 0.0, 1.0); }");
 context.compileShader(fShader);
 shouldBe("context.getError()", "context.NO_ERROR");
 var program = context.createProgram();
 context.attachShader(program, vShader);
 context.attachShader(program, fShader);
--- a/content/canvas/test/webgl/conformance/is-object.html
+++ b/content/canvas/test/webgl/conformance/is-object.html
@@ -1,10 +1,12 @@
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script src="resources/webgl-test-utils.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
--- a/content/canvas/test/webgl/conformance/methods.html
+++ b/content/canvas/test/webgl/conformance/methods.html
@@ -1,16 +1,17 @@
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <!--
-Copyright (c) 2009 Ilmari Heikkinen. All rights reserved.
+Copyright (c) 2011 Ilmari Heikkinen. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
 -->
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <title>WebGL Methods Test</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
@@ -189,13 +190,11 @@ for (var i in gl) {
     debug(i);
   }
 }
 
 debug("");
 successfullyParsed = true;
 </script>
 <script src="../resources/js-test-post.js"></script>
-<script>
-</script>
 
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/more-than-65536-points.html
+++ b/content/canvas/test/webgl/conformance/more-than-65536-points.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL More than 65536 points.</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="example" width="40" height="40" style="width: 40px; height: 40px;"></canvas>
@@ -22,19 +22,17 @@ attribute vec4 vPosition;
 attribute vec4 vColor;
 varying vec4 color;
 void main() {
     gl_Position = vPosition;
     color = vColor;
 }
 </script>
 <script id="fs" type="text/something-not-javascript">
-#if defined(GL_ES)
 precision mediump float;
-#endif
 varying vec4 color;
 void main() {
     gl_FragColor = color;
 }
 </script>
 <script>
 var wtu = WebGLTestUtils;
 var gl = initWebGL("example", "vs", "fs", ["vPosition", "vColor"], [0, 0, 0, 1], 1);
--- a/content/canvas/test/webgl/conformance/more/00_test_list.txt
+++ b/content/canvas/test/webgl/conformance/more/00_test_list.txt
@@ -1,11 +1,14 @@
 conformance/constants.html
 conformance/getContext.html
 conformance/methods.html
+#this test causes whichever comes after to intermittently time out.
+#forcing a GC run doesn't solve this issue. Could be something about using a random amount of memory that
+#can be too high, causing e.g. swapping.
 #conformance/quickCheckAPI.html
 conformance/webGLArrays.html
 functions/bindBuffer.html
 functions/bindBufferBadArgs.html
 functions/bindFramebufferLeaveNonZero.html
 functions/bufferData.html
 functions/bufferDataBadArgs.html
 functions/bufferSubData.html
--- a/content/canvas/test/webgl/conformance/more/all_tests.html
+++ b/content/canvas/test/webgl/conformance/more/all_tests.html
@@ -1,14 +1,15 @@
 <html>
 <head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
--- a/content/canvas/test/webgl/conformance/more/all_tests_linkonly.html
+++ b/content/canvas/test/webgl/conformance/more/all_tests_linkonly.html
@@ -1,14 +1,15 @@
 <html>
 <head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
--- a/content/canvas/test/webgl/conformance/more/all_tests_sequential.html
+++ b/content/canvas/test/webgl/conformance/more/all_tests_sequential.html
@@ -1,14 +1,15 @@
 <html>
 <head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
--- a/content/canvas/test/webgl/conformance/more/conformance/badArgsArityLessThanArgc.html
+++ b/content/canvas/test/webgl/conformance/more/conformance/badArgsArityLessThanArgc.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -23,17 +24,16 @@ OF MERCHANTABILITY, FITNESS FOR A PARTIC
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 /*
   The following tests are generated from
   http://www.khronos.org/registry/gles/api/2.0/gl2.h
--- a/content/canvas/test/webgl/conformance/more/conformance/constants.html
+++ b/content/canvas/test/webgl/conformance/more/conformance/constants.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -23,17 +24,16 @@ OF MERCHANTABILITY, FITNESS FOR A PARTIC
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 /*
   The following tests are generated from
   http://www.khronos.org/registry/gles/api/2.0/gl2.h
--- a/content/canvas/test/webgl/conformance/more/conformance/fuzzTheAPI.html
+++ b/content/canvas/test/webgl/conformance/more/conformance/fuzzTheAPI.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 
 <script type="application/x-javascript">
 
 Tests.autorun = false;
 Tests.message = "This will fuzz the API with random inputs for a [long] while."
--- a/content/canvas/test/webgl/conformance/more/conformance/getContext.html
+++ b/content/canvas/test/webgl/conformance/more/conformance/getContext.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 
 <script type="application/x-javascript">
 
 Tests.testGetWebGL = function() {
   var canvas = document.getElementById('webgl');
--- a/content/canvas/test/webgl/conformance/more/conformance/methods.html
+++ b/content/canvas/test/webgl/conformance/more/conformance/methods.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -23,17 +24,16 @@ OF MERCHANTABILITY, FITNESS FOR A PARTIC
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 /*
   The following tests are generated from
   http://www.khronos.org/registry/gles/api/2.0/gl2.h
--- a/content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI.html
+++ b/content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript" src="quickCheckAPI.js"></script>
 
 <script type="application/x-javascript">
 
 // Test that all GL functions specified in ArgGenerators work
--- a/content/canvas/test/webgl/conformance/more/conformance/quickCheckAPIBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/conformance/quickCheckAPIBadArgs.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript" src="quickCheckAPI.js"></script>
 
 <script type="application/x-javascript">
 
 // Test that all GL functions specified in ArgGenerators fail
--- a/content/canvas/test/webgl/conformance/more/conformance/webGLArrays.html
+++ b/content/canvas/test/webgl/conformance/more/conformance/webGLArrays.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 
 <script type="application/x-javascript">
 
 function assertIdxs(name, arr, length) {
 //   assertOk(name+": Read with negative idx should work", function(){ return arr[-1] });
@@ -140,19 +140,18 @@ Tests.testThatWritesChangeDrawing = func
 <script id="vert" type="x-shader/x-vertex">
   attribute vec2 Vertex;
   void main()
   {
     gl_Position = vec4(Vertex, 0.0, 1.0);
   }
 </script>
 <script id="frag" type="x-shader/x-fragment">
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   uniform vec4 c;
   void main()
   {
     gl_FragColor = c;
   }
 </script>
 <style>canvas{border: 1px solid black}</style>
 </head><body>
--- a/content/canvas/test/webgl/conformance/more/demos/opengl_web.html
+++ b/content/canvas/test/webgl/conformance/more/demos/opengl_web.html
@@ -1,13 +1,13 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 
 <title>OpenGL for the web</title>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 
 <script type="application/x-javascript" src="../util.js"></script>
 
     <script type="application/x-javascript">
 
 function log(msg) {
   document.getElementById('note').textContent += "\n"+msg;
 }
@@ -244,19 +244,18 @@ window.addEventListener("load", init, fa
         ambient = MaterialAmbient * LightAmbient;
         ambientGlobal = GlobalAmbient * MaterialAmbient;
 
         gl_Position = PMatrix * worldPos;
       }
     </script>
 
     <script id="ppix-frag" type="x-shader/x-fragment">
-      #ifdef GL_ES
-precision highp float;
-#endif
+      precision mediump float;
+
       uniform vec4 LightSpecular;
       uniform vec4 MaterialSpecular;
       uniform float MaterialShininess;
 
       uniform float LightConstantAtt;
       uniform float LightLinearAtt;
       uniform float LightQuadraticAtt;
 
@@ -297,19 +296,18 @@ precision highp float;
       varying float depth;
       void main()
       {
         gl_Position = PMatrix * (MVMatrix * vec4(Vertex, 1.0));
         depth = 1.0-(gl_Position.z / gl_Position.w);
       }
     </script>
     <script id="depth-frag" type="x-shader/x-fragment">
-      #ifdef GL_ES
-precision highp float;
-#endif
+      precision mediump float;
+
       varying float depth;
       void main()
       {
         vec4 c = vec4(depth, 0.0, 0.0, 1.0);
         gl_FragColor = c;
       }
     </script>
 
@@ -320,65 +318,61 @@ precision highp float;
       varying vec4 texCoord0;
       void main()
       {
         texCoord0 = vec4(Tex,0.0,0.0);
         gl_Position = vec4(Vertex, 1.0);
       }
     </script>
     <script id="identity-frag" type="x-shader/x-fragment">
-      #ifdef GL_ES
-precision highp float;
-#endif
+      precision mediump float;
+
       uniform sampler2D Texture;
 
       varying vec4 texCoord0;
       void main()
       {
         vec4 c = texture2D(Texture, texCoord0.st);
         gl_FragColor = c;
       }
     </script>
     <script id="premult-frag" type="x-shader/x-fragment">
-      #ifdef GL_ES
-precision highp float;
-#endif
+      precision mediump float;
+
       uniform sampler2D Texture;
 
       varying vec4 texCoord0;
       void main()
       {
         vec4 c = texture2D(Texture, texCoord0.st);
         float a = c.a;
         c *= a;
         c.a = a;
         gl_FragColor = c;
       }
     </script>
     <script id="unpremult-frag" type="x-shader/x-fragment">
-      #ifdef GL_ES
-precision highp float;
-#endif
+      precision mediump float;
+
       uniform sampler2D Texture;
 
       varying vec4 texCoord0;
       void main()
       {
         vec4 c = texture2D(Texture, texCoord0.st);
         float a = c.a;
         c /= a;
         c.a = a;
         gl_FragColor = c;
       }
     </script>
 
     <script id="hblur-frag" type="x-shader/x-fragment">
-      #ifdef GL_ES
-precision highp float;
-#endif
+      precision mediump float;
+
       uniform sampler2D Texture;
       uniform float step;
       float kernel[7] = float[](0.046, 0.111, 0.202, 0.283, 0.202, 0.111, 0.046);
 
       varying vec4 texCoord0;
       void main()
       {
         int i=0;
@@ -390,19 +384,18 @@ precision highp float;
           }
           gl_FragColor = sum;
         } else {
           gl_FragColor = texture2D(Texture, texCoord0.st);
         }
       }
     </script>
     <script id="vblur-frag" type="x-shader/x-fragment">
-      #ifdef GL_ES
-precision highp float;
-#endif
+      precision mediump float;
+
       uniform sampler2D Texture;
       uniform float step;
       float kernel[7] = float[](0.046, 0.111, 0.202, 0.283, 0.202, 0.111, 0.046);
 
       varying vec4 texCoord0;
       void main()
       {
         int i=0;
@@ -414,19 +407,18 @@ precision highp float;
           }
           gl_FragColor = sum;
         } else {
           gl_FragColor = texture2D(Texture, texCoord0.st);
         }
       }
     </script>
     <script id="hdof-frag" type="x-shader/x-fragment">
-      #ifdef GL_ES
-precision highp float;
-#endif
+      precision mediump float;
+
       uniform sampler2D Texture;
       uniform sampler2D Depth;
       uniform float step;
       uniform float iter;
       float kernel[7] = { 0.046, 0.111, 0.202, 0.283, 0.202, 0.111, 0.046 };
 
       varying vec4 texCoord0;
       void main()
@@ -447,19 +439,18 @@ precision highp float;
         tmp = texture2D(Texture, texCoord0.st + vec2(float(5-3)*step,0));
         sum += tmp * kernel[5];
         tmp = texture2D(Texture, texCoord0.st + vec2(float(6-3)*step,0));
         sum += tmp * kernel[6];
         gl_FragColor = mix(texture2D(Texture, texCoord0.st), sum, b ? 1.0 : 0.0);
       }
     </script>
     <script id="vdof-frag" type="x-shader/x-fragment">
-      #ifdef GL_ES
-precision highp float;
-#endif
+      precision mediump float;
+
       uniform sampler2D Texture;
       uniform sampler2D Depth;
       uniform float step;
       uniform float iter;
       float kernel[7] = float[7](0.046, 0.111, 0.202, 0.283, 0.202, 0.111, 0.046);
 
       varying vec4 texCoord0;
       void main()
@@ -581,9 +572,9 @@ that it doesn't make policy decisions. T
 use case for it: In addition to 3D graphics, you can also use it for
 filtering images, visualizing fluid dynamics, doing real-time video
 effects, or just crunching a whole lot of FP math. If you can do it on
 the GPU, you're in luck! </p>
     </div>
     <div id="above">
       <p>You can also place content above the canvas</p>
     </div>
-  </body></html>
\ No newline at end of file
+  </body></html>
--- a/content/canvas/test/webgl/conformance/more/demos/video.html
+++ b/content/canvas/test/webgl/conformance/more/demos/video.html
@@ -1,10 +1,11 @@
 <html>
 <head>
+<meta charset="utf-8">
 <script type="application/x-javascript" src="../util.js"></script>
 <script>
 var processor = {
   lastTime : new Date,
   timerCallback: function() {
     if (this.video.paused || this.video.ended) {
       return;
     }
@@ -67,19 +68,18 @@ var processor = {
     varying vec4 texCoord0;
     void main()
     {
         texCoord0 = vec4(Tex.s,1.0-Tex.t,0.0,0.0);
         gl_Position = vec4(Vertex, 1.0);
     }
 </script>
 <script id="greenScreen" type="x-shader/x-fragment">
-    #ifdef GL_ES
-precision highp float;
-#endif
+    precision mediump float;
+
     uniform sampler2D Texture;
     uniform sampler2D Texture2;
 
     varying vec4 texCoord0;
     void main()
     {
         vec4 c = texture2D(Texture, texCoord0.st);
         float r = c.r * 0.5;
--- a/content/canvas/test/webgl/conformance/more/functions/bindBuffer.html
+++ b/content/canvas/test/webgl/conformance/more/functions/bindBuffer.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
--- a/content/canvas/test/webgl/conformance/more/functions/bindBufferBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/functions/bindBufferBadArgs.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
--- a/content/canvas/test/webgl/conformance/more/functions/bindFramebufferLeaveNonZero.html
+++ b/content/canvas/test/webgl/conformance/more/functions/bindFramebufferLeaveNonZero.html
@@ -1,12 +1,12 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <title>OpenGL for the web</title>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 
 <script type="application/x-javascript" src="../util.js"></script>
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 
     <script type="application/x-javascript">
 Tests.message = "This was segfaulting when the GL context got GC'd (in glXDestroyContext)";
 Tests.testSeg = function () {
--- a/content/canvas/test/webgl/conformance/more/functions/bufferData.html
+++ b/content/canvas/test/webgl/conformance/more/functions/bufferData.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
--- a/content/canvas/test/webgl/conformance/more/functions/bufferDataBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/functions/bufferDataBadArgs.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
--- a/content/canvas/test/webgl/conformance/more/functions/bufferSubData.html
+++ b/content/canvas/test/webgl/conformance/more/functions/bufferSubData.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
     var canvas = document.getElementById('gl');
     var gl = canvas.getContext(GL_CONTEXT_ID);
--- a/content/canvas/test/webgl/conformance/more/functions/bufferSubDataBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/functions/bufferSubDataBadArgs.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
     var canvas = document.getElementById('gl');
     var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
--- a/content/canvas/test/webgl/conformance/more/functions/copyTexImage2D.html
+++ b/content/canvas/test/webgl/conformance/more/functions/copyTexImage2D.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
@@ -108,19 +108,18 @@ attribute vec2 Tex;
 varying vec4 texCoord0;
 void main()
 {
     texCoord0 = vec4(Tex.s, 1.0-Tex.t, 0.0, 0.0);
     gl_Position = vec4(Vertex, 1.0);
 }
 </script>
 <script id="identity-frag" type="x-shader/x-fragment">
-#ifdef GL_ES
-precision highp float;
-#endif
+precision mediump float;
+
 uniform sampler2D Texture;
 
 varying vec4 texCoord0;
 void main()
 {
     vec4 c = texture2D(Texture, texCoord0.st);
     gl_FragColor = c;
 }
--- a/content/canvas/test/webgl/conformance/more/functions/copyTexImage2DBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/functions/copyTexImage2DBadArgs.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
     var canvas = document.getElementById('gl');
     var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
--- a/content/canvas/test/webgl/conformance/more/functions/copyTexSubImage2D.html
+++ b/content/canvas/test/webgl/conformance/more/functions/copyTexSubImage2D.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01