Closed Bug 1398619 Opened 7 years ago Closed 7 years ago

stylo: getPropertyValue broken with NS_ERROR_NOT_AVAILABLE after Bug 1389300

Categories

(Core :: CSS Parsing and Computation, defect, P2)

57 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox-esr52 --- unaffected
firefox55 --- unaffected
firefox56 --- unaffected
firefox57 --- fixed

People

(Reporter: yfdyh000, Assigned: xidorn)

References

Details

(Keywords: nightly-community, regression)

Attachments

(2 files)

STR:
1. Install the https://greasyfork.org/scripts/292-my-novel-reader with Tampermonkey or Violentmonkey.
2. Open the http://www.wutuxs.com/html/1/1052/826365.html, click the "阅读模式" at the bottom right corner of the page.
3. Scroll to the bottom of the page.


Actual results:
Failed to load next page, NS_ERROR_NOT_AVAILABLE: 826365.html:6151 at _font_size_text = _heading_style.getPropertyValue("font-size") || 0; when layout.css.servo.enabled=true.
Has Regression Range: --- → yes
Has STR: --- → yes
Xidorn, can you investigate this, and suggest a priority?
Flags: needinfo?(xidorn+moz)
Haven't tested, but from the code and regression bug (thanks for that!), I think this is because the document of the user script is using gecko backend as it runs in chrome, while it tries to get computed style from the content document, which triggers the condition added in bug 1389300 to return nullptr for computed style.

I'm not completely sure how addon's content script works, i.e. what document/window does it use. I suspect that we need to make them use stylo backend if the document they operate on uses stylo backend.

Will try to investigate further, so keep ni? for now.
And, if that is the case, it could affect all addons which use content script to read computed style from content page, so I think it should be at least P2.
Priority: -- → P2
Attached file testcase
So the problem here is that document created by DOMParser doesn't have backend set, and since it never has a container, we pick Gecko backend for it.
Flags: needinfo?(xidorn+moz)
Looks like we just need to have DOMParser inherit style backend as well, like what we've already been doing for XHR and DOMImplementation.
Assignee: nobody → xidorn+moz
Oh, actually we do (try to) inherit style backend in DOMParser as well, but there is a small bug :)
Comment on attachment 8906886 [details]
Bug 1398619 - Correctly inherit backend for document created by DOMParser, and add test for it.

https://reviewboard.mozilla.org/r/178622/#review183622

Doh! r=me
Attachment #8906886 - Flags: review?(bobbyholley) → review+
Pushed by xquan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9232bc78ae68
Correctly inherit backend for document created by DOMParser, and add test for it. r=bholley
https://hg.mozilla.org/mozilla-central/rev/9232bc78ae68
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.