Closed
Bug 1811353
Opened 2 years ago
Closed 2 years ago
two width: 50% inline-block elements wrap instead of staying on the same line inside a table (Blink and WebKit ignore whitespace text nodes inside table-internal parts)
Categories
(Core :: Layout, defect, P3)
Core
Layout
Tracking
()
RESOLVED
FIXED
111 Branch
Tracking | Status | |
---|---|---|
firefox111 | --- | fixed |
People
(Reporter: jrmuizel, Assigned: emilio)
References
Details
Attachments
(3 files)
The attached file displays properly in Safari and Chrome.
Assignee | ||
Comment 1•2 years ago
|
||
So this is kind of expected because there's whitespace between the two inline-blocks. I'm not sure why Blink / WebKit behave differently with tables...
Assignee | ||
Comment 2•2 years ago
|
||
It seems blink avoids creating whitespace text nodes in tables unconditionally (here)
Assignee | ||
Comment 3•2 years ago
|
||
Something like this fixes the test-case above:
diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp
index 5305b628bd521..9b2226949b261 100644
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -2314,7 +2314,8 @@ static inline bool NeedFrameFor(const nsFrameConstructorState& aState,
// white-space, where we know we'll be dropping them all anyway, and involve
// an extra walk down the frame construction item list.
auto excludesIgnorableWhitespace = [](nsIFrame* aParentFrame) {
- return aParentFrame->IsFrameOfType(nsIFrame::eXULBox) ||
+ return aParentFrame->IsTableFrame() ||
+ aParentFrame->IsFrameOfType(nsIFrame::eXULBox) ||
aParentFrame->IsFrameOfType(nsIFrame::eMathML);
};
if (!aParentFrame || !excludesIgnorableWhitespace(aParentFrame) ||
But it's unclear to me what in the spec justifies it.
Assignee | ||
Updated•2 years ago
|
Severity: -- → S3
Priority: -- → P3
See Also: → https://github.com/w3c/csswg-drafts/issues/8358
Summary: two width: 50% inline-block elements wrap instead of staying on the same line → two width: 50% inline-block elements wrap instead of staying on the same line inside a table (Blink and WebKit ignore whitespace text nodes inside table-internal parts)
Assignee | ||
Comment 4•2 years ago
|
||
See help links and spec issue.
Updated•2 years ago
|
Assignee: nobody → emilio
Status: NEW → ASSIGNED
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9ea945ffd5ee
Add a test for this WebKit / Blink bug. r=jrmuizel
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/38192 for changes under testing/web-platform/tests
Comment 7•2 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
status-firefox111:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in
before you can comment on or make changes to this bug.
Description
•