Changeset 192477 in webkit
- Timestamp:
- Nov 16, 2015 11:04:02 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r192473 r192477 1 2015-11-16 Jiewen Tan <jiewen_tan@apple.com> 2 3 Null-pointer dereference in WebCore::firstEditablePositionAfterPositionInRoot 4 https://bugs.webkit.org/show_bug.cgi?id=151288 5 <rdar://problem/23450367> 6 7 Reviewed by Darin Adler. 8 9 * editing/execCommand/justify-right-then-indent-with-problematic-body-expected.txt: Added. 10 * editing/execCommand/justify-right-then-indent-with-problematic-body.html: Added. 11 * editing/execCommand/justify-right-with-problematic-body-expected.txt: Added. 12 * editing/execCommand/justify-right-with-problematic-body.html: Added. 13 1 14 2015-11-16 Ryan Haddad <ryanhaddad@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r192476 r192477 1 2015-11-16 Jiewen Tan <jiewen_tan@apple.com> 2 3 Null-pointer dereference in WebCore::firstEditablePositionAfterPositionInRoot 4 https://bugs.webkit.org/show_bug.cgi?id=151288 5 <rdar://problem/23450367> 6 7 Reviewed by Darin Adler. 8 9 Some problematic organization of body element could cause problems to JustifyRight 10 and Indent commnads. 11 12 Tests: editing/execCommand/justify-right-then-indent-with-problematic-body.html 13 editing/execCommand/justify-right-with-problematic-body.html 14 15 * editing/CompositeEditCommand.cpp: 16 (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): 17 Assertion at l1017 is not held anymore with the testcase: 18 editing/execCommand/justify-right-with-problematic-body.html. 19 Therefore, change it to an if statement. 20 Also, add a guardance before calling insertNewDefaultParagraphElementAt() 21 as insertNodeAt() requires an editable position. 22 (WebCore::CompositeEditCommand::moveParagraphWithClones): 23 Add a guardance before calling insertNodeAt() as it requires an editable position. 24 * editing/htmlediting.cpp: 25 (WebCore::firstEditablePositionAfterPositionInRoot): 26 (WebCore::lastEditablePositionBeforePositionInRoot): 27 1 28 2015-11-16 Simon Fraser <simon.fraser@apple.com> 2 29 -
trunk/Source/WebCore/editing/CompositeEditCommand.cpp
r192170 r192477 1013 1013 } 1014 1014 } else if (enclosingBlock(upstreamEnd.deprecatedNode()) != upstreamStart.deprecatedNode()) { 1015 // The visibleEnd. It must be an ancestor of the paragraph start.1016 // We can bail as we have a full block to work with.1017 ASSERT(upstreamStart.deprecatedNode()->isDescendantOf(enclosingBlock(upstreamEnd.deprecatedNode())));1018 return nullptr;1015 // The visibleEnd. If it is an ancestor of the paragraph start, then 1016 // we can bail as we have a full block to work with. 1017 if (upstreamStart.deprecatedNode()->isDescendantOf(enclosingBlock(upstreamEnd.deprecatedNode()))) 1018 return nullptr; 1019 1019 } else if (isEndOfEditableOrNonEditableContent(visibleEnd)) { 1020 1020 // At the end of the editable region. We can bail here as well. … … 1023 1023 } 1024 1024 1025 // If upstreamStart is not editable, then we can bail here. 1026 if (!isEditablePosition(upstreamStart)) 1027 return nullptr; 1025 1028 RefPtr<Node> newBlock = insertNewDefaultParagraphElementAt(upstreamStart); 1026 1029 … … 1198 1201 1199 1202 if (beforeParagraph.isNotNull() && !isRenderedTable(beforeParagraph.deepEquivalent().deprecatedNode()) 1200 && ((!isEndOfParagraph(beforeParagraph) && !isStartOfParagraph(beforeParagraph)) || beforeParagraph == afterParagraph)) { 1203 && ((!isEndOfParagraph(beforeParagraph) && !isStartOfParagraph(beforeParagraph)) || beforeParagraph == afterParagraph) 1204 && isEditablePosition(beforeParagraph.deepEquivalent())) { 1201 1205 // FIXME: Trim text between beforeParagraph and afterParagraph if they aren't equal. 1202 1206 insertNodeAt(createBreakElement(document()), beforeParagraph.deepEquivalent()); -
trunk/Source/WebCore/editing/htmlediting.cpp
r192043 r192477 288 288 Position firstEditablePositionAfterPositionInRoot(const Position& position, Node* highestRoot) 289 289 { 290 if (!highestRoot) 291 return Position(); 292 290 293 // position falls before highestRoot. 291 294 if (comparePositions(position, firstPositionInNode(highestRoot)) == -1 && highestRoot->hasEditableStyle()) … … 313 316 Position lastEditablePositionBeforePositionInRoot(const Position& position, Node* highestRoot) 314 317 { 318 if (!highestRoot) 319 return Position(); 320 315 321 // When position falls after highestRoot, the result is easy to compute. 316 322 if (comparePositions(position, lastPositionInNode(highestRoot)) == 1)
Note: See TracChangeset
for help on using the changeset viewer.