Closed
Bug 1390694
Opened 9 years ago
Closed 8 years ago
stylo: :-moz-window-inactive doesn't respond to window state change dynamically
Categories
(Core :: CSS Parsing and Computation, enhancement, P3)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla58
People
(Reporter: xidorn, Assigned: heycam)
References
(Blocks 1 open bug)
Details
Attachments
(8 files, 4 obsolete files)
|
119 bytes,
text/html
|
Details | |
|
59 bytes,
text/x-review-board-request
|
emilio
:
review+
|
Details |
|
59 bytes,
text/x-review-board-request
|
emilio
:
review+
|
Details |
|
59 bytes,
text/x-review-board-request
|
emilio
:
review+
|
Details |
|
59 bytes,
text/x-review-board-request
|
emilio
:
review+
|
Details |
|
41 bytes,
text/x-github-pull-request
|
Details | Review | |
|
2.40 KB,
patch
|
emilio
:
review+
|
Details | Diff | Splinter Review |
|
1.24 KB,
patch
|
emilio
:
review+
|
Details | Diff | Splinter Review |
See the testcase.
You would see a green background initially, and when you activate other window, the background should turn red, because now :-moz-window-inactive should match. However, in Stylo, it doesn't.
We need to invalidate selector matching somehow when window changes its state.
This causes test browser/base/content/test/general/browser_windowactivation.js to timeout.
| Reporter | ||
Updated•9 years ago
|
Priority: -- → P3
Comment 3•9 years ago
|
||
Xidorn makes a case for this being P3 in bug 1290285 comment 4.
Priority: P2 → P3
| Reporter | ||
Updated•9 years ago
|
Blocks: stylo-chrome
| Assignee | ||
Updated•8 years ago
|
Assignee: nobody → cam
Status: NEW → ASSIGNED
| Comment hidden (obsolete) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 13•8 years ago
|
||
Originally I wanted to track the dependencies for invalidation just like we do for element states, but this proved to be more annoying than I'd hoped. We would need to post an invalidation from the root of the document, since we don't have a specific element whose state has updated to start from. (Or, you can think of it as some intrinsic state of every element in the document has changed, and some of those might generate invalidations.) I managed to get the invalidation processing working even when starting from the very left of the selector, but then I realized I'd need to do something to allow the :-moz-window-inactive to match regardless of the actual current (or snapshotted) document state value. That seemed a bit much just to make this one (or two) pseudo-class work, so I fell back to just posting a subtree restyle like Gecko does currently.
| Assignee | ||
Updated•8 years ago
|
Attachment #8919652 -
Flags: review?(emilio)
Attachment #8919653 -
Flags: review?(emilio)
Attachment #8919654 -
Flags: review?(emilio)
Attachment #8919655 -
Flags: review?(emilio)
Comment 14•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8919652 [details]
style: Remove Stylist::might_have_state_dependency.
https://reviewboard.mozilla.org/r/190562/#review195784
Attachment #8919652 -
Flags: review?(emilio) → review+
Comment 15•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8919653 [details]
style: Remove unused SelectorImpl::pseudo_class_state_flag.
https://reviewboard.mozilla.org/r/190564/#review195786
Attachment #8919653 -
Flags: review?(emilio) → review+
Comment 16•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8919655 [details]
geckolib: Add FFI function for checking document state dependencies.
https://reviewboard.mozilla.org/r/190568/#review195788
::: servo/ports/geckolib/glue.rs:4053
(Diff revision 1)
> #[no_mangle]
> +pub extern "C" fn Servo_StyleSet_HasDocumentStateDependency(
> + raw_data: RawServoStyleSetBorrowed,
> + state: u64,
> +) -> bool {
> + let state = ElementState::from_bits_truncate(state);
Shouldn't this be `DocumentState`, and `has_document_state_dependency`?
Attachment #8919655 -
Flags: review?(emilio)
Comment 17•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8919654 [details]
style: Record DocumentState dependencies.
https://reviewboard.mozilla.org/r/190566/#review195796
Attachment #8919654 -
Flags: review?(emilio) → review+
Comment 18•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8919655 [details]
geckolib: Add FFI function for checking document state dependencies.
https://reviewboard.mozilla.org/r/190568/#review195798
::: servo/ports/geckolib/glue.rs:4053
(Diff revision 1)
> #[no_mangle]
> +pub extern "C" fn Servo_StyleSet_HasDocumentStateDependency(
> + raw_data: RawServoStyleSetBorrowed,
> + state: u64,
> +) -> bool {
> + let state = ElementState::from_bits_truncate(state);
This fixed, r=me
Attachment #8919655 -
Flags: review+
Comment 19•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8919656 [details]
Bug 1390694 - Part 1: Add ServoStyleSet function for checking document state dependencies.
https://reviewboard.mozilla.org/r/190570/#review195800
Attachment #8919656 -
Flags: review?(emilio) → review+
Comment 20•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8919657 [details]
Bug 1390694 - Part 2: Allow EnumerateBoundContentBindings callbacks to stop enumeration.
https://reviewboard.mozilla.org/r/190572/#review195802
Attachment #8919657 -
Flags: review?(emilio) → review+
Comment 21•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8919658 [details]
Bug 1390694 - Part 3: Add nsBindingManager function to check for document state dependencies.
https://reviewboard.mozilla.org/r/190574/#review195804
Attachment #8919658 -
Flags: review?(emilio) → review+
Comment 22•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8919659 [details]
Bug 1390694 - Part 4: Restyle the document when document state dependencies change.
https://reviewboard.mozilla.org/r/190576/#review195808
r=me. Maybe file a bug on how we can make it better / more fine-grained and reference it from there? I agree that if Gecko was doing full doc restyles anyway it's unlikely to matter that much.
Attachment #8919659 -
Flags: review?(emilio) → review+
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Updated•8 years ago
|
Attachment #8919652 -
Attachment is obsolete: true
| Assignee | ||
Updated•8 years ago
|
Attachment #8919653 -
Attachment is obsolete: true
| Assignee | ||
Updated•8 years ago
|
Attachment #8919654 -
Attachment is obsolete: true
| Assignee | ||
Updated•8 years ago
|
Attachment #8919655 -
Attachment is obsolete: true
| Assignee | ||
Comment 27•8 years ago
|
||
| Assignee | ||
Comment 28•8 years ago
|
||
Comment 29•8 years ago
|
||
Pushed by cmccormack@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/484a2644318f
Part 1: Add ServoStyleSet function for checking document state dependencies. r=emilio
https://hg.mozilla.org/integration/autoland/rev/83ff9e245757
Part 2: Allow EnumerateBoundContentBindings callbacks to stop enumeration. r=emilio
https://hg.mozilla.org/integration/autoland/rev/e13dd2a3651f
Part 3: Add nsBindingManager function to check for document state dependencies. r=emilio
https://hg.mozilla.org/integration/autoland/rev/b9cff3469bfd
Part 4: Restyle the document when document state dependencies change. r=emilio
| Reporter | ||
Comment 30•8 years ago
|
||
We probably should re-enable browser/base/content/test/general/browser_windowactivation.js?
Flags: needinfo?(cam)
Comment 31•8 years ago
|
||
Backed out 4 changesets (bug 1390694) for failing crash test and in reftest/tests/layout/reftests/xul/mac-tab-toolbar.xul
https://hg.mozilla.org/integration/autoland/rev/ca6138ea6ef6800a6c4ff7625c2644d366ebcf3b
Comment 32•8 years ago
|
||
| Assignee | ||
Comment 33•8 years ago
|
||
I fixed the crash (needed a null check for the document root element), but the mac-tab-toolbar.xul failure is confusing. I don't think I'll get a chance to look into this properly before I'm leave, so I'll leave the ni for myself.
Comment 34•8 years ago
|
||
status-firefox57=wontfix unless someone thinks this bug should block 57
| Reporter | ||
Comment 35•8 years ago
|
||
(In reply to Cameron McCormack (:heycam) (away 24 Oct – 12 Nov) from comment #33)
> I fixed the crash (needed a null check for the document root element), but
> the mac-tab-toolbar.xul failure is confusing. I don't think I'll get a
> chance to look into this properly before I'm leave, so I'll leave the ni for
> myself.
This test was initially introduced in bug 1340627 for catching tab switching regression. That regression was because of not popping layer correctly as indicated in bug 1340627 comment 35.
Looking at the patches, I'm suspecting this may be related to part 4, where it skips the final SchedulePaint() call in some cases where the old code didn't skip. I can have a try run and see if this is really the problem.
| Reporter | ||
Comment 36•8 years ago
|
||
It passes now: https://treeherder.mozilla.org/#/jobs?repo=try&revision=7a02751235ca2414293c21c3a4e1380bc5dafc87
Flags: needinfo?(cam)
| Reporter | ||
Comment 37•8 years ago
|
||
This is based on the original part 4. The difference is that this doesn't use early return, so the paint may be scheduled like what the function does before.
Attachment #8924048 -
Flags: review?(emilio)
| Reporter | ||
Comment 38•8 years ago
|
||
Attachment #8924051 -
Flags: review?(emilio)
Comment 40•8 years ago
|
||
Comment on attachment 8924048 [details] [diff] [review]
Part 4: Restyle the document when document state dependencies change.
Review of attachment 8924048 [details] [diff] [review]:
-----------------------------------------------------------------
::: layout/base/PresShell.cpp
@@ +4305,5 @@
> NS_PRECONDITION(aDocument == mDocument, "Unexpected aDocument");
>
> + if (mDidInitialize) {
> + Element* rootElement = aDocument->GetRootElement();
> + bool needRestyle = false;
Maybe a function like:
static bool NeedRestyleForDocumentStateChange(nsIDocument*, EventStates, RestyleManager*)
or a method looks nicer?
Your call, no big deal.
Attachment #8924048 -
Flags: review?(emilio) → review+
Updated•8 years ago
|
Attachment #8924051 -
Flags: review?(emilio) → review+
| Reporter | ||
Comment 41•8 years ago
|
||
(In reply to Emilio Cobos Álvarez [:emilio] from comment #40)
> Comment on attachment 8924048 [details] [diff] [review]
> Part 4: Restyle the document when document state dependencies change.
>
> Review of attachment 8924048 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: layout/base/PresShell.cpp
> @@ +4305,5 @@
> > NS_PRECONDITION(aDocument == mDocument, "Unexpected aDocument");
> >
> > + if (mDidInitialize) {
> > + Element* rootElement = aDocument->GetRootElement();
> > + bool needRestyle = false;
>
> Maybe a function like:
>
> static bool NeedRestyleForDocumentStateChange(nsIDocument*, EventStates,
> RestyleManager*)
>
> or a method looks nicer?
It doesn't seem to me that would make it much nicer... I'll just leave it as-is.
Comment 42•8 years ago
|
||
Pushed by xquan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/faafb9307cb1
Part 1: Add ServoStyleSet function for checking document state dependencies. r=emilio
https://hg.mozilla.org/integration/autoland/rev/68e5971edabb
Part 2: Allow EnumerateBoundContentBindings callbacks to stop enumeration. r=emilio
https://hg.mozilla.org/integration/autoland/rev/4617a3675f58
Part 3: Add nsBindingManager function to check for document state dependencies. r=emilio
https://hg.mozilla.org/integration/autoland/rev/6b2e7817128b
Part 4: Restyle the document when document state dependencies change. r=emilio
https://hg.mozilla.org/integration/autoland/rev/0238eee84c25
Part 5: Enable browser_windowactivation.js test. r=emilio
Comment 43•8 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/faafb9307cb1
https://hg.mozilla.org/mozilla-central/rev/68e5971edabb
https://hg.mozilla.org/mozilla-central/rev/4617a3675f58
https://hg.mozilla.org/mozilla-central/rev/6b2e7817128b
https://hg.mozilla.org/mozilla-central/rev/0238eee84c25
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox58:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in
before you can comment on or make changes to this bug.
Description
•