Closed Bug 1386865 Opened 3 years ago Closed 3 years ago
Tools test using XBL triggers "MOZ _ASSERT _UNREACHABLE: We should be able to map a raw rule to a rule"
59 bytes, text/x-review-board-request
59 bytes, text/x-review-board-request
DevTools test devtools/client/inspector/markup/test/browser_markup_anonymous_04.js triggers an assertion in Stylo debug builds: Assertion failure: false (MOZ_ASSERT_UNREACHABLE: We should be able to map a raw rule to a rule), at /home/worker/workspace/build/src/layout/inspector/inDOMUtils.cpp:286 : https://treeherder.mozilla.org/logviewer.html#?job_id=120109119&repo=try&lineNumber=3111
Priority: -- → P2
Hmmm, suspect it is some XBL rule which may not be covered by ServoStyleRuleMap.
(In reply to Xidorn Quan [:xidorn] UTC+10 from comment #1) > Hmmm, suspect it is some XBL rule which may not be covered by > ServoStyleRuleMap. Sounds likely, the test appears to involve <video> elements.
Had a look at bug 1290276, it seems XBL <stylesheet> uses a separate styleset. Maybe we don't have a separate document for accessing that styleset? Anyway, we need to get the proper ServoStyleSet in inDOMUtils::GetCSSStyleRules, so that we can create a ServoStyleRuleMap for it. TYLin, how can we get the styleset of XBL given an element it styles?
On servo side, we can call element's each_xbl_stylist(), which walks the given element's binding chain to the parent, and call the callback f for each stylist. This re-implmentes gecko's nsBindingManager::WalkRules(). If we need to call it on gecko side, I think we could replace nsXBLBinding::WalkRules()  by nsXBLBinding::GetServoStyleSet(), and do something to each of the elements stylesets.  http://searchfox.org/mozilla-central/rev/f0e4ae5f8c40ba742214e89aba3f554da0b89a33/servo/components/style/gecko/wrapper.rs#1142  http://searchfox.org/mozilla-central/rev/f0e4ae5f8c40ba742214e89aba3f554da0b89a33/dom/xbl/nsBindingManager.cpp#687
So the style rule we failed to map in this case is in toolkit/themes/shared/media/videocontrols.css, which is referenced from toolkit/content/widgets/videocontrols.xml, so it is indeed a rule from XBL binding.
Comment on attachment 8893236 [details] Bug 1386865 part 1 - Have GetServoStyleSet return non-const ServoStyleSet. https://reviewboard.mozilla.org/r/164278/#review169620 r=me assuming this is needed by part 2.
Attachment #8893236 - Flags: review?(tlin) → review+
Comment on attachment 8893237 [details] Bug 1386865 part 2 - Collect style rule maps for XBL bindings. https://reviewboard.mozilla.org/r/164280/#review169628 ::: layout/inspector/inDOMUtils.cpp:279 (Diff revision 1) > map->EnsureTable(); > > + // Collect style rule maps for bindings. > + nsTArray<ServoStyleRuleMap*> bindingMaps; How about we put `map` in `bindingMaps` so that below we can just look up `bindingMaps` instead of looking at `map` and `bindingMaps` separately.
Attachment #8893237 - Flags: review?(cam) → review+
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/7b89f778658e part 1 - Have GetServoStyleSet return non-const ServoStyleSet. r=TYLin https://hg.mozilla.org/integration/autoland/rev/28a61ac5f305 part 2 - Collect style rule maps for XBL bindings. r=heycam
Summary: Stylo: DevTools test triggers "MOZ_ASSERT_UNREACHABLE: We should be able to map a raw rule to a rule" → Stylo: DevTools test using XBL triggers "MOZ_ASSERT_UNREACHABLE: We should be able to map a raw rule to a rule"
https://hg.mozilla.org/projects/date/rev/7b89f778658ef54fc9e8aa2478aee1fd51432555 Bug 1386865 part 1 - Have GetServoStyleSet return non-const ServoStyleSet. r=TYLin https://hg.mozilla.org/projects/date/rev/28a61ac5f3056b32b107e2bb94858be345b09055 Bug 1386865 part 2 - Collect style rule maps for XBL bindings. r=heycam
You need to log in before you can comment on or make changes to this bug.