Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(750)

Issue 2204593003: Change requiresLineBox to return false for empty-text inline. (Closed)

Created:
4 years, 4 months ago by Gleb Lanbin
Modified:
4 years, 4 months ago
Reviewers:
eae
CC:
chromium-reviews, blink-reviews, jam, darin-cc_chromium.org, blink-reviews-style_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Change requiresLineBox to return false for empty-text inline. .:: WHAT ::. This patch fixes trailing whitespace problem with empty ::pseudo.content in Inline Layout flow. Example: <style> .pseudo::before { content:''; } </style> <div class="pseudo"> <img/></div> Layout Tree: ... LayoutBlockFlow {DIV} at (0,0) size 784x20 LayoutInline {<pseudo:before>} at (0,0) size 0x0 LayoutTextFragment (anonymous) at (0,0) size 0x0 LayoutText {#text} at (0,0) size 4x19 text run at (0,0) width 4: " " <- trailing whitespace LayoutImage {IMG} at (4,15) size 0x ... .:: WHY ::. The root cause of the issue is that the empty LayoutTextFragement(::pseudo.content) is recognized as requiresLineBox during the inline-walk. As a result LineBreaker::nextLineBreak handles LayoutTextFragement(::pseudo.content) as a line break and lays out the following real line break "\n" as an independent LayoutText element. .:: HOW ::. To fix the issue requiresLineBox was changed to return false if the current LineLayoutItem is Text and empty. This is similar to what we do for inline boxes with collapsible whitespaces. .:: Rebasline ::. 2 tests need to be rebaseline because their test expectation includes a trailing whitespace - third_party/WebKit/LayoutTests/fast/css-generated-content/pseudo-inline-with-empty-content-expected.html - third_party/WebKit/LayoutTests/fast/css-generated-content/pseudo-inline-with-empty-content.html BUG=445243 TEST=third_party/WebKit/LayoutTests/fast/css-generated-content/pseudo-inline-with-empty-content.html Committed: https://crrev.com/09cfb18fdabab040b47b637331ed5e2bd4d8a7ad Cr-Commit-Position: refs/heads/master@{#409438}

Patch Set 1 : fix with the whitespace placeholder in ContentData::TextFragement #

Patch Set 2 : fix in requiresLineBox #

Total comments: 2

Patch Set 3 : remove curly brackets around one-line control-flow statements #

Messages

Total messages: 21 (16 generated)
eae
LGTM https://codereview.chromium.org/2204593003/diff/40001/third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h File third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h (right): https://codereview.chromium.org/2204593003/diff/40001/third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h#newcode209 third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h:209: if (it.getLineLayoutItem().isEmptyText()) { NIT: No curly brackets around ...
4 years, 4 months ago (2016-08-02 20:52:04 UTC) #13
Gleb Lanbin
thanks for the review https://codereview.chromium.org/2204593003/diff/40001/third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h File third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h (right): https://codereview.chromium.org/2204593003/diff/40001/third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h#newcode209 third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h:209: if (it.getLineLayoutItem().isEmptyText()) { On 2016/08/02 ...
4 years, 4 months ago (2016-08-02 23:17:55 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2204593003/60001
4 years, 4 months ago (2016-08-02 23:18:57 UTC) #17
commit-bot: I haz the power
Committed patchset #3 (id:60001)
4 years, 4 months ago (2016-08-03 02:33:51 UTC) #19
commit-bot: I haz the power
4 years, 4 months ago (2016-08-03 02:36:23 UTC) #21
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/09cfb18fdabab040b47b637331ed5e2bd4d8a7ad
Cr-Commit-Position: refs/heads/master@{#409438}

Powered by Google App Engine
This is Rietveld 408576698