Closed Bug 436717 Opened 16 years ago Closed 15 years ago

Reading contentDocument.documentElement during onLocationChange forces Quirks Mode

Categories

(Core :: Layout, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: bugzilla, Unassigned)

References

Details

(Keywords: testcase)

Attachments

(4 files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; da; rv:1.9) Gecko/2008051206 Firefox/3.0 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; da; rv:1.9) Gecko/2008051206 Firefox/3.0 See StR Reproducible: Always Steps to Reproduce: 1. Open a website like this: <!DOCTYPE html> <style>body{font-size: 2em}</style> <body>Test<table><tr><td>Test</table></body> 2. In stall an extension which overlays this on browser.xul: <script type="application/javascript"> window.addEventListener("load", function () { document.getElementById("urlbar").addEventListener("ValueChange", function() { getBrowser().contentDocument.documentElement; }, true); }, false); </script> 3. View the same page as in step one. Actual Results: In step one two texts of equal size are displayed, but in step three the first text is bigger than the last. Expected Results: The two page displays should be the same.
Attached file Test extension (deleted) —
Attached file Test website (deleted) —
CC Dão because the bug was found in his addon "Dictionary Switcher"
Summary: Font size in tables ignored when extension uses contentDocument.documentElement → Reading contentDocument.documentElement in extension forces Quirks Mode
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
Product: Firefox → Core
QA Contact: general → general
Version: unspecified → Trunk
Attached patch workaround (deleted) — Splinter Review
This seems to fix it, it's basically putting back the setTimeout thing that was removed in bug 248612. See bug 248612, comment 12. We didn't really know why the setTimeout was there and whether it was still necessary. Apparently it is, because it caused this bug. This is happening because the ValueChange happens when the urlbar changes value: http://lxr.mozilla.org/seamonkey/source/toolkit/content/widgets/autocomplete.xml#271 and the url bar changes the value directly onlocationchange now (which the patch changes back to do it on a timeout). So this patch is just working around a behavior that seems like a bug to me. I guess a standalone testcase could be made that has an nsIWebProgress instance with a progress listener that tries to access document.documentElement onlocationchange. I haven't tested this patch with the automated tests yet. Not sure how serious this bug is for inclusion in FF3.01. Thanks for finding the regression range, Ria!
Mano, see comment 6, should we try and put the setTimeout hack back in for FF3.01?
Blocks: 248612
Note that the extension itself can workaround this the same way, by using the setTimeout hack.
(In reply to comment #6) > So this patch is just working around a behavior that seems like a bug to me. Agreed. I don't think we should add the timeout back but investigate the underlying bug. I guess adding a custom progress listener is more common than listening to ValueChange, so attachment 323347 [details] [diff] [review] wouldn't even help in most cases.
Keywords: regression
Summary: Reading contentDocument.documentElement in extension forces Quirks Mode → Reading contentDocument.documentElement during onLocationChange forces Quirks Mode
Attachment #323347 - Attachment description: patch → workaround
Flags: in-testsuite?
Attached file Test extension v2 (deleted) —
This extension uses nsIWebProgressListener
Keywords: testcase
Blocks: 443707
Component: General → Layout
QA Contact: general → layout
No longer blocks: 443707
Blocks: 443707
Looks like it was fixed a long time ago. I guess bug 450191 based on the time.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WORKSFORME
Flags: in-testsuite?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: