Changeset 271284 in webkit
- Timestamp:
- Jan 7, 2021 8:38:05 PM (19 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/css/vertical-align-block-elements-expected.html (modified) (1 diff)
-
LayoutTests/fast/css/vertical-align-block-elements.html (modified) (1 diff)
-
LayoutTests/fast/inline/incorrect-vertical-alignment-inside-inline-block-expected.html (added)
-
LayoutTests/fast/inline/incorrect-vertical-alignment-inside-inline-block.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/InlineFlowBox.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r271259 r271284 1 2021-01-07 Zalan Bujtas <zalan@apple.com> 2 3 paypal.com: text at the bottom of the page is not aligned properly 4 https://bugs.webkit.org/show_bug.cgi?id=220444 5 <rdar://problem/60356338> 6 7 Reviewed by Simon Fraser. 8 9 * fast/css/vertical-align-block-elements-expected.html: 10 * fast/css/vertical-align-block-elements.html: 11 * fast/inline/incorrect-vertical-alignment-inside-inline-block-expected.html: Added. 12 * fast/inline/incorrect-vertical-alignment-inside-inline-block.html: Added. 13 1 14 2021-01-07 Ryan Haddad <ryanhaddad@apple.com> 2 15 -
trunk/LayoutTests/fast/css/vertical-align-block-elements-expected.html
r149929 r271284 14 14 </head> 15 15 <body> 16 <p>Bug: webkit.org/b/111974 - vertical-align only applies to inline-level elements and table-cells. The text below should be aligned hori ontally.16 <p>Bug: webkit.org/b/111974 - vertical-align only applies to inline-level elements and table-cells. The text below should be aligned horizontally. 17 17 <div> 18 18 <button>All </button> This <span>text</span> is <a href="#">aligned</a>. -
trunk/LayoutTests/fast/css/vertical-align-block-elements.html
r149929 r271284 16 16 </head> 17 17 <body> 18 <p>Bug: webkit.org/b/111974 - vertical-align only applies to inline-level elements and table-cells. The text below should be aligned hori ontally.18 <p>Bug: webkit.org/b/111974 - vertical-align only applies to inline-level elements and table-cells. The text below should be aligned horizontally. 19 19 <div> 20 20 <button>All </button> This <span>text</span> is <a href="#">aligned</a>. -
trunk/Source/WebCore/ChangeLog
r271270 r271284 1 2021-01-07 Zalan Bujtas <zalan@apple.com> 2 3 paypal.com: text at the bottom of the page is not aligned properly 4 https://bugs.webkit.org/show_bug.cgi?id=220444 5 <rdar://problem/60356338> 6 7 Reviewed by Simon Fraser. 8 9 This patch addresses the case when we try to align text content inside an inline level box with display type of inline-block. 10 11 While ideally only the inline level boxes would participate in the vertical alignment process, in legacy line layout we align the text content as well. 12 The verticalAlignApplies() function filters out the cases when the text content should default to baseline. It was checking against "inline" to 13 ensure 14 "<div style="vertical-align: top">foobar</div>" works and it missed the following case "<div style="display: inline-block; vertical-align:top">foobar</div>" <- inline level box but "foobar" should be baseline aligned. 15 16 Tests: fast/inline/incorrect-vertical-alignment-inside-inline-block.html 17 18 * rendering/InlineFlowBox.cpp: 19 (WebCore::verticalAlignApplies): 20 1 21 2021-01-07 Eric Carlson <eric.carlson@apple.com> 2 22 -
trunk/Source/WebCore/rendering/InlineFlowBox.cpp
r271110 r271284 490 490 static bool verticalAlignApplies(const RenderObject& renderer) 491 491 { 492 // http://www.w3.org/TR/CSS2/visudet.html#propdef-vertical-align - vertical-align 493 // only applies to inline level and table-cell elements 494 return !renderer.isText() || renderer.parent()->isInline() || renderer.parent()->isTableCell(); 492 // http://www.w3.org/TR/CSS2/visudet.html#propdef-vertical-align - vertical-align only applies to inline level and table-cell elements. 493 // FIXME: Ideally we would only align inline level boxes which means that text inside an inline box would just sit on the box itself. 494 if (!renderer.isText()) 495 return true; 496 auto& parentRenderer = *renderer.parent(); 497 return (parentRenderer.isInline() && parentRenderer.style().display() != DisplayType::InlineBlock) || parentRenderer.isTableCell(); 495 498 } 496 499
Note: See TracChangeset
for help on using the changeset viewer.