Closed
Bug 1463687
Opened 6 years ago
Closed 6 years ago
Have viewport uses scrollbar color properties on root element
Categories
(Core :: CSS Parsing and Computation, enhancement, P3)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla62
Tracking | Status | |
---|---|---|
firefox62 | --- | fixed |
People
(Reporter: xidorn, Assigned: xidorn)
References
Details
Attachments
(1 file)
Based on feedback from https://github.com/devtools-html/rfcs/issues/27#issuecomment-391251478 we need a way to style scrollbars of the viewport. The normal way is to propagate the properties from root element to the viewport, similar to what we do for overflow properties (although we probably don't want to propagate <body> to viewport like overflow).
Assignee | ||
Comment 1•6 years ago
|
||
Spec issue: w3c/csswg-drafts#2696
See Also: → https://github.com/w3c/csswg-drafts/issues/2696
Comment 2•6 years ago
|
||
Agreed and spec updated accordingly. Thanks for raising/filing!
Updated•6 years ago
|
Priority: -- → P3
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → xidorn+moz
Comment hidden (mozreview-request) |
Comment 4•6 years ago
|
||
mozreview-review |
Comment on attachment 8980193 [details] Bug 1463687 - Apply scrollbar style of root element to scrollbars of viewport. https://reviewboard.mozilla.org/r/246358/#review252456 ::: layout/base/nsLayoutUtils.h:3117 (Diff revision 1) > + * Generally it returns the computed style of the scrollable frame > + * which contains the given part frame. If the scrollable frame is "scroll frame" ::: layout/base/nsLayoutUtils.cpp:10194 (Diff revision 1) > + nsIFrame* scrollableFrame = nullptr; > + for (nsIFrame* f = aScrollbarPart; f; f = f->GetParent()) { > + if (f->IsScrollFrame()) { > + scrollableFrame = f; > + break; > + } > + } This can be: nsIFrame* scrollableFrame = GetClosestFrameOfType(aFrame, LayoutFrameType::Scroll); I would probably call it "scrollFrame" rather than "scrollableFrame", since "scrollable" sounds to me like it might be referring to the child of the scroll frame. ::: layout/base/nsLayoutUtils.cpp:10211 (Diff revision 1) > + // from the element. Dropping the strong reference is fine because > + // the style should be hold strongly by the element. "held" ::: layout/base/nsLayoutUtils.cpp:10213 (Diff revision 1) > + return frameOfRoot->Style(); > + } > + // If the root doesn't have primary frame, get the computed style > + // from the element. Dropping the strong reference is fine because > + // the style should be hold strongly by the element. > + RefPtr<ComputedStyle> style = pc->StyleSet()->ResolveServoStyle(root); It would be nice if we could assert that the refcount is greater than 1 here, but since it would need adding a new FFI function, it's maybe too much effort.
Attachment #8980193 -
Flags: review?(cam) → review+
Comment hidden (mozreview-request) |
Pushed by xquan@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ac922efad9fd Apply scrollbar style of root element to scrollbars of viewport. r=heycam
Comment 7•6 years ago
|
||
Backed out changeset ac922efad9fd (bug 1463687) for failures in build/build/src/layout/base/nsLayoutUtils.cpp on a CLOSED TREE Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=ac922efad9fd198f2401a40e0b921f22aa31098d&filter-resultStatus=testfailed&filter-resultStatus=busted&filter-resultStatus=exception&filter-classifiedState=unclassified&selectedJob=179978868 Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=179978868&repo=autoland&lineNumber=11254 Backout: https://hg.mozilla.org/integration/autoland/rev/a5c04fe7278db916b3efd5f06a5f2a9da0d64ad2
Flags: needinfo?(xidorn+moz)
Comment hidden (mozreview-request) |
Assignee | ||
Comment 9•6 years ago
|
||
Comment on attachment 8980193 [details] Bug 1463687 - Apply scrollbar style of root element to scrollbars of viewport. Probably worth another look.
Flags: needinfo?(xidorn+moz)
Attachment #8980193 -
Flags: review+ → review?(cam)
Comment 10•6 years ago
|
||
mozreview-review |
Comment on attachment 8980193 [details] Bug 1463687 - Apply scrollbar style of root element to scrollbars of viewport. https://reviewboard.mozilla.org/r/246358/#review252778 ::: layout/base/nsLayoutUtils.cpp:10201 (Diff revision 3) > + while (content && content->IsInNativeAnonymousSubtree()) { > + content = content->GetParent(); > + } In theory we could have an XBL binding attached to NAC element, and that binding creates a scrollable element. It's unlikely we have cases like this where we want to control the scrollbar colors from inside the binding, but might be worth mentioning in the comment. ::: layout/base/nsLayoutUtils.cpp:10219 (Diff revision 3) > + RefPtr<ComputedStyle> style = aScrollbarPart-> > + PresContext()->StyleSet()->ResolveServoStyle(content->AsElement()); Can you add an assertion here that content is the document's root element?
Attachment #8980193 -
Flags: review?(cam) → review+
Comment hidden (mozreview-request) |
Comment 12•6 years ago
|
||
Pushed by xquan@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a3adfabc2b66 Apply scrollbar style of root element to scrollbars of viewport. r=heycam
Comment 13•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a3adfabc2b66
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in
before you can comment on or make changes to this bug.
Description
•