Closed Bug 1408811 Opened 2 years ago Closed 2 years ago

stylo: XBL important rules are ignored

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox57 --- wontfix
firefox58 --- fixed

People

(Reporter: xidorn, Assigned: xidorn)

References

Details

Attachments

(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="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<textbox/>
</window>

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.

https://reviewboard.mozilla.org/r/191930/#review197102
Attachment #8920957 - Flags: review?(emilio) → review+
Comment on attachment 8920958 [details]
Bug 1408811 - Update test expectation for this bug.

https://reviewboard.mozilla.org/r/191932/#review197106

Yay, easy patch + big win :)
Attachment #8920958 - Flags: review?(emilio) → review+
Attached file Servo PR
hg error in cmd: hg push -r tip ssh://hg.mozilla.org/integration/autoland: pushing to ssh://hg.mozilla.org/integration/autoland
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 2 changesets with 12 changes to 12 files
remote: 
remote: 
remote: ************************** ERROR ****************************
remote: Rev 0f96eff86e7b needs "Bug N" or "No bug" in the commit message.
remote: Xidorn Quan <me@upsuper.org>
remote: Remove XBL as a separate cascading level in Stylo. r=emilio
remote: 
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: 
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: 
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: 
remote: MozReview-Commit-ID: LmqjMdQito2
remote: *************************************************************
remote: 
remote: 
remote: transaction abort!
remote: rollback completed
remote: pretxnchangegroup.c_commitmessage hook failed
abort: push failed on remote
Pushed by ecoal95@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/127d2762b087
Update test expectation for this bug. r=emilio
Pushed by xquan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d22b8c27e4cc
followup - Disable empty-1.xul for stylo windows.
Pushed by xquan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/252a8528c5ab
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.