Closed Bug 1408811 Opened 2 years ago Closed 2 years ago

stylo: XBL important rules are ignored


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




Tracking Status
firefox57 --- wontfix
firefox58 --- fixed


(Reporter: xidorn, Assigned: xidorn)




(3 files)

(Note that this is filed for annotating tests in the progress of bug 1407847. The test is not going to fail without patch there, because XUL is still using Gecko backend at the moment.)

The example can be as simple as
<window xmlns="">

It can be seen that the <textbox> has two borders. From inspector, it seems that the inner border is from a <html:input> in its XBL binding.

The inspector shows that there is a rule
> html|*.textbox-input, html|*.textbox-textarea {
> 	margin: 0px !important;
> 	border: none !important;
> 	padding: 0px 1px !important;
> 	background-color: inherit;
> 	color: inherit;
> 	font: inherit;
> }
matches the <html:input>, and clearly it should set the border to nothing. But it is not clear why it doesn't work.

This affects at least
* layout/reftests/forms/textbox/accesskey-2.xul
* layout/reftests/forms/textbox/accesskey-4.xul
because those tests rely on that the <textbox> doesn't show anything.
Investigating. A brief debug shows that we are iterating the declarations in a wrong order, and the UA rules take precedence over the XBL rules somehow.
Assignee: nobody → xidorn+moz
I eventually understand what's going on there: all important rules in XBL are ignored, because we don't have a cascading level for important XBL rules...
Summary: stylo: XUL <textbox> element shows an addition border inside → stylo: XBL important rules are ignored
Duplicate of this bug: 1408824
Duplicate of this bug: 1408831
Comment on attachment 8920957 [details]
Remove XBL as a separate cascading level in Stylo.
Attachment #8920957 - Flags: review?(emilio) → review+
Comment on attachment 8920958 [details]
Bug 1408811 - Update test expectation for this bug.

Yay, easy patch + big win :)
Attachment #8920958 - Flags: review?(emilio) → review+
Attached file Servo PR
hg error in cmd: hg push -r tip ssh:// pushing to ssh://
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 2 changesets with 12 changes to 12 files
remote: ************************** ERROR ****************************
remote: Rev 0f96eff86e7b needs "Bug N" or "No bug" in the commit message.
remote: Xidorn Quan <>
remote: Remove XBL as a separate cascading level in Stylo. r=emilio
remote: In Gecko, we handle XBL rules like author rules everywhere, except that
remote: XBL rules are added and sorted in an independent step, behave as if it
remote: has a separate level.
remote: It is not clear to me why Stylo chose to add a separate level for XBL
remote: rules, but it doesn't seem that there is anything special to do with
remote: XBL rules.
remote: This bug happens because we don't handle XBL important rules which are
remote: handled as part of author rules in Gecko due to lack of the additional
remote: level there. We should just follow what Gecko does here and handle them
remote: all the same.
remote: MozReview-Commit-ID: LmqjMdQito2
remote: *************************************************************
remote: transaction abort!
remote: rollback completed
remote: pretxnchangegroup.c_commitmessage hook failed
abort: push failed on remote
Pushed by
Update test expectation for this bug. r=emilio
Pushed by
followup - Disable empty-1.xul for stylo windows.
Pushed by
followup 2 - Swap the annotation of empty-1.xul.
You need to log in before you can comment on or make changes to this bug.