WebKit Bugzilla
Attachment 342361 Details for
Bug 186454
: REGRESSION(macOS Mojave): move-by-word-visually-multi-line.html fails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP2
wip186454b.patch (text/plain), 10.65 KB, created by
Ryosuke Niwa
on 2018-06-08 23:06:04 PDT
(
hide
)
Description:
WIP2
Filename:
MIME Type:
Creator:
Ryosuke Niwa
Created:
2018-06-08 23:06:04 PDT
Size:
10.65 KB
patch
obsolete
>diff --git a/LayoutTests/editing/selection/move-by-word-visually-mac-expected.txt b/LayoutTests/editing/selection/move-by-word-visually-mac-expected.txt >index 5cedefd92fa..dfae7d2fb3f 100644 >--- a/LayoutTests/editing/selection/move-by-word-visually-mac-expected.txt >+++ b/LayoutTests/editing/selection/move-by-word-visually-mac-expected.txt >@@ -92,30 +92,35 @@ Move right by one word > "AAA kj AAA mn opq AAA AAA"[25, 22, 18, 14, 11, 7, 4, 0], " abc def AAA AAA hij AAA AAA uvw xyz "[32, 29, 25, 21, 17, 13, 9, 4, 1] > Test 19, LTR: > Move right by one word >+"abc"[0, 3], "Â def"[4] >+Move left by one word >+"Â def"[4, 1], "abc"[0] >+Test 20, LTR: >+Move right by one word > "abc def hij opq"[0, 3, 7, 14, 18] > Move left by one word > "abc def hij opq"[18, 15, 8, 4, 0] >-Test 20, LTR: >+Test 21, LTR: > Move right by one word > " abc def hij opq "[4, 7, 14, 21, 28] > Move left by one word > " abc def hij opq "[28, 22, 15, 8, 4] >-Test 21, RTL: >+Test 22, RTL: > Move left by one word > " abc def hij ABW DSU EJH opq rst uvw "[0, 18, 11, 21, 28, 35, 42, 60, 53, 63, 67] > Move right by one word > " abc def hij ABW DSU EJH opq rst uvw "[67, 49, 56, 46, 39, 32, 25, 7, 14, 4, 0] >-Test 22, RTL: >+Test 23, RTL: > Move left by one word > " ABW DSU HJH FUX "[0, 7, 14, 21, 28, 32] > Move right by one word > " ABW DSU HJH FUX "[32, 25, 18, 11, 4, 0] >-Test 23, RTL: >+Test 24, RTL: > Move left by one word > "abc def "[0], " rst uvw"[5, 1], "hij opq"[4], "abc def "[8, 4], " rst uvw"[8] > Move right by one word > " rst uvw"[8], "abc def "[3, 7], "hij opq"[3, 7], " rst uvw"[4], "abc def "[0] >-Test 24, RTL: >+Test 25, RTL: > Move left by one word > "ABD opq rst DSU "[0, 3, 8, 11, 15], "abc uvw AAA def lmn"[16, 12, 11, 4, 19], "ABW hij xyz FXX"[3, 8, 11, 15] FAIL expected: ["ABD opq rst DSU "[ 0, 3, 8, 11, 15, ]"abc uvw AAA def lmn"[ 16, 12, 11, 4, ]"ABW hij xyz FXX"[ 3, 8, 11, 15] > "abc uvw AAA def lmn"[4, 19] FAIL expected "ABW hij xyz FXX"[ 3] >diff --git a/LayoutTests/editing/selection/move-by-word-visually-mac.html b/LayoutTests/editing/selection/move-by-word-visually-mac.html >index 342a99c8288..d583aa9d01b 100644 >--- a/LayoutTests/editing/selection/move-by-word-visually-mac.html >+++ b/LayoutTests/editing/selection/move-by-word-visually-mac.html >@@ -73,6 +73,8 @@ where child_node_index is optional default is the first child of the anchor node > [ml_12, 25, 5][ml_12, 22, 5][ml_12, 18, 5][ml_12, 14, 5][ml_12, 11, 5][ml_12, 7, 5][ml_12, 4, 5][ml_12, 0, 5][ml_12, 32][ml_12, 29][ml_12, 25][ml_12, 21][ml_12, 17][ml_12, 13][ml_12, 9][ml_12, 4][ml_12, 1]|[ml_12, 1][ml_12, 5][ml_12, 8][ml_12, 12][ml_12, 16][ml_12, 20][ml_12, 24][ml_12, 28][ml_12, 33][ml_12, 36][ml_12, 3, 5][ml_12, 6, 5][ml_12, 10, 5][ml_12, 13, 5][ml_12, 17, 5][ml_12, 21, 5][ml_12, 25, 5] > "> abc def ××× ××× hij ××× ××× uvw xyz <div><br/></div><div><br/></div><div><br/></div>××× kj ××× mn opq ××× ×××</div> > >+<div contenteditable dir=ltr id="ml_16" class="test_move_by_word" title="[ml_16, 0][ml_16, 3][ml_16, 4, 4]|[ml_16, 4, 4][ml_16, 1, 4][ml_16, 0]">abc<br><br> def</div> >+ > <!-- test multispaces --> > <div dir=ltr class="test_move_by_word" title="0 3 7 14 18|18 15 8 4 0" contenteditable>abc def hij opq</div> > >diff --git a/LayoutTests/editing/selection/move-by-word-visually-multi-line-expected.txt b/LayoutTests/editing/selection/move-by-word-visually-multi-line-expected.txt >index 6ba17a72283..918d0da1181 100644 >--- a/LayoutTests/editing/selection/move-by-word-visually-multi-line-expected.txt >+++ b/LayoutTests/editing/selection/move-by-word-visually-multi-line-expected.txt >@@ -77,15 +77,20 @@ Move left by one word > "opq rst uvw xyz"[15, 12, 8, 4, 0], "abc def ghi jkl mn "[16, 12, 8, 4, 0] > Test 16, LTR: > Move right by one word >+"abc"[0], "Â def"[1, 4] >+Move left by one word >+"Â def"[4, 1], "abc"[0] >+Test 17, LTR: >+Move right by one word > "abc def "[0, 4, 8] > Move left by one word > " hij opq"[8, 5, 1] >-Test 17, LTR: >+Test 18, LTR: > Move right by one word > <DIV>[0] > Move left by one word > <DIV>[0] >-Test 18, LTR: >+Test 19, LTR: > Move right by one word > "\n00"[3] > Move left by one word >diff --git a/LayoutTests/editing/selection/move-by-word-visually-multi-line.html b/LayoutTests/editing/selection/move-by-word-visually-multi-line.html >index 769821c4c90..8a54c38a33e 100644 >--- a/LayoutTests/editing/selection/move-by-word-visually-multi-line.html >+++ b/LayoutTests/editing/selection/move-by-word-visually-multi-line.html >@@ -74,6 +74,8 @@ where child_node_index is optional, default is the first child of the anchor nod > > <div contenteditable dir=ltr id="ml_15" class="test_move_by_word fix_width" title="[ml_15, 0][ml_15, 4][ml_15, 8][ml_15, 12][ml_15, 16][ml_15, 0, 5][ml_15, 4, 5][ml_15, 8, 5][ml_15, 12, 5][ml_15, 15, 5]|[ml_15, 15, 5][ml_15, 12, 5][ml_15, 8, 5][ml_15, 4, 5][ml_15, 0, 5][ml_15, 16][ml_15, 12][ml_15, 8][ml_15, 4][ml_15, 0]">abc def ghi jkl mn <div><img src=../../accessibility/resources/cake.png></div><div></div><div></div>opq rst uvw xyz</div> > >+<div contenteditable dir=ltr id="ml_16" class="test_move_by_word" title="[ml_16, 0][ml_16, 1, 4][ml_16, 4, 4]|[ml_16, 4, 4][ml_16, 1, 4][ml_16, 0]">abc<br><br> def</div> >+ > <!-- mixed editability --> > <div dir=ltr class="test_move_by_word" title="0 4 8|8 5 1">abc def <span contenteditable> inside span </span> hij opq</div> > >diff --git a/Source/WebCore/editing/VisibleUnits.cpp b/Source/WebCore/editing/VisibleUnits.cpp >index 55f2b708690..2d1a2997471 100644 >--- a/Source/WebCore/editing/VisibleUnits.cpp >+++ b/Source/WebCore/editing/VisibleUnits.cpp >@@ -125,15 +125,15 @@ class CachedLogicallyOrderedLeafBoxes { > public: > CachedLogicallyOrderedLeafBoxes(); > >- const InlineBox* previousTextOrLineBreakBox(const RootInlineBox*, const InlineTextBox*); >- const InlineBox* nextTextOrLineBreakBox(const RootInlineBox*, const InlineTextBox*); >+ const InlineBox* previousTextOrLineBreakBox(const RootInlineBox*, const InlineBox*); >+ const InlineBox* nextTextOrLineBreakBox(const RootInlineBox*, const InlineBox*); > > size_t size() const { return m_leafBoxes.size(); } > const InlineBox* firstBox() const { return m_leafBoxes[0]; } > > private: > const Vector<InlineBox*>& collectBoxes(const RootInlineBox*); >- int boxIndexInLeaves(const InlineTextBox*) const; >+ int boxIndexInLeaves(const InlineBox*) const; > > const RootInlineBox* m_rootInlineBox { nullptr }; > Vector<InlineBox*> m_leafBoxes; >@@ -143,7 +143,7 @@ CachedLogicallyOrderedLeafBoxes::CachedLogicallyOrderedLeafBoxes() > { > } > >-const InlineBox* CachedLogicallyOrderedLeafBoxes::previousTextOrLineBreakBox(const RootInlineBox* root, const InlineTextBox* box) >+const InlineBox* CachedLogicallyOrderedLeafBoxes::previousTextOrLineBreakBox(const RootInlineBox* root, const InlineBox* box) > { > if (!root) > return nullptr; >@@ -164,7 +164,7 @@ const InlineBox* CachedLogicallyOrderedLeafBoxes::previousTextOrLineBreakBox(con > return nullptr; > } > >-const InlineBox* CachedLogicallyOrderedLeafBoxes::nextTextOrLineBreakBox(const RootInlineBox* root, const InlineTextBox* box) >+const InlineBox* CachedLogicallyOrderedLeafBoxes::nextTextOrLineBreakBox(const RootInlineBox* root, const InlineBox* box) > { > if (!root) > return nullptr; >@@ -196,7 +196,7 @@ const Vector<InlineBox*>& CachedLogicallyOrderedLeafBoxes::collectBoxes(const Ro > return m_leafBoxes; > } > >-int CachedLogicallyOrderedLeafBoxes::boxIndexInLeaves(const InlineTextBox* box) const >+int CachedLogicallyOrderedLeafBoxes::boxIndexInLeaves(const InlineBox* box) const > { > for (size_t i = 0; i < m_leafBoxes.size(); ++i) { > if (box == m_leafBoxes[i]) >@@ -205,7 +205,7 @@ int CachedLogicallyOrderedLeafBoxes::boxIndexInLeaves(const InlineTextBox* box) > return 0; > } > >-static const InlineBox* logicallyPreviousBox(const VisiblePosition& visiblePosition, const InlineTextBox* textBox, >+static const InlineBox* logicallyPreviousBox(const VisiblePosition& visiblePosition, const InlineBox* textBox, > bool& previousBoxInDifferentBlock, CachedLogicallyOrderedLeafBoxes& leafBoxes) > { > const InlineBox* startBox = textBox; >@@ -246,7 +246,7 @@ static const InlineBox* logicallyPreviousBox(const VisiblePosition& visiblePosit > } > > >-static const InlineBox* logicallyNextBox(const VisiblePosition& visiblePosition, const InlineTextBox* textBox, >+static const InlineBox* logicallyNextBox(const VisiblePosition& visiblePosition, const InlineBox* textBox, > bool& nextBoxInDifferentBlock, CachedLogicallyOrderedLeafBoxes& leafBoxes) > { > const InlineBox* startBox = textBox; >@@ -293,6 +293,11 @@ static UBreakIterator* wordBreakIteratorForMinOffsetBoundary(const VisiblePositi > > // FIXME: Handle the case when we don't have an inline text box. > const InlineBox* previousBox = logicallyPreviousBox(visiblePosition, textBox, previousBoxInDifferentBlock, leafBoxes); >+ while (previousBox && !is<InlineTextBox>(previousBox)) { >+ ASSERT(previousBox->renderer().isBR()); >+ previousBoxInDifferentBlock = true; >+ previousBox = logicallyPreviousBox(visiblePosition, previousBox, previousBoxInDifferentBlock, leafBoxes); >+ } > > string.clear(); > >@@ -313,6 +318,11 @@ static UBreakIterator* wordBreakIteratorForMaxOffsetBoundary(const VisiblePositi > > // FIXME: Handle the case when we don't have an inline text box. > const InlineBox* nextBox = logicallyNextBox(visiblePosition, textBox, nextBoxInDifferentBlock, leafBoxes); >+ while (nextBox && !is<InlineTextBox>(nextBox)) { >+ ASSERT(nextBox->renderer().isBR()); >+ nextBoxInDifferentBlock = true; >+ nextBox = logicallyNextBox(visiblePosition, nextBox, nextBoxInDifferentBlock, leafBoxes); >+ } > > string.clear(); > append(string, StringView(textBox->renderer().text()).substring(textBox->start(), textBox->len())); >@@ -405,9 +415,13 @@ static VisiblePosition visualWordPosition(const VisiblePosition& visiblePosition > || (!skipsSpaceWhenMovingRight && movingBackward)) { > bool logicalStartInRenderer = offsetInBox == static_cast<int>(textBox.start()) && previousBoxInDifferentBlock; > isWordBreak = isLogicalStartOfWord(iter, offsetInIterator, logicalStartInRenderer); >+ if (isWordBreak && offsetInBox == box->caretMaxOffset() && nextBoxInDifferentBlock) >+ isWordBreak = false; > } else { > bool logicalEndInRenderer = offsetInBox == static_cast<int>(textBox.start() + textBox.len()) && nextBoxInDifferentBlock; > isWordBreak = islogicalEndOfWord(iter, offsetInIterator, logicalEndInRenderer); >+ if (isWordBreak && offsetInBox == box->caretMinOffset() && previousBoxInDifferentBlock) >+ isWordBreak = false; > } > > if (isWordBreak)
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 186454
:
342359
|
342361
|
342362
|
342363