Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(50)

Issue 1178473003: Vertical-aligned of LayoutText should not contribute to a layout. (Closed)

Created:
4 years, 10 months ago by changseok
Modified:
4 years, 7 months ago
CC:
blink-reviews, pdr+renderingwatchlist_chromium.org, zoltan1, szager+layoutwatch_chromium.org, eae+blinkwatch, leviw+renderwatch, blink-reviews-rendering, jchaffraix+rendering
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Vertical-aligned of LayoutText should not contribute to a layout. According to http://www.w3.org/TR/CSS2/visudet.html#propdef-vertical-align, the vertical-aligned is a non-inheirted value. However an vertical-aligned value inherited from a container block is applied to LayoutText as well. This is because the style used by LayoutText is originated by its container block and it is shared with LayoutText rather than creating new one. To fix this, we return an initial value of vertical-align for LayoutText in InlineBox.h. BUG=496850 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=197007

Patch Set 1 #

Total comments: 7

Patch Set 2 : Updated patch #

Total comments: 2

Patch Set 3 : Removed vertical-align from an expected result. #

Patch Set 4 : Add tables/mozilla/bugs/bug14323.html to TestExpectation for rebasing. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -1 line) Patch
M LayoutTests/TestExpectations View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
A LayoutTests/fast/inline/vertical-align-text-inherit.html View 1 1 chunk +17 lines, -0 lines 0 comments Download
A LayoutTests/fast/inline/vertical-align-text-inherit-expected.html View 1 2 1 chunk +13 lines, -0 lines 0 comments Download
M Source/core/layout/line/InlineBox.h View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 19 (6 generated)
changseok
4 years, 10 months ago (2015-06-10 10:48:30 UTC) #2
mstensho (USE GERRIT)
This looks like a correct fix, but please proofread your commit message. Also, I'd like ...
4 years, 10 months ago (2015-06-10 11:40:42 UTC) #3
changseok
Thanks for your review. >Also, I'd like to point out that it's not really a ...
4 years, 10 months ago (2015-06-11 04:39:05 UTC) #4
mstensho (USE GERRIT)
lgtm https://codereview.chromium.org/1178473003/diff/20001/LayoutTests/fast/inline/vertical-align-text-inherit-expected.html File LayoutTests/fast/inline/vertical-align-text-inherit-expected.html (right): https://codereview.chromium.org/1178473003/diff/20001/LayoutTests/fast/inline/vertical-align-text-inherit-expected.html#newcode4 LayoutTests/fast/inline/vertical-align-text-inherit-expected.html:4: vertical-align: top; Can't you remove this too?
4 years, 10 months ago (2015-06-11 07:09:56 UTC) #5
changseok
https://codereview.chromium.org/1178473003/diff/20001/LayoutTests/fast/inline/vertical-align-text-inherit-expected.html File LayoutTests/fast/inline/vertical-align-text-inherit-expected.html (right): https://codereview.chromium.org/1178473003/diff/20001/LayoutTests/fast/inline/vertical-align-text-inherit-expected.html#newcode4 LayoutTests/fast/inline/vertical-align-text-inherit-expected.html:4: vertical-align: top; On 2015/06/11 07:09:56, mstensho wrote: > Can't ...
4 years, 10 months ago (2015-06-11 08:46:00 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1178473003/40001
4 years, 10 months ago (2015-06-11 09:03:13 UTC) #9
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink_rel on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/66160)
4 years, 10 months ago (2015-06-11 10:33:29 UTC) #11
leviw_travelin_and_unemployed
On 2015/06/11 at 10:33:29, commit-bot wrote: > Try jobs failed on following builders: > linux_blink_rel ...
4 years, 10 months ago (2015-06-11 20:22:24 UTC) #12
changseok
On 2015/06/11 20:22:24, leviw wrote: > On 2015/06/11 at 10:33:29, commit-bot wrote: > > Try ...
4 years, 10 months ago (2015-06-12 04:04:00 UTC) #13
changseok
On 2015/06/12 04:04:00, changseok wrote: > On 2015/06/11 20:22:24, leviw wrote: > > On 2015/06/11 ...
4 years, 10 months ago (2015-06-12 04:08:10 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1178473003/60001
4 years, 10 months ago (2015-06-12 05:56:43 UTC) #17
commit-bot: I haz the power
Committed patchset #4 (id:60001) as https://src.chromium.org/viewvc/blink?view=rev&revision=197007
4 years, 10 months ago (2015-06-12 07:17:55 UTC) #18
kojii
4 years, 7 months ago (2015-09-29 18:05:16 UTC) #19
Message was sent while issue was closed.
I'm looking into bug 537277 and it looks like it's a regression from this patch.

I'm still in the middle of investigation so there might still be some missing
parts, but the description and the fix in this patch doesn't really feel right
to me.

LayoutText is a LayoutObject for a text node. CSS inheritance is defined against
elements (or boxes.) Nodes do not have CSS properties, so when referring the
style of a LayoutText, it should look at its parent element (or box.) From that
perspective, LayoutText to copy styles from its parent is correct.

The bug expectation and the test look correct, but it's not because of
inheritance to LayoutText. Please refer this:
http://www.w3.org/TR/CSS21/visuren.html#anonymous
When a block contains text and inline elements, such text should be put into
anonymous inline boxes, and it's the anonymous inline box that blocks
inheritance of non-inherited properties. The 3rd paragraph of the link above
states this.

This patch forces vertical-align to the initial value regardless it's in an
anonymous inline box or not, so it breaks when a text node is not in an
anonymous inline box. It doesn't break major cases however, because there's an
optimization to check descendantsHaveSameLineHeightAndBaseline(), which is true
in most cases and this code doesn't run.
https://trac.webkit.org/changeset/82280/trunk/Source/WebCore/rendering/Render...

In my quick test, InlineBox that should be wrapped by anonymous inline box has
the same m_style as its parent, that's probably the root cause.

This patch and test helped me a lot to investigate bug 537277 and understand
what is going on, appreciate very much.

Powered by Google App Engine
This is Rietveld 408576698