WebKit Bugzilla
Attachment 339147 Details for
Bug 185142
: REGRESSION(r230914) Selecting text on this apple.com page makes it vanish
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185142-20180430141432.patch (text/plain), 6.11 KB, created by
zalan
on 2018-04-30 14:14:33 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-04-30 14:14:33 PDT
Size:
6.11 KB
patch
obsolete
>Subversion Revision: 231142 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a9717c7e5088cd9207ceb416b4e236a9bdfeb962..eaaea0c31464f3410815f5444ac62af787e01f04 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,20 @@ >+2018-04-30 Zalan Bujtas <zalan@apple.com> >+ >+ REGRESSION(r230914) Selecting text on this apple.com page makes it vanish >+ https://bugs.webkit.org/show_bug.cgi?id=185142 >+ <rdar://problem/39821446> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Set the overflow rect on the inline textbox when needed. >+ >+ Test: fast/text/simple-line-layout-selection-with-overflow.html >+ >+ * rendering/SimpleLineLayoutFunctions.cpp: >+ (WebCore::SimpleLineLayout::initializeInlineTextBox): >+ (WebCore::SimpleLineLayout::generateLineBoxTree): >+ (WebCore::SimpleLineLayout::initializeInlineBox): Deleted. >+ > 2018-04-28 Zalan Bujtas <zalan@apple.com> > > [LFC] Add LayoutTreeBuilder class to generate the layout tree >diff --git a/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp b/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp >index 83321b08f65a2d0fbb756de349e85ba3e832736f..faf46ccb641e4180f53db1783e3f8ae6f8ad11c4 100644 >--- a/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp >+++ b/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp >@@ -292,22 +292,25 @@ bool canUseForLineBoxTree(RenderBlockFlow& flow, const Layout& layout) > return true; > } > >-static void initializeInlineBox(InlineBox& inlineBox, const RunResolver::Run& run) >+static void initializeInlineTextBox(RenderBlockFlow& flow, InlineTextBox& inlineTextBox, const RunResolver::Run& run) > { >- inlineBox.setLogicalLeft(run.logicalLeft()); >- inlineBox.setLogicalTop(run.rect().y()); >- inlineBox.setLogicalWidth(run.logicalRight() - run.logicalLeft()); >+ inlineTextBox.setLogicalLeft(run.logicalLeft()); >+ inlineTextBox.setLogicalTop(run.rect().y()); >+ inlineTextBox.setLogicalWidth(run.logicalRight() - run.logicalLeft()); >+ auto overflowRect = computeOverflow(const_cast<RenderBlockFlow&>(flow), run.rect()); >+ if (overflowRect != run.rect()) >+ inlineTextBox.setLogicalOverflowRect(LayoutRect(overflowRect)); > >- inlineBox.setHasHyphen(run.hasHyphen()); >- inlineBox.setExpansionWithoutGrowing(run.expansion()); >+ inlineTextBox.setHasHyphen(run.hasHyphen()); >+ inlineTextBox.setExpansionWithoutGrowing(run.expansion()); > > auto expansionBehavior = run.expansionBehavior(); >- inlineBox.setCanHaveLeadingExpansion(expansionBehavior & AllowLeadingExpansion); >- inlineBox.setCanHaveTrailingExpansion(expansionBehavior & AllowTrailingExpansion); >+ inlineTextBox.setCanHaveLeadingExpansion(expansionBehavior & AllowLeadingExpansion); >+ inlineTextBox.setCanHaveTrailingExpansion(expansionBehavior & AllowTrailingExpansion); > if (expansionBehavior & ForceTrailingExpansion) >- inlineBox.setForceTrailingExpansion(); >+ inlineTextBox.setForceTrailingExpansion(); > if (expansionBehavior & ForceLeadingExpansion) >- inlineBox.setForceLeadingExpansion(); >+ inlineTextBox.setForceLeadingExpansion(); > } > > void generateLineBoxTree(RenderBlockFlow& flow, const Layout& layout) >@@ -348,7 +351,7 @@ void generateLineBoxTree(RenderBlockFlow& flow, const Layout& layout) > // Set the geometry for the inlineboxes. > for (auto* inlineBox = rootLineBox.firstChild(); inlineBox && it != range.end(); inlineBox = inlineBox->nextOnLine(), ++it) { > auto run = *it; >- initializeInlineBox(*inlineBox, run); >+ initializeInlineTextBox(flow, downcast<InlineTextBox>(*inlineBox), run); > lineWidth += inlineBox->logicalWidth(); > } > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index c0b2e457f0f773484941def29ca239fc425e2832..4d20a6aaf20a64eb3be56b8601c7656c0d63ac9e 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2018-04-30 Zalan Bujtas <zalan@apple.com> >+ >+ REGRESSION(r230914) Selecting text on this apple.com page makes it vanish >+ https://bugs.webkit.org/show_bug.cgi?id=185142 >+ <rdar://problem/39821446> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/text/simple-line-layout-selection-with-overflow-expected.html: Added. >+ * fast/text/simple-line-layout-selection-with-overflow.html: Added. >+ > 2018-04-27 Ryan Haddad <ryanhaddad@apple.com> > > Unreviewed test gardening for iOS and macOS. >diff --git a/LayoutTests/fast/text/simple-line-layout-selection-with-overflow-expected.html b/LayoutTests/fast/text/simple-line-layout-selection-with-overflow-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..8cf45148d8239587fc9dfc5299903d37dbe0a72b >--- /dev/null >+++ b/LayoutTests/fast/text/simple-line-layout-selection-with-overflow-expected.html >@@ -0,0 +1,17 @@ >+<style> >+body{ >+ letter-spacing: -1px; >+ font-height: 10px; >+} >+</style> >+<div id=textWithLetterSpacing>Pass if text does not disappear after the range selection.</div> >+<script> >+if (window.internals) >+ internals.settings.setSimpleLineLayoutEnabled(false); >+document.body.offsetHeight; >+ >+var range = document.createRange(); >+range.setStart(textWithLetterSpacing.firstChild, 0); >+range.setEnd(textWithLetterSpacing.firstChild, 5); >+window.getSelection().addRange(range); >+</script> >\ No newline at end of file >diff --git a/LayoutTests/fast/text/simple-line-layout-selection-with-overflow.html b/LayoutTests/fast/text/simple-line-layout-selection-with-overflow.html >new file mode 100644 >index 0000000000000000000000000000000000000000..02562042316a37c09e4d6992903a8036500f3a5a >--- /dev/null >+++ b/LayoutTests/fast/text/simple-line-layout-selection-with-overflow.html >@@ -0,0 +1,15 @@ >+<style> >+div { >+ letter-spacing: -1px; >+ font-height: 10px; >+} >+</style> >+<div id=textWithLetterSpacing>Pass if text does not disappear after the range selection.</div> >+<script> >+document.body.offsetHeight; >+ >+var range = document.createRange(); >+range.setStart(textWithLetterSpacing.firstChild, 0); >+range.setEnd(textWithLetterSpacing.firstChild, 5); >+window.getSelection().addRange(range); >+</script> >\ No newline at end of file
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185142
: 339147