Test case at http://persistent.info/webkit/test-cases/contenteditable-select-all-bug.html Doing a "select all" operation (either from the keyboard or the edit menu) while the cursor is in the "content content..." paragraph does not work as expected in the first contenteditable area. Instead, the cursor is moved to the end of the area. This appears to be triggered by the first element in the in the contenteditable="true" container being a contenteditable="false" div (the red rectangle). If that node is editable (the green rectangle version), then everything works as expected. I expect this is a bug in highestEditableRoot in htmlediting.cpp, or somewhere around there. I can reproduce this in Safari 6.0.2 and Chrome 26.0.1386.0.
Created attachment 211767 [details] Patch
Comment on attachment 211767 [details] Patch Attachment 211767 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/1810253 New failing tests: editing/execCommand/format-block-contenteditable-false.html editing/selection/extend-forward-by-word-over-non-editable.html editing/selection/5825350-1.html editing/selection/user-select-all-selection.html editing/selection/select-all-with-div-noneditable.html editing/selection/skip-non-editable-2.html editing/selection/mixed-editability-9.html editing/selection/5825350-2.html editing/selection/editable-non-editable-crash.html editing/deleting/delete-uneditable-style.html editing/selection/5099303.html editing/selection/4895428-4.html editing/selection/mixed-editability-2.html editing/selection/skip-non-editable-1.html
Created attachment 211772 [details] Archive of layout-test-results from webkit-ews-14 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-14 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Comment on attachment 211767 [details] Patch Attachment 211767 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/1799095 New failing tests: editing/execCommand/format-block-contenteditable-false.html editing/selection/extend-forward-by-word-over-non-editable.html editing/selection/5825350-1.html editing/selection/user-select-all-selection.html editing/selection/select-all-with-div-noneditable.html editing/selection/skip-non-editable-2.html editing/selection/mixed-editability-9.html editing/selection/5825350-2.html editing/selection/editable-non-editable-crash.html editing/deleting/delete-uneditable-style.html editing/selection/5099303.html editing/selection/4895428-4.html editing/selection/mixed-editability-2.html editing/selection/skip-non-editable-1.html
Created attachment 211775 [details] Archive of layout-test-results from webkit-ews-05 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-05 Port: mac-mountainlion Platform: Mac OS X 10.8.5
It seems like tests are failing.
Created attachment 212342 [details] JustTestingPatch
Comment on attachment 212342 [details] JustTestingPatch Attachment 212342 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/1892421 New failing tests: editing/selection/select-all-with-div-noneditable.html platform/mac/editing/input/range-for-empty-document.html platform/mac/accessibility/document-attributes.html fast/block/float/relative-painted-twice.html
Created attachment 212345 [details] Archive of layout-test-results from webkit-ews-04 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-04 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Comment on attachment 212342 [details] JustTestingPatch Attachment 212342 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/2042054 New failing tests: editing/selection/select-all-with-div-noneditable.html platform/mac/editing/input/range-for-empty-document.html platform/mac/accessibility/document-attributes.html fast/block/float/relative-painted-twice.html
Created attachment 212347 [details] Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-16 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Comment on attachment 212342 [details] JustTestingPatch Attachment 212342 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/1816306 New failing tests: editing/selection/select-all-with-div-noneditable.html platform/mac/editing/input/range-for-empty-document.html platform/mac/accessibility/document-attributes.html fast/block/float/relative-painted-twice.html
Created attachment 212351 [details] Archive of layout-test-results from webkit-ews-03 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-03 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Created attachment 212444 [details] Under Construction
Comment on attachment 212444 [details] Under Construction Attachment 212444 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/1960207 New failing tests: editing/selection/select-all-with-div-noneditable.html fast/block/float/relative-painted-twice.html
Created attachment 212449 [details] Archive of layout-test-results from webkit-ews-09 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-09 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Comment on attachment 212444 [details] Under Construction Attachment 212444 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/2075202 New failing tests: editing/selection/select-all-with-div-noneditable.html fast/block/float/relative-painted-twice.html
Created attachment 212451 [details] Archive of layout-test-results from webkit-ews-04 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-04 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Comment on attachment 212444 [details] Under Construction Attachment 212444 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/1806336 New failing tests: editing/selection/select-all-with-div-noneditable.html fast/block/float/relative-painted-twice.html
Created attachment 212452 [details] Archive of layout-test-results from webkit-ews-01 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-01 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Created attachment 212463 [details] Patch
Comment on attachment 212463 [details] Patch Attachment 212463 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/2062292 New failing tests: fast/html/details-remove-summary-5-and-click.html fast/multicol/hit-test-gap-between-pages-flipped.html fast/html/details-add-summary-5-and-click.html fast/html/details-add-summary-6-and-click.html fast/writing-mode/flipped-blocks-hit-test-overflow-scroll.html fast/multicol/hit-test-block-axis-flipped.html fast/html/details-add-summary-3-and-click.html fast/html/details-add-summary-10-and-click.html fast/html/details-remove-summary-3-and-click.html editing/selection/select-all-with-div-noneditable.html fast/html/details-add-summary-8-and-click.html fast/html/details-remove-summary-2-and-click.html fast/html/details-remove-summary-4-and-click.html fast/html/details-add-summary-1-and-click.html fast/html/details-add-summary-2-and-click.html fast/html/details-remove-summary-6-and-click.html fast/html/details-add-summary-7-and-click.html fast/html/details-add-summary-9-and-click.html fast/multicol/hit-test-gap-between-pages.html fast/html/details-remove-summary-1-and-click.html fast/writing-mode/flipped-blocks-hit-test-box-edges.html fast/html/details-add-summary-4-and-click.html fast/block/float/relative-painted-twice.html fast/writing-mode/positionForPoint.html
Created attachment 212465 [details] Archive of layout-test-results from webkit-ews-11 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-11 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Comment on attachment 212463 [details] Patch Attachment 212463 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/1806372 New failing tests: fast/html/details-remove-summary-5-and-click.html fast/multicol/hit-test-gap-between-pages-flipped.html fast/html/details-add-summary-5-and-click.html fast/html/details-add-summary-6-and-click.html fast/writing-mode/flipped-blocks-hit-test-overflow-scroll.html fast/multicol/hit-test-block-axis-flipped.html fast/html/details-add-summary-3-and-click.html fast/html/details-add-summary-10-and-click.html fast/html/details-remove-summary-3-and-click.html editing/selection/select-all-with-div-noneditable.html fast/html/details-add-summary-8-and-click.html fast/html/details-remove-summary-2-and-click.html fast/html/details-remove-summary-4-and-click.html fast/html/details-add-summary-1-and-click.html fast/html/details-add-summary-2-and-click.html fast/html/details-remove-summary-6-and-click.html fast/html/details-add-summary-7-and-click.html fast/html/details-add-summary-9-and-click.html fast/multicol/hit-test-gap-between-pages.html fast/html/details-remove-summary-1-and-click.html fast/writing-mode/flipped-blocks-hit-test-box-edges.html fast/html/details-add-summary-4-and-click.html fast/block/float/relative-painted-twice.html fast/writing-mode/positionForPoint.html
Created attachment 212467 [details] Archive of layout-test-results from webkit-ews-07 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-07 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Comment on attachment 212463 [details] Patch Attachment 212463 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/2004633 New failing tests: fast/html/details-remove-summary-5-and-click.html fast/multicol/hit-test-gap-between-pages-flipped.html fast/html/details-add-summary-5-and-click.html fast/html/details-add-summary-6-and-click.html fast/writing-mode/flipped-blocks-hit-test-overflow-scroll.html fast/multicol/hit-test-block-axis-flipped.html fast/html/details-add-summary-3-and-click.html fast/html/details-add-summary-10-and-click.html fast/html/details-remove-summary-3-and-click.html editing/selection/select-all-with-div-noneditable.html fast/html/details-add-summary-8-and-click.html fast/html/details-remove-summary-2-and-click.html fast/html/details-remove-summary-4-and-click.html fast/html/details-add-summary-1-and-click.html fast/html/details-add-summary-2-and-click.html fast/html/details-remove-summary-6-and-click.html fast/html/details-add-summary-7-and-click.html fast/html/details-add-summary-9-and-click.html fast/multicol/hit-test-gap-between-pages.html fast/html/details-remove-summary-1-and-click.html fast/writing-mode/flipped-blocks-hit-test-box-edges.html fast/html/details-add-summary-4-and-click.html fast/block/float/relative-painted-twice.html fast/writing-mode/positionForPoint.html
Created attachment 212472 [details] Archive of layout-test-results from webkit-ews-08 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-08 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Created attachment 212559 [details] UnderConstruction
Created attachment 212563 [details] Patch
Created attachment 212567 [details] Patch
Comment on attachment 212567 [details] Patch Attachment 212567 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/2281012 New failing tests: editing/pasteboard/copy-null-characters.html accessibility/image-link.html editing/input/paste-text-ending-with-interchange-newline.html accessibility/table-one-cell.html compositing/reflections/remove-reflection.html accessibility/table-cells.html accessibility/image-map2.html accessibility/table-cell-spans.html editing/pasteboard/copy-paste-float.html accessibility/plugin.html editing/pasteboard/5665299.html editing/inserting/insert-images-in-pre-x-crash.html editing/selection/dump-as-markup.html accessibility/table-sections.html accessibility/table-detection.html editing/execCommand/crash-extend-selection-forward.html editing/selection/5354455-2.html accessibility/internal-link-anchors2.html accessibility/lists.html accessibility/table-attributes.html fast/dom/horizontal-scrollbar-in-rtl.html accessibility/transformed-element.html editing/deleting/delete-blockquote-large-offsets.html accessibility/table-with-aria-role.html editing/selection/5333725.html editing/pasteboard/copy-inside-h1-preserves-h1.html fast/backgrounds/selection-background-color.html editing/selection/contains-node-crash.html accessibility/table-with-rules.html fast/block/float/relative-painted-twice.html
Created attachment 212569 [details] Archive of layout-test-results from webkit-ews-15 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-15 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Comment on attachment 212567 [details] Patch Attachment 212567 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/2260044 New failing tests: editing/pasteboard/copy-null-characters.html accessibility/image-link.html editing/input/paste-text-ending-with-interchange-newline.html accessibility/table-one-cell.html compositing/reflections/remove-reflection.html accessibility/table-cells.html accessibility/image-map2.html accessibility/table-cell-spans.html editing/pasteboard/copy-paste-float.html accessibility/plugin.html editing/pasteboard/5665299.html editing/inserting/insert-images-in-pre-x-crash.html editing/selection/dump-as-markup.html accessibility/table-sections.html accessibility/table-detection.html editing/execCommand/crash-extend-selection-forward.html editing/selection/5354455-2.html accessibility/internal-link-anchors2.html accessibility/lists.html accessibility/table-attributes.html editing/pasteboard/paste-blockquote-before-blockquote.html accessibility/transformed-element.html editing/deleting/delete-blockquote-large-offsets.html accessibility/table-with-aria-role.html editing/selection/5333725.html editing/pasteboard/copy-inside-h1-preserves-h1.html fast/backgrounds/selection-background-color.html editing/selection/contains-node-crash.html accessibility/table-with-rules.html fast/block/float/relative-painted-twice.html
Created attachment 212575 [details] Archive of layout-test-results from webkit-ews-06 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-06 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Created attachment 212602 [details] Patch
Created attachment 212607 [details] Patch
Comment on attachment 212607 [details] Patch Attachment 212607 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/2162234 New failing tests: editing/execCommand/remove-list-1.html fast/css/image-set-value-not-removed-crash.html editing/inserting/insert-div-021.html fast/block/float/relative-painted-twice.html
Created attachment 212614 [details] Archive of layout-test-results from webkit-ews-09 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-09 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Comment on attachment 212607 [details] Patch Attachment 212607 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/2189061 New failing tests: editing/execCommand/remove-list-1.html fast/css/image-set-value-not-removed-crash.html editing/inserting/insert-div-021.html fast/block/float/relative-painted-twice.html
Created attachment 212619 [details] Archive of layout-test-results from webkit-ews-05 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-05 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Comment on attachment 212607 [details] Patch Attachment 212607 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/2243014 New failing tests: editing/execCommand/remove-list-1.html fast/css/image-set-value-not-removed-crash.html editing/inserting/insert-div-021.html fast/block/float/relative-painted-twice.html
Created attachment 212627 [details] Archive of layout-test-results from webkit-ews-04 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-04 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Created attachment 212659 [details] Patch
Comment on attachment 212659 [details] Patch Attachment 212659 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/2188149 New failing tests: editing/execCommand/remove-list-1.html platform/mac/editing/input/range-for-empty-document.html platform/mac/accessibility/document-attributes.html editing/deleting/delete-3775172-fix.html editing/inserting/insert-div-021.html editing/pasteboard/paste-RTFD.html fast/css/image-set-value-not-removed-crash.html editing/execCommand/indent-block-in-list.html editing/execCommand/35791.html editing/execCommand/infinite-recursion-computeRectForRepaint.html editing/selection/editable-html-element.html fast/block/float/relative-painted-twice.html fast/dom/remove-body-during-body-replacement2.html
Created attachment 212663 [details] Archive of layout-test-results from webkit-ews-09 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-09 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Comment on attachment 212659 [details] Patch Attachment 212659 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/2230151 New failing tests: editing/execCommand/remove-list-1.html platform/mac/editing/input/range-for-empty-document.html platform/mac/accessibility/document-attributes.html editing/deleting/delete-3775172-fix.html editing/inserting/insert-div-021.html editing/pasteboard/paste-RTFD.html fast/css/image-set-value-not-removed-crash.html editing/execCommand/indent-block-in-list.html editing/execCommand/35791.html editing/execCommand/infinite-recursion-computeRectForRepaint.html editing/selection/editable-html-element.html fast/block/float/relative-painted-twice.html fast/dom/remove-body-during-body-replacement2.html
Created attachment 212664 [details] Archive of layout-test-results from webkit-ews-05 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-05 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Created attachment 212679 [details] Patch
Comment on attachment 212679 [details] Patch Attachment 212679 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/2195267 New failing tests: editing/selection/select-all-with-div-noneditable.html fast/block/float/relative-painted-twice.html
Created attachment 212683 [details] Archive of layout-test-results from webkit-ews-13 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-13 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Comment on attachment 212679 [details] Patch Attachment 212679 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/2287088 New failing tests: editing/selection/select-all-with-div-noneditable.html fast/block/float/relative-painted-twice.html
Created attachment 212686 [details] Archive of layout-test-results from webkit-ews-04 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-04 Port: mac-mountainlion Platform: Mac OS X 10.8.5
The test fast/block/float/relative-painted-twice.html is faling. But I think we need to update the expected output of this test. --- /Volumes/Data/EWS/WebKit/WebKitBuild/Release/layout-test-results/fast/block/float/relative-painted-twice-expected.txt +++ /Volumes/Data/EWS/WebKit/WebKitBuild/Release/layout-test-results/fast/block/float/relative-painted-twice-actual.txt @@ -8,4 +8,3 @@ layer at (8,58) size 769x0 RenderBlock (relative positioned) {DIV} at (0,0) size 769x0 RenderBlock (floating) {DIV} at (0,0) size 100x100 [bgcolor=#0000007F] -caret: position 0 of child 1 {DIV} of child 1 {DIV} of child 1 {DIV} of body
Comment on attachment 212679 [details] Patch Can we do this as a reference test instead? The test is failing on the EWS bot, so something more has to be added to the patch before we can land it.
Created attachment 212894 [details] Patch
(In reply to comment #54) > (From update of attachment 212679 [details]) > Can we do this as a reference test instead? The test is failing on the EWS bot, so something more has to be added to the patch before we can land it. Thanks for review I have updated the patch.
Comment on attachment 212894 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=212894&action=review > Source/WebCore/ChangeLog:9 > + Test: editing/selection/select-all-with-div-noneditable.html > + This line should appear after the long description but before the list of files and function names. > Source/WebCore/ChangeLog:16 > + But editableRootPosition, highestRootEditablePosition and > + rootEditablePosition return 0 for nonediatble element due to which > + the check for position to be under same highestRootEditable element > + fails. This doesn't justify the change. Why should that matter at all? It appears to be that this is a bug in VisibleSelection, not PositionIterator.
> > > Source/WebCore/ChangeLog:9 > > + Test: editing/selection/select-all-with-div-noneditable.html > > + > > This line should appear after the long description but before the list of files and function names. Sorry I will update. > > > Source/WebCore/ChangeLog:16 > > + But editableRootPosition, highestRootEditablePosition and > > + rootEditablePosition return 0 for nonediatble element due to which > > + the check for position to be under same highestRootEditable element > > + fails. > > This doesn't justify the change. Why should that matter at all? It appears to be that this is a bug in VisibleSelection, not PositionIterator. Why you think that cause of issue is around VisibleSelection? What I found is: <div id= = "1" contenteditable = true> <div id = "2" contenteditable = false> </div> <p>This is candidate</p> </div> In above scenario the selectAll range startPosition anchornode is div(id = "2") and end position is <p>. since div(id="2") is disable the check that div and p are under same editableContent(div id ="1") fails setting startPosition to NULL (in Cannonical position) and if startposition is NULL we make it equal to end position. so final selection is caret selection. and the fix is in isCandidate() Basically I am ignoring position with empty noneditable position and blockheight to be a candidate. Overall it looks fine to me considering the tricky editing code. Please suggest if you have something in mind.
So its failing at calculating start VisiblePosition. > WebKit.dll!WebCore::VisiblePosition::canonicalPosition(const WebCore::Position & passedPosition={...}) Line 532 C++ WebKit.dll!WebCore::VisiblePosition::init(const WebCore::Position & position={...}, WebCore::EAffinity affinity=DOWNSTREAM) Line 58 + 0x10 bytes C++ WebKit.dll!WebCore::VisiblePosition::VisiblePosition(const WebCore::Position & pos={...}, WebCore::EAffinity affinity=DOWNSTREAM) Line 52 C++ WebKit.dll!WebCore::VisibleSelection::setBaseAndExtentToDeepEquivalents() Line 254 + 0x17 bytes C++ WebKit.dll!WebCore::VisibleSelection::validate(WebCore::TextGranularity granularity=CharacterGranularity) Line 417 C++ WebKit.dll!WebCore::VisibleSelection::VisibleSelection(const WebCore::Position & base={...}, const WebCore::Position & extent={...}, WebCore::EAffinity affinity=DOWNSTREAM, bool isDirectional=false) Line 68 C++ WebKit.dll!WebCore::VisibleSelection::selectionFromContentsOfNode(WebCore::Node * node=0x0af44c38) Line 100 + 0x2e bytes C++ WebKit.dll!WebCore::FrameSelection::selectAll() Line 1649 + 0x12 bytes C++
It appears to me that this bug is about adjustSelectionToAvoidCrossingEditingBoundaries not using the right position or that VisiblePosition::canonicalPosition not being able to handle this situation properly. There is nothing wrong with isCandidate.
Comment on attachment 212894 [details] Patch Assuming that patches for review since 2013 are stale, r-
I am able to reproduce this bug in Safari Technology Preview 152 where in first field, CMD+A / Ctrl+A does not select any text. Test Case Link in Comment 0 - https://persistent.info/webkit/test-cases/contenteditable-select-all-bug.html In case of Chrome Canary 107 and Firefox Nightly 106, it does select text. Thanks!
<rdar://problem/99392627>