summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/editing
Commit message (Collapse)AuthorAgeFilesLines
* Convert editing/selection layout tests to use w3c test harness(Set 4).yoichio2016-03-2537-1305/+332
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move editing/selection/: move-by-word-visually-crash-test-1.html move-by-word-visually-crash-test-2.html move-by-word-visually-crash-test-3.html move-by-word-visually-crash-test-4.html move-by-word-visually-crash-test-5.html move-by-word-visually-crash-test-css-generated-content.html move-by-word-visually-inline-block-positioned-element.html move-by-word-visually-mac.html move-by-word-visually-multi-line.html move-by-word-visually-multi-space.html move-by-word-visually-single-space-inline-element.html move-by-word-visually-single-space-one-element.html move-by-word-visually-wrong-left-right.html move-by-word-visually-textarea.html resource/move-by-word-visually.js to editing/selection/modify_move/. Since these test uses move-by-word-visually.js to output -expect.txt, I rewrite it to w3c harness test style and some refactoring. BUG= Review URL: https://codereview.chromium.org/1832763002 Cr-Commit-Position: refs/heads/master@{#383258}
* This patch converts following layout tests in editing/selection to use w3c testyosin2016-03-249-58/+113
| | | | | | | | | | | | | | | | | harness and rename file to describe what these test do for ease of maintenance. * 5007143-2.html => modify_move/move_forward_line_range.html * 5007143.html => modify_move/move_forward_line_br.html * 5076323-1.html => modify_move/move_forward_document_boundary.html * 5076323-2.html => collapse/collapse_around_table.html * 5076323-3.html => collapse/collapse_around_table.html BUG=n/a TEST=n/a; no behavior changes Review URL: https://codereview.chromium.org/1812833004 Cr-Commit-Position: refs/heads/master@{#383019}
* Convert editing/selection layout tests to use w3c test harness(Set 3).yoichio2016-03-2316-324/+202
| | | | | | | | | | | | | | | | This CL also moves files: table-caret-2.html > collapse/table-caret-2.html table-caret-3.html > collapse/table-caret-3.html toString-1.html > tostring/toString-1.html unrooted-selection-start-crash.html > setbaseandextent/unrooted-selection-start-crash.html user-drag-element-and-user-select-none.html > mouse/user-drag-element-and-user-select-none.html user-select-js-property.html > script-tests/user-select-js-property.html BUG= Review URL: https://codereview.chromium.org/1821963002 Cr-Commit-Position: refs/heads/master@{#382807}
* This patch converts following layout tests in editing/selection to use w3c testyosin2016-03-2313-131/+149
| | | | | | | | | | | | | | | | | | harness and rename file to describe what these test do for ease of maintenance. * 5081257-1.html => collapse/collapse_html_to_editable_body.html * 5081257-2.html => collapse/collapse_document_in_design_mode * 51344.html => modify_move/move_left_right_character_in_mixed_bidi * 5333725.html => mouse/drag_user_select_none.html * 7152-1.html => select_all/select_all_last_table.html * 7152-2.html => select_all/select_all_table.html BUG=n/a TEST=n/a; no behavior changes Review URL: https://codereview.chromium.org/1811253002 Cr-Commit-Position: refs/heads/master@{#382792}
* This patch converts following layout tests in editing/selection to use w3c testyosin2016-03-2210-197/+138
| | | | | | | | | | | | | | | | harness and rename file to describe what these test do for ease of maintenance. * 4895428-1.html => mouse/drag_table_cell.html * 4895428-2.html => mouse/mouse_up_focus.html * 4895428-3.html => mouse/mouse_down_to_focus.html * 4895428-4.html => mouse/drag_focus_node.html BUG=n/a TEST=n/a; no behavior changes Review URL: https://codereview.chromium.org/1815583004 Cr-Commit-Position: refs/heads/master@{#382528}
* This patch converts following layout tests in editing/selection to use w3c testyosin2016-03-229-108/+129
| | | | | | | | | | | | | | | | | harness and rename file to describe what these test do for ease of maintenance. - 3690703-2.html => modify_extend/extend_backward_line_table_button.html - 3690703.html => modify_extend/extend_forward_line_table_button.html - 4397952.html => modify_move/move_forward_character_button.html - 4818145.html => set_base_and_extent/set_base_and_extent_uneditable_table.html - 4889598.html => modify_move/move_backward_line_table.html BUG=n/a TEST=n/a; no behavior Review URL: https://codereview.chromium.org/1815073002 Cr-Commit-Position: refs/heads/master@{#382527}
* Convert editing/selection/select-all-* to use w3c test harnessyosin2016-03-2221-261/+241
| | | | | | | | | | | | | | | | | | | | | | | This patch converts editing/selection/select-all-* to use w3c test harness to reduce number of files and simplify test cases and renames them to make file names describe what they do: * select-all-001.html => select_all/select_all_overflow_hidden.html * select-all-002.html => select_all/select_all_overflow_hidden_br.html * select-all-003.html => select_all/select_all_overflow_hidden_caret.html * select-all-004.html => select_all/select_all_overflow_hidden_table.html * select-all-005.html => set_base_and_extent/set_base_and_extent_html.html * select-all-006.html => select_all/select_all/select_all_html.html * select-all-iframe-crash.html => select_all/select_all_iframe.html * select-all-textarea.html => select_all/select_all_readonly_textarea.html * select-all-user-select-none.html => select_all/select_all_user_select_none.html BUG=n/a TEST=n/a; No behavior changes Review URL: https://codereview.chromium.org/1806243002 Cr-Commit-Position: refs/heads/master@{#382500}
* Convert editing/selection layout tests to use w3c test harness, volume 7yosin2016-03-229-177/+200
| | | | | | | | | | | | | | | | | | This patch converts following layout tests in editing/selection to use w3c test harness and rename file to describe what these test do for ease of maintenance. * iframe.html => modify_move/move_character_across_iframe.html * inline-table.html => modify_move/move_character_inline_table.html * move-by-sentence-linebreak.html =>modify_move\move_forward_sentence_empty_line_break.html * move-by-line-001.html => modify_move/move_forward_line_table_row.html * node-removal-1.html (not renamed) BUG=n/a TEST=n/a; no behavior changes Review URL: https://codereview.chromium.org/1807173003 Cr-Commit-Position: refs/heads/master@{#382496}
* Shift flowthread-to-visual coordinate space conversion one level up in the tree.mstensho2016-03-212-0/+44
| | | | | | | | | | | | | | | | | | | | | | | The conversion now takes place between the flow thread and its parent multicol container, rather than between the flow thread and its children. This is both conceptually more correct, and it also matches what mapToVisibleRectInAncestorSpace() already does. Having all machineries do this at the same place in the tree is what fixes the editing-specific bug 596070. As for layer clipping bug 527709, it just so happens that we specify the flow thread as ancestor in mapLocalToAncestor(), which is invoked via localToAncestorPoint() from PaintLayerClipper::calculateClipRects(). PaintLayerClipper does its work *before* fragments have been collected and set up for a given layer, so it doesn't want mapLocalToAncestor() or anyone to change to the visual coordinate space. BUG=527709,596070 R=leviw@chromium.org Review URL: https://codereview.chromium.org/1819603003 Cr-Commit-Position: refs/heads/master@{#382339}
* Remove unsafePluginPastingEnabled setting.dcheng2016-03-211-3/+1
| | | | | | | | | | | | This is always set to false. BUG=none R=haraken@chromium.org TBR=esprehn@chromium.org Review URL: https://codereview.chromium.org/1814393003 Cr-Commit-Position: refs/heads/master@{#382248}
* Convert editing/selection layout tests to use w3c test harness, volume 6yosin2016-03-189-77/+116
| | | | | | | | | | | | | | | | | | This patch converts following layout tests in editing/selection to use w3c test harness and rename file to describe what these test do for ease of maintenance. * caret-before-select.html => collapse/collapse_before_select.html * editable-html-element.html => focus_editable_html_element.html * end-of-document.html => modify_move/move_backward_line_end_of_document.html * focus_editable_html.html => focus_editable_html_element_scroll.html * mixed-editability-3.html => modify_move/move_forward_line_mixed_editability.html BUG=n/a TEST=n/a; no behavior changes Review URL: https://codereview.chromium.org/1806423003 Cr-Commit-Position: refs/heads/master@{#381925}
* [Editing][CodeHealth] Use w3c testharness in editing/seletion/move-by-*yoichio2016-03-1715-1254/+147
| | | | | | | | | | | | | | | | | | | | LayoutTests/editing/selection/ move-by-character-001.html move-by-character-002.html move-by-character-003.html move-by-character-004.html move-by-character-005.html move-by-character-6.html move-by-character-brute-force.html move-by-character-crash-test-textarea.html This CL also moves them to editing/selection/modify_move BUG= Review URL: https://codereview.chromium.org/1809963002 Cr-Commit-Position: refs/heads/master@{#381677}
* [Editing][CodeHealth] Use w3c testharness in editing/seletion/extend-by-*yoichio2016-03-1712-243/+159
| | | | | | | | | | | | | | | | | Use w3c testharness in LayoutTests/editing/selection/ extend-by-character-001.html extend-by-character-002.html extend-by-character-003.html extend-by-character-004.html extend-by-character-005.html extend-by-word-001.html BUG= Review URL: https://codereview.chromium.org/1798413003 Cr-Commit-Position: refs/heads/master@{#381673}
* Don't collapse whitespace in contenteditable=plaintext-only.tkent2016-03-172-0/+20
| | | | | | | | | | | | | | | Rewrite white-space property for contenteditable=plaintext-only elements as: normal -> pre-wrap nowrap -> pre pre-line -> pre-wrap because whitespace collapsing doesn't make sense in plain-text editing. The new behavior matches to Microsoft Edge for TEXTAREA. BUG=595491 Review URL: https://codereview.chromium.org/1813663002 Cr-Commit-Position: refs/heads/master@{#381668}
* Make <custom-ident> not insert quotesrob.buis2016-03-172-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, <custom-ident> serializing used quoteCSSStringIfNeeded to serialize, which can end up inserting quotes. However <custom-ident> are identifiers [1] and should serialize as such, meaning no quotes [2]. This patches fixes that by calling serializeIdentifier. Since the font family property relied on old CSSCustomIdentValue behavior, this patch adds a CSSFontFamilyValue class to keep said behavior, but with the change that previously we used single quotes, now double quotes [3]. Most of the expected test changes are because of this. In order to fix parsing-css-string-characters.html and string-quote-binary.html completely, the U+007F handling mentioned in [3] is implemented. Behavior matches Firefox. BUG=584999 [1] https://drafts.csswg.org/css-values-3/#custom-idents [2] https://drafts.csswg.org/cssom/#serialize-an-identifier [3] https://drafts.csswg.org/cssom/#serialize-a-string Review URL: https://codereview.chromium.org/1778743003 Cr-Commit-Position: refs/heads/master@{#381619}
* Disable FontName, FontSize, and FontSizeDelta commands in ↵tkent2016-03-162-6/+6
| | | | | | | | | | | | | contenteditable=plaintext-only. We shouldn't add <font> elements to plain-text editors. BUG=594917 TEST=automated Review URL: https://codereview.chromium.org/1805773002 Cr-Commit-Position: refs/heads/master@{#381406}
* Space out issuing of spellcheck requests to speed up layout test.sigbjornf2016-03-132-26/+26
| | | | | | | | | | | | | | | | | | | | Avoid issuing all spellcheck requests (by focusing elements) in one go as this queues up a number of tasks and timers that it will require going back to the event loop many times to process and handle. As the actual test also relies on timers and setTimeout() this delays the completion of the test considerably. Restructure the test, interleaving the element focusing (=> spellcheck request) with asynchronously checking the spellcheck result. Test completes earlier as a result. R=haraken BUG=356957 TEST=editing/spelling/spellcheck-editable-on-focus.html Review URL: https://codereview.chromium.org/1781273009 Cr-Commit-Position: refs/heads/master@{#380895}
* Editing: Skip TestRendering in ReplaceSelectionCommand if the editing host ↵tkent2016-03-111-1/+1
| | | | | | | | | | | | | | | is plain-text editable and the incoming fragment is plain-text. The purposes of this CL: * Do not modify incoming text for plain-text editing. We unexpectedly converted EOL characters for TEXTAREA. * Improve performance of text insertion in plain-text editing. BUG=2007,410417,453802,528491,586772,591697 Review URL: https://codereview.chromium.org/1780413002 Cr-Commit-Position: refs/heads/master@{#380527}
* TEXTAREA: Cutting last line without EOL should not remove the remaining EOL ↵tkent2016-03-101-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in the previous line. Our TEXTAREA element assumes there is an extra trailing <BR> or \n if the last character of the value is \n. So we remove the last \n when we generate value from innerEditor content. However, the assumption was broken if we cut the last line content without EOL. Editing code doesn't add an extra <BR> in such case. We removed the last \n in the value mistakenly. Solution: We should make sure there no <BR> elements in innerEditor except the extra trailing one so that we can ignore it safely on generating TEXTAREA value. Also, we should make sure editing code doesn't add \n for placeholder newline. - HTMLTextAreaElement simply ignore the last <BR> on generating value. - HTMLTextAreaElement makes sure that innerEditor has the last <BR> after every editing operations. - InsertLineBreakCommand always inserts \n for plain text editing field, however it produces <BR> as an extra line break for TEXTAREA. - ReplaceSelectionCommand appends a <BR> for an InterchangeNewline at the end. - InsertTextCommand should not produce TabSpans for plain text editing. BUG=522144,593184 Review URL: https://codereview.chromium.org/1785603002 Cr-Commit-Position: refs/heads/master@{#380385}
* Drop remaining [LegacyInterfaceTypeChecking] for Selectionphilipj2016-03-104-4/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With [LegacyInterfaceTypeChecking], any invalid type is treated as null, and the risk of this change is therefore bounded by the SelectionCollapseNull (also hit by setPosition) and SelectionSetBaseAndExtentNull use counters: https://www.chromestatus.com/metrics/feature/timeline/popularity/1083 https://www.chromestatus.com/metrics/feature/timeline/popularity/1084 Unfortunately chromestatus.com is not updating, but rbyers@ has checked the stable channel data and reports usage as ~0 for both. The majority of this tiny usage still ought to be actual null input, in cases like collapse(something.firstChild). The behavior of other engines was tested with this test: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/3970 Edge already throws for non-Node-or-null argumens to collapse and setBaseAndExtent, but doesn't support setPosition. Gecko already throws for collapse, but doesn't support setPosition or setBaseAndExtent. Overall, this ought to be very low risk. BUG=561338 R=yoichio@chromium.org,rbyers@chromium.org Review URL: https://codereview.chromium.org/1778683005 Cr-Commit-Position: refs/heads/master@{#380339}
* Remove the support of multiple shadow roots with a user agent shadow roothayato2016-03-032-22/+0
| | | | | | | | | | | | | "Intent to Remove" is here: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/VKQk3uQuJLQ This CL removes the web-facing API, as a first step. The other removals, such as a cleanup of each element, will be done separately in other CLs. BUG=489947 Review URL: https://codereview.chromium.org/1751953003 Cr-Commit-Position: refs/heads/master@{#378921}
* Deprecate 'results' attribute.tkent2016-02-291-0/+1
| | | | | | | | | | | Intent to Deprecated and Remove thread: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/8fHsOWz1XEw BUG=590117 Review URL: https://codereview.chromium.org/1744113002 Cr-Commit-Position: refs/heads/master@{#378176}
* Adding Deprecation Message for <keygen>svaldez2016-02-262-0/+2
| | | | | | | | BUG=588182 Review URL: https://codereview.chromium.org/1729483002 Cr-Commit-Position: refs/heads/master@{#377981}
* Editor::selectionForCommand is used to get selection before exec commandsyoichio2016-02-241-0/+20
| | | | | | | | | | so selection should be updated. BUG=587261 Review URL: https://codereview.chromium.org/1711453003 Cr-Commit-Position: refs/heads/master@{#377255}
* Editing: CompositeEditCommand::apply() should return false if the command ↵tkent2016-02-191-0/+19
| | | | | | | | | | was aborted. BUG=586846 Review URL: https://codereview.chromium.org/1706423003 Cr-Commit-Position: refs/heads/master@{#376375}
* Make InsertParagraph command to work with anchor element in listyosin2016-02-171-0/+16
| | | | | | | | | | | | | | | | This patch makes "InsertParagraph" command to work when inserting paragraph separator into non-well-formed list child with styled anchor element. Note: A result of "InsertParagraph" command in attached test case seems to be wired. We use it for catching behavior changes "InsertParagrap" in the future. BUG=543547 TEST=LayoutTests/editing/execCommand/insert-paragraph-in-list-item-anchor-crash.html Review URL: https://codereview.chromium.org/1704433002 Cr-Commit-Position: refs/heads/master@{#375859}
* Get rid of wrong assertion in InsertParagraphSeparatorCommand::doApply()yosin2016-02-171-0/+17
| | | | | | | | | | | | | | | | | | This patch gets rid of wrong assertion in |doApply()| member function of |InsertParagraphSeparatorCommand| to replace by if-statement. The issue can be occurred with CSS trick to put non-table layout item into table layout, e.g. test script in this patch. Note: A result of "InsertParagraph" command in attached test case seems to be wired. We use it for catching behavior changes "InsertParagrap" in the future. BUG=535510 TEST=LayoutTests/editing/execCommand/insert-paragraph-into-table.html Review URL: https://codereview.chromium.org/1694413002 Cr-Commit-Position: refs/heads/master@{#375829}
* Remove mac specific backspace handlingeae2016-02-172-32/+0
| | | | | | | | | | | | | | | | | Remove Mac specific handling of backspace in editing. Specifically alter the way accented characters are deleted, when backspace is hit, to match the behavior on Windows. The special handling for Mac was added in r40710 to match the Mac AppKit behavior. It was limited to regional indicators and hangul and was never implemented for non-posix platforms. BUG=585701 R=leviw@chromium.org Review URL: https://codereview.chromium.org/1699903004 Cr-Commit-Position: refs/heads/master@{#375730}
* Rename ComposedTree to FlatTreehayato2016-02-082-3/+3
| | | | | | | | | | | | | | | | | | | | | | The spec change is: https://github.com/w3c/webcomponents/commit/9b7f16e90b88594ed783ff7e0f971fad084e5f4d Blink should follow the change of the terminologies in the spec. There is no change on web-facing APIs. This CL is the result of the (almost) mechanical renaming, using: > zargs **/*.{h,cpp,gyp,gypi,idl,js,html,txt} -- sed -i -e 's/ComposedTree/FlatTree/g' > zargs **/*.{h,cpp,gyp,gypi,idl,js,html,txt} -- sed -i -e 's/composed tree/flat tree/g' > zargs **/*.{h,cpp,gyp,gypi,idl,js,html,txt} -- sed -i -e 's/Composed tree/Flat tree/g' > zargs **/*.{h,cpp,gyp,gypi,idl,js,html,txt} -- sed -i -e 's/Composed Tree/Flat Tree/g' Other renaming, which would require a more careful investigation, will be done in another CL. BUG=531990 Review URL: https://codereview.chromium.org/1675163002 Cr-Commit-Position: refs/heads/master@{#374095}
* Remove some editing crash tests.tkent2016-02-0410-90/+0
| | | | | | | | | | | | This is a follow-up of https://codereview.chromium.org/1658113002 We delay 'load' events during execCommand. So, these tests don't make sense any longer. BUG=489223,516244 Review URL: https://codereview.chromium.org/1662163002 Cr-Commit-Position: refs/heads/master@{#373445}
* Make ReplaceSelectionCommand not to attempt to modify uneditable list elementyosin2016-02-041-0/+16
| | | | | | | | | | | | | This patch makes |ReplaceSelectionCommand| not to attempt to modify uneditable list element, when replaced range inside list element, e.g. UL and OL element, and replacing fragment contains list item within list element. BUG=546974 TEST=LayoutTests/editing/execCommand/insert-list-into-list-crash.html Review URL: https://codereview.chromium.org/1655343003 Cr-Commit-Position: refs/heads/master@{#373431}
* Make FrameSelection to mark closed typing command correctlyyosin2016-02-031-0/+19
| | | | | | | | | | | | | | | | | | | | | This patch makes |FrameSelection| to mark last typing command closed when DOM tree mutated except for by execCommand, to avoid |TypeingCommand| not to use obsolete selection. Here is a pattern what this patch fixed for avoiding crash: 1. Run "delete", "insertText", etc. implemented in |TypeingCommand| 2. Modify DOM other than |document.execCommand()| 3. Run "delete", "insertText", etc implemented in |TypeingCommand| In step 2, we should consider typing command is closed. Before this patch, we didn't so. BUG=545395 TEST=LayoutTests/editing/execCommand/insert-newline-quoted-content-crash.html Review URL: https://codereview.chromium.org/1662963002 Cr-Commit-Position: refs/heads/master@{#373200}
* Delay load event only if EventQueueScope is active.tkent2016-02-037-16/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | In order to avoid unexpected DOM mutation during editing command, we need to delay load event dispatching during editing commands, which activates EventQueueScope. We need to introduce a dedicated EventDispatchMediator for the 'load' event to support ScopedEventQueue correctly because the event requires some additional tasks just before/after event dispatching. However, this CL doesn't introduce the dedicated EventDispatchMediator, and use ExecutionContextTask instead because we're going to make 'load' event asynchronous by a different way. (crbug.com/569511) Implementation: - LocalDOMWindow::dispatchWindowLoadEvent calls dispatchLoadEvent() later if EventQueueScope is active. - Add ScopedEventQueue::shouldQueueEvents() to check whether we should queue or not - Make LocalDOMWindow::dispatchLoadEvent() private - Remove fast/dom/Range/surroundContents-for-mutation.html We were unable to find another way to reproduce the test scenario. BUG=489223,516244 Review URL: https://codereview.chromium.org/1658113002 Cr-Commit-Position: refs/heads/master@{#373165}
* Make VisibleSelection::updateIfNeeded() to consider text granularityyosin2016-02-021-1/+2
| | | | | | | | | | | | | | | | | | | | | This patch makes |VisibleSelection::updateIfNeeded()| to consider text granularity and utilizes it in |enabledInEditableText|, for "DeleteSelection", "InsertParagraph", etc, and |enabledRangeInEditableText()|, for "RemoveFormat", ||enabledRangeInRichlyEditableText()|, for "Unlink", to these commands valid selection. This patch updates test expectation of "delete-start-block.html", since "insertParagraph" step in test script used invalid selection so far. This is a follow-up patch of crrev.com/1612983003, which introduces |VisibleSelection::updateIfNeeded()|. BUG=574090, 581228 TEST=LayoutTests/editing/deleting/delete-start-block.html Review URL: https://codereview.chromium.org/1648253002 Cr-Commit-Position: refs/heads/master@{#372890}
* Make insert{Un}OrderedListCommand/insertUnorderedListCommand to do nothing ↵yosin2016-01-291-0/+14
| | | | | | | | | | | | | | | | | | for uneditable This patch makes |InsertListCommand::doApplyForSingleParagraph()| to check whether parent of list element which will be switch to another list type or unlistify, editable or not. If it is uneditable, we do nothing, because we can't modify uneditable element. Without this patch, we hit assertion in |InsertNodeBeforeCommand| constructor. BUG=547705 TEST=LayoutTests/editing/execCommand/unlistify-uneditable-parent-crash.html Review URL: https://codereview.chromium.org/1646673003 Cr-Commit-Position: refs/heads/master@{#372302}
* Perform Spellcheck Requesting before Dispatching Eventsxiaochengh2016-01-271-0/+27
| | | | | | | | | | | | | | | | |ReplaceSelectionCommand| stores the inserted range after |doApply()|. This range may be invalidated if |Editor::appliedEditing()| modifies the DOM, causing spellcheck run on an invalid range. This CL moves the spellcheck request into |Editor::appliedEditing()| before dispatching any event, ensuring spellcheck run on a valid range. BUG=580950 TEST=LayoutTests/editing/pasteboard/paste-webkit-editable-content-changed-crash.html Review URL: https://codereview.chromium.org/1636883003 Cr-Commit-Position: refs/heads/master@{#371776}
* Editing: Tidy up HTML document structure before execCommand().tkent2016-01-2713-7/+36
| | | | | | | | | | | | | | | | A crash of crbug.com/537815 was due to an editable <p> as document.documentElement. Supporting such invalid HTML structure is costly. So we correct such HTML structure before executing execCommands. - We show a console warning if the autocorrection happens. - After the autocorrection, document.write() doesn't work because the document tree is complete. BUG=537815 Review URL: https://codereview.chromium.org/1637323002 Cr-Commit-Position: refs/heads/master@{#371774}
* Replace isRenderedHTMLTableElement() and isRenderedHTMLTableElement() by ↵nolan.robin.cao2016-01-254-29/+14
| | | | | | | | | | | | | | | | | | isDisplayInsideTable() |isRenderedHTMLTableElement()| checks if the node is a TABLE element. But we can make TABLE element as non-table layout, e.g. <TABLE style="display:inline">. To avoid confusion, unify |isRenderedHTMLTableElement()| and |isRenderedHTMLTableElement()| into |isDisplayInsideTable()|, where |isDisplayInsideTable()| as same as |isRenderedTableElement()|. display-inside table is a concept in CSS Display 3 specification. BUG=578950 Review URL: https://codereview.chromium.org/1615993002 Cr-Commit-Position: refs/heads/master@{#371268}
* Make undo-smart-delete-word.html to use w3c test harnessyosin2016-01-252-50/+33
| | | | | | | | | | | | This patch makes "undo-smart-delete-word.html" to use w3c test harness to simplify test case and reduce resource usage. BUG=n/a TEST=n/a; no behavior changes Review URL: https://codereview.chromium.org/1625423002 Cr-Commit-Position: refs/heads/master@{#371214}
* Remove editing/spelling/spelling-huge-text-sync.html.tkent2016-01-252-74/+0
| | | | | | | | | | This is a test for synchronous spellchecker, which was removed. BUG=295722 Review URL: https://codereview.chromium.org/1629223002 Cr-Commit-Position: refs/heads/master@{#371197}
* Make "Outdent" command to respect CSS display propertyyosin2016-01-221-0/+16
| | | | | | | | | | | | | | | | | This patch changes |isHTMLListOrBlockquoteElement()| static function in Outdent command implementation to check "display" CSS property to have "block" to make "Outdent" command not to count BLOCKQUOTE/OL/UL elements with "display:inline" as paragraphs for unit of decreasing indentation. This patch is a part of "Make editing code to respect CSS properties" project, http://crbug.com/580375. BUG=572779, 580375 TEST=LayoutTests/editing/execCommand/outdent-blockquote-inline-crash.html Review URL: https://codereview.chromium.org/1616263003 Cr-Commit-Position: refs/heads/master@{#370926}
* Introduce FrameSelection::updateIfNeeded() to update selection positionsyosin2016-01-221-0/+18
| | | | | | | | | | | | | | | | | | | | | | | This patch introduces |FrameSelection::updateIfNeeded()| to canonicalize selection positions to with current layout and style, since we assume positions in selection point visible position. I tried to implement automatic update in |FrameSelection::selection()|, however lots of tests depend current broken behavior. I'll fix these broken test incrementally to add call of |FrameSelection::updateIfNeeded()| in call path. Once I fix all tests, I'll make |FrameSelection::selection()| to return always return valid selection. This patch is a preparation of automatic selection updating and fix an issue for execCommands. BUG=579280 TEST=LayoutTests/editing/execCommand/insert-ordered-list-visibility-hidden-crash.html Review URL: https://codereview.chromium.org/1612983003 Cr-Commit-Position: refs/heads/master@{#370882}
* Make apply-inline-style-to-element-with-no-renderer-crash.html to use w3c ↵yosin2016-01-211-10/+14
| | | | | | | | | | | | | | | | | | | test harness Because of apply-inline-style-to-element-with-no-renderer-crash.html is crash testing, we don't need to check layout tree and pixels. This patch utilizes w3c test in apply-inline-style-to-element-with-no-renderer-crash.html to reduce resource usages. This patch also moves location of apply-inline-style-to-element-with-no-renderer-crash.html to "editing/execCommand/" to align with other tests. BUG=n/a TEST=n/a; no behavior changes Review URL: https://codereview.chromium.org/1604163002 Cr-Commit-Position: refs/heads/master@{#370578}
* Don't force display:inline-table/table on table elements when in quirks modenainar2016-01-205-6/+6
| | | | | | | | | | | | | | Currently in quirks mode we force table elements to display:inline-table or table. This current action is not supported in quirks spec and is inconsistent with Gecko. This leads to elements with display set to lose that information. This patch fixes that and allows those elements with display to retain this state even in quirks mode. BUG=369979 Review URL: https://codereview.chromium.org/1607703003 Cr-Commit-Position: refs/heads/master@{#370382}
* Make VisibleSelection::setWithoutValidation() to handle TextAffinity::Upstreamyosin2016-01-141-0/+17
| | | | | | | | | | | | | | | | | | | Before this patch, |VisibleSelection::setWithoutValidation()| assumes it is always called |m_affinity| == |TextAffinity::Downstream|, however as attached test case, "/set-without-validation-with-upstream-caret.html", this assumption is false. |setWithoutValidation()| can be called with |m_affinity| == |TextAffinity::Upstream|. This patch makes |VisibleSelection::setWithoutValidation()| to handle in case of |VisibleSelection::m_affinity| == |TextAffinity::Upstream| case by keeping invariant only caret selection having |TextAffinity::Upstream|. BUG=575568 TEST=editing/caret/set-without-validation-with-upstream-caret.html Review URL: https://codereview.chromium.org/1581333002 Cr-Commit-Position: refs/heads/master@{#369363}
* testharnessreport: Support missing root element.tkent2016-01-071-5/+0
| | | | | | | | A test may remove <html>. Review URL: https://codereview.chromium.org/1563153002 Cr-Commit-Position: refs/heads/master@{#368039}
* expandRangeToSentenceBoundary must always return a superrangexiaochengh2015-12-254-0/+188
| | | | | | | | BUG=571988 Review URL: https://codereview.chromium.org/1549893002 Cr-Commit-Position: refs/heads/master@{#366862}
* Allow -webkit-text-decorations-in-effect preservation during para move.sigbjornf2015-12-182-0/+25
| | | | | | | | | | | | | | | Adjust assert to allow it; moving paragraphs as part of performing JustifyRight will want to preserve styles, but this is done without extra annotation. For which -webkit-text-decorations-in-effect is also preserved. R=tkent BUG=498130 TEST=editing/execCommand/justify-right-in-effect-crash.html Review URL: https://codereview.chromium.org/1522063002 Cr-Commit-Position: refs/heads/master@{#366067}
* Remove deprecation messages for no-ops that are left in the specsphilipj2015-12-114-7/+3
| | | | | | | | | | | | | | | | | | | | | | | Since these will not be removed, warning developers about them is not a good use of attention. Take the opportunity to remove the detach() calls from a few tests where it does nothing anyway. Remove detach-range-during-deletecontents.html as that was testing specifically detach() which cannot be relevant now that it is a no-op. Some of the range-* tests are left untouched as they explicitly call out that detach() is a no-op in comments. These are the reviews where these deprecation messages were added: https://codereview.chromium.org/256013002 https://codereview.chromium.org/252783002 https://codereview.chromium.org/901623002 BUG=568218 R=rbyers@chromium.org Review URL: https://codereview.chromium.org/1516553002 Cr-Commit-Position: refs/heads/master@{#364745}
* Drop [LegacyInterfaceTypeChecking] for Selection.prototype.addRangephilipj2015-12-102-2/+2
| | | | | | | | | | | | | | This already throws in Firefox and IE11 when the argument is null: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/3781 DOMSelection::addRange is only called from generated bindings, so the assert will hold. BUG=561338 Review URL: https://codereview.chromium.org/1511913002 Cr-Commit-Position: refs/heads/master@{#364322}