Changeset 271635 in webkit
- Timestamp:
- Jan 19, 2021 6:00:03 PM (18 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/editing/execCommand/null_calc_primitive_value_for_css_property.html (modified) (1 diff)
-
LayoutTests/editing/inserting/insert-list-in-table-cell-07-expected.txt (modified) (3 diffs)
-
LayoutTests/editing/selection/editable-table-cell-selection-expected.txt (added)
-
LayoutTests/editing/selection/editable-table-cell-selection.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/PositionIterator.cpp (modified) (1 diff)
-
Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r271618 r271635 1 2021-01-19 Megan Gardner <megan_gardner@apple.com> 2 3 Elements in a table are incorrectly selected in JavaScript. 4 https://bugs.webkit.org/show_bug.cgi?id=220607 5 6 Reviewed by Wenson Hsieh. 7 8 * editing/execCommand/null_calc_primitive_value_for_css_property.html: 9 Added ending tag that was missing and does not affect the issue the test was verifying. 10 * editing/inserting/insert-list-in-table-cell-07-expected.txt: 11 Restored expected text file to original output. 12 * editing/selection/editable-table-cell-selection-expected.txt: Added. 13 * editing/selection/editable-table-cell-selection.html: Added. 14 1 15 2021-01-19 Sergio Villar Senin <svillar@igalia.com> 2 16 -
trunk/LayoutTests/editing/execCommand/null_calc_primitive_value_for_css_property.html
r261830 r271635 17 17 18 18 <body onload=cssPrimitiveValTest()> 19 <ins id="x"> 19 <ins id="x"></ins> 20 20 21 21 </body> -
trunk/LayoutTests/editing/inserting/insert-list-in-table-cell-07-expected.txt
r267362 r271635 2 2 3 3 Before: 4 | <#selection-focus>5 4 | <table> 6 5 | border="1" … … 18 17 | "fsfg" 19 18 | <tbody> 19 | <#selection-focus> 20 20 21 21 After: … … 26 26 | <tr> 27 27 | <td> 28 | "<#selection- caret>fsdf"28 | "<#selection-anchor>fsdf" 29 29 | <br> 30 30 | <td> 31 31 | "fsdf" 32 | <br> 32 33 | <tr> 33 34 | <td> 34 35 | "gghfg" 36 | <br> 35 37 | <td> 36 | "fsfg" 38 | "fsfg<#selection-focus>" 39 | <br> 37 40 | <tbody> -
trunk/Source/WebCore/ChangeLog
r271620 r271635 1 2021-01-19 Megan Gardner <megan_gardner@apple.com> 2 3 Elements in a table are incorrectly selected in JavaScript. 4 https://bugs.webkit.org/show_bug.cgi?id=220607 5 6 Reviewed by Wenson Hsieh. 7 8 After the fix for https://bugs.webkit.org/show_bug.cgi?id=130844 in https://trac.webkit.org/changeset/260207/webkit a regression was found for 9 table cell selections through JavaScript. The previous fix was for an issue in the difference between how PositionIterator and Position calculated 10 if it was canonical (::isCandidate) in the cases where the renderer was a BR. Instead of only converging isCandidate for BR, this function in PositionIterator 11 was completely subsumed by just calling the implementation for Position. While there are many similarities, there are important differences, especially in the 12 table code, therefore PositionIterator::isCandidate is being reinstated, but with the convergence in the BR case only. 13 Also, moved the check added in http://webkit.org/b/211864 so it will cover cases that were missed due to this code being wrong while that fix was added. 14 15 Test: editing/selection/editable-table-cell-selection.html 16 17 * dom/PositionIterator.cpp: 18 (WebCore::PositionIterator::isCandidate const): 19 * editing/InsertParagraphSeparatorCommand.cpp: 20 (WebCore::InsertParagraphSeparatorCommand::doApply): 21 22 1 23 2021-01-19 Patrick Angle <pangle@apple.com> 2 24 -
trunk/Source/WebCore/dom/PositionIterator.cpp
r267363 r271635 146 146 bool PositionIterator::isCandidate() const 147 147 { 148 return m_anchorNode ? Position(*this).isCandidate() : false; 148 if (!m_anchorNode) 149 return false; 150 151 RenderObject* renderer = m_anchorNode->renderer(); 152 if (!renderer) 153 return false; 154 155 if (renderer->style().visibility() != Visibility::Visible) 156 return false; 157 158 if (renderer->isBR()) 159 return Position(*this).isCandidate(); 160 161 if (is<RenderText>(*renderer)) 162 return !Position::nodeIsUserSelectNone(m_anchorNode) && downcast<RenderText>(*renderer).containsCaretOffset(m_offsetInAnchor); 163 164 if (isRenderedTable(m_anchorNode) || editingIgnoresContent(*m_anchorNode)) 165 return (atStartOfNode() || atEndOfNode()) && !Position::nodeIsUserSelectNone(m_anchorNode->parentNode()); 166 167 if (!is<HTMLHtmlElement>(*m_anchorNode) && is<RenderBlockFlow>(*renderer)) { 168 RenderBlockFlow& block = downcast<RenderBlockFlow>(*renderer); 169 if (block.logicalHeight() || is<HTMLBodyElement>(*m_anchorNode)) { 170 if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(block)) 171 return atStartOfNode() && !Position::nodeIsUserSelectNone(m_anchorNode); 172 return m_anchorNode->hasEditableStyle() && !Position::nodeIsUserSelectNone(m_anchorNode) && Position(*this).atEditingBoundary(); 173 } 174 } 175 176 return false; 149 177 } 150 178 -
trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp
r266557 r271635 201 201 bool nestNewBlock = false; 202 202 203 // FIXME: <http://webkit.org/b/211864> If insertionPosition is not editable, we should compute a position that is. 204 if (!isEditablePosition(insertionPosition)) 205 return; 206 203 207 // Create block to be inserted. 204 208 RefPtr<Element> blockToInsert; … … 299 303 // content will move down a line. 300 304 if (isStartOfParagraph(visiblePos)) { 301 // FIXME: <http://webkit.org/b/211864> If insertionPosition is not editable, we should compute a position that is.302 if (!isEditablePosition(insertionPosition))303 return;304 305 305 auto br = HTMLBRElement::create(document()); 306 306 auto* brPtr = br.ptr();
Note: See TracChangeset
for help on using the changeset viewer.