Closed
Bug 1215182
Opened 9 years ago
Closed 9 years ago
[css-grid] Make our "Implicit Named Areas" handling match the spec
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla45
People
(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)
References
Details
Attachments
(2 files)
3.07 KB,
patch
|
dholbert
:
review+
|
Details | Diff | Splinter Review |
13.47 KB,
patch
|
Details | Diff | Splinter Review |
https://lists.w3.org/Archives/Public/www-style/2015Oct/0040.html It appears there are no conditions whatsoever other than the existence of at least one line of the form X-start or X-end for the "area" X to exist.
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8674344 -
Flags: review?(dholbert)
Assignee | ||
Comment 2•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=59541e2e0280
Comment 3•9 years ago
|
||
I'm forgetting why we need to maintain these areas in the first place. Can we do away with it & just deal with lines? In particular, Tab said the following in the thread that you linked to: # The spec doesn't actually "create" any such areas; they exist as a # spec concept for convenience only. The placement properties never # care about areas, they just check for lines with particular names. https://lists.w3.org/Archives/Public/www-style/2015Oct/0052.html Given this, I'm wondering why we're creating structures for these areas internally. Was it just an optimization?
Comment 4•9 years ago
|
||
I think the answer is basically "yes, it's an optimization". IIUC: given a grid item with "grid-row-start:A", the lazy thing to do is to search first for "A-start" in our explicit-line-list [and also look for explicit areas named "A"], and if we fail, then search our explicit-line-list *again* for just "A". (This is basically what tab described in the post I linked to.) For authors who just use "A" naming for their lines (who don't name anything "A-start" etc.), the first search is doomed & wasteful. This sucks, because we have to perform it for each grid item that uses a named line. So, the ImplicitNamedAreas object (a hash set populated during a precomputation step) lets us optimize these doomed searches away. Does this make sense? (I slightly wonder whether we should make the further optimization of hashing the actual line-names, so we can optimize away the second search as well, and perhaps end up with better code-sharing/symmetry as a result. For this to help, authors would have to be using completely-undefined line names, though, and maybe that's not a case that's worth optimizing for.)
Comment 5•9 years ago
|
||
Comment on attachment 8674344 [details] [diff] [review] fix Review of attachment 8674344 [details] [diff] [review]: ----------------------------------------------------------------- r=me -- I've just got one comment-nit, below: ::: layout/generic/nsGridContainerFrame.cpp @@ +1162,5 @@ > nsGridContainerFrame::AddImplicitNamedAreas( > const nsTArray<nsTArray<nsString>>& aLineNameLists) > { > // http://dev.w3.org/csswg/css-grid/#implicit-named-areas > + // A line named 'x-start' or 'x-end' implies an implicit named area 'x'. To me, this implies that we'll be creating an actual area (with resolveable start/end lines in all dimensions). But that's not what actually happens. Might be worth adding a parenthetical clarifying this -- e.g.... // (But only explicitly-defined edges of this implicit area can be // matched against during grid-item placement.) ...or something along those lines. (I think this is accurate? Please correct me if not.) So for example a row-line named "x-start" will create an implicit named area "x", but it doesn't actually influence how "grid-row-end: x" is resolved, or how "grid-column-start/end" are resolved. (It means we'll take a slightly different codepath -- we'll traverse the HasImplicitNamedArea()-guarded code -- but we'll fail to match there, I think.)
Attachment #8674344 -
Flags: review?(dholbert) → review+
Comment 6•9 years ago
|
||
Comment on attachment 8674345 [details] [diff] [review] reftest Review of attachment 8674345 [details] [diff] [review]: ----------------------------------------------------------------- One drive-by nit on the reftest patch: ::: layout/reftests/css-grid/grid-placement-implicit-named-areas-001.html @@ +6,5 @@ > +<html><head> > + <meta charset="utf-8"> > + <title>CSS Grid Test: implicit named areas</title> > + <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1215182"> > + <link rel="help" href="http://dev.w3.org/csswg/css-grid/#abspos-items"> I think this #abspos-items anchor is incorrect. (probably from copypaste error) You probably really want to link to http://dev.w3.org/csswg/css-grid/#grid-placement-slot (This applies to the testcase as well as the reference case)
Assignee | ||
Comment 7•9 years ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #4) > I think the answer is basically "yes, it's an optimization". Yes, it's just an optimization now.
Assignee | ||
Comment 8•9 years ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #5) > > // http://dev.w3.org/csswg/css-grid/#implicit-named-areas > > + // A line named 'x-start' or 'x-end' implies an implicit named area 'x'. > > To me, this implies that we'll be creating an actual area (with resolveable > start/end lines in all dimensions). But that's not what actually happens. I removed that line. The spec link is sufficient. (I think you're comment here illustrates perfectly why "implicit named area" is not only a useless, but also harmful, concept.) (In reply to Daniel Holbert [:dholbert] from comment #6) > You probably really want to link to > http://dev.w3.org/csswg/css-grid/#grid-placement-slot Fixed, thanks.
Assignee | ||
Comment 9•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/7b8f601030db https://hg.mozilla.org/integration/mozilla-inbound/rev/dc90c209ea61
Flags: in-testsuite+
Comment 10•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7b8f601030db https://hg.mozilla.org/mozilla-central/rev/dc90c209ea61
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Comment 11•9 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-b2g44_v2_5/rev/7b8f601030db https://hg.mozilla.org/releases/mozilla-b2g44_v2_5/rev/dc90c209ea61
status-b2g-v2.5:
--- → fixed
Comment 12•9 years ago
|
||
(In reply to Carsten Book [:Tomcat] from comment #11) > https://hg.mozilla.org/releases/mozilla-b2g44_v2_5/rev/7b8f601030db > https://hg.mozilla.org/releases/mozilla-b2g44_v2_5/rev/dc90c209ea61 backed this out on request from mats from b2g v2.5 in http://hg.mozilla.org/releases/mozilla-b2g44_v2_5/rev/0869ace8c965
status-b2g-v2.5:
fixed → ---
You need to log in
before you can comment on or make changes to this bug.
Description
•