Closed Bug 574260 Opened 10 years ago Closed 10 years ago

Remove last uses of contentWindow and contentDocument


(Firefox for Android Graveyard :: General, defect)

Not set


(Not tracked)



(Reporter: mfinkle, Assigned: mfinkle)



(1 file)

Attached patch patchSplinter Review
This patch removes any code that uses contentWindow or contentDocument, directly or indirectly:
* browser.contentDocument.title -> browser.contentTitle
* Remove the fake "contentDocument" property in browser binding
* Remove the XULDocument checks used to ensure the size of the document was set correctly. This should happen in content.js now
* Remove getContentScrollOffset and stub the uses to assume we are scrolled to top. This affected tabs loaded in the background. Layers will make this "just work" since we won't need to screw with the canvas.
* Remove getTabForDocument and the _metaData event handler that was using it. We use the Browser:ViewportMetadata message now.
* Removed getBrowserDOMWindowUtils since it is not needed anymore
* Removed getBrowserDimensions since it isn't used anymore
* Minor code cleanup:
    Browser._tabs -> Browser.tabs
    _sendSyncMessage -> _sendMessage (which is implemented using sendAsyncMessage!)

Left some XXX comments for places we could improve things or remove things later when Layers lands.
Attachment #453651 - Flags: review?(21)
Attachment #453651 - Flags: feedback?(mbrubeck)
Comment on attachment 453651 [details] [diff] [review]

>diff --git a/chrome/content/browser-ui.js b/chrome/content/browser-ui.js
>   updatePageSaveAs: function updatePageSaveAs() {
>     this.removeItems("saveas");
>-    if (Browser.selectedBrowser.contentDocument instanceof XULDocument)
>-      return;
>+    // XXX Not sure if we care about this
>+    //if (Browser.selectedBrowser.contentDocument instanceof XULDocument)
>+    //  return;

In fact some documents are not printable, and this check was to avoid showing the "Save page As" for xul documents. I have a potential plan once to move the output of the cairo surface as pdf out of the print code, I could look again at that.

>+      // XXX: We don't know the current scroll pstion of the content, so assume
>+      // it's at the top. This will be fixed by Layers
>+      this._tab.contentScrollOffset = new Point(0, 0);

little typo: position
Attachment #453651 - Flags: review?(21) → review+
Closed: 10 years ago
Resolution: --- → FIXED
Attachment #453651 - Flags: feedback?(mbrubeck) → feedback+
Assignee: nobody → mark.finkle
You need to log in before you can comment on or make changes to this bug.