Diff
Modified: trunk/LayoutTests/ChangeLog (231716 => 231717)
--- trunk/LayoutTests/ChangeLog 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/ChangeLog 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,3 +1,74 @@
+2018-05-11 Ryosuke Niwa <[email protected]>
+
+ Tapping after CSS-based table casues an infinite loop in wordRangeFromPosition
+ https://bugs.webkit.org/show_bug.cgi?id=185465
+ <rdar://problem/35263057>
+
+ Reviewed by Antti Koivisto.
+
+ Rebaselined the tests. Most of these are due to new extra line breaks being generated after table and
+ header elements as expected. See inline comments for some newly discovered bugs and rebaselines due to
+ other non-obvious reasons.
+
+ * accessibility/internal-link-anchors2-expected.txt: This test now demonstrates a bug that WebKit doesn't
+ generate an extra line break before h3 when it has a large margin-top since an extra line break is only
+ generated after a node at the moment.
+ * accessibility/mac/mathml-elements-expected.txt:
+ * accessibility/table-headers-expected.txt:
+ * compositing/layer-creation/overlap-transformed-preserved-3d-expected.txt:
+ * css3/flexbox/box-orient-button-expected.txt:
+ * css3/flexbox/flexitem-expected.txt:
+ * editing/execCommand/19087-expected.txt: The second blockquote which has the height of 0px no longer
+ generates an extra new line.
+ * editing/inserting/insert-list-in-table-cell-08-expected.txt: Selection is now being restored properly
+ using TextIterator in InsertListCommand.
+ * editing/selection/tapping-in-table-at-end-of-document-expected.txt: Added.
+ * editing/selection/tapping-in-table-at-end-of-document.html: Added.
+ * editing/text-iterator/table-at-end-of-document-expected.txt: Added.
+ * editing/text-iterator/table-at-end-of-document.html: Added.
+ * fast/block/positioning/insert-positioned-in-anonymous-crash-expected.txt:
+ * fast/css/css3-ch-unit-expected.txt: Line breaks are generated between block & inline-block elements
+ as expected.
+ * fast/css/percent-min-width-img-src-change-expected.txt:
+ * fast/css/percent-width-img-src-change-expected.txt:
+ * fast/css/pseudo-empty-display-none-expected.txt:
+ * fast/dom/HTMLAnchorElement/anchor-in-noscroll-iframe-crash-expected.txt:
+ * fast/dom/HTMLDivElement/align/getset-expected.txt:
+ * fast/dom/HTMLSelectElement/listbox-select-reset-expected.txt:
+ * fast/dom/HTMLTableElement/table-with-invalid-border-expected.txt:
+ * fast/forms/option-mouseevents-expected.txt:
+ * fast/history/multiple-classes-visited-expected.txt:
+ * fast/history/self-is-visited-expected.txt:
+ * fast/html/marquee-reparent-check-expected.txt:
+ * fast/inline-block/anonymous-block-crash-expected.txt: This test now demonstrates a bug that we're not
+ generating an empty line before a block in some cases.
+ * fast/inline/inline-position-top-align-expected.txt:
+ * fast/invalid/test-case-tr-th-td-should-not-close-dl-list-expected.txt:
+ * fast/overflow/scrollbar-click-retains-focus-expected.txt:
+ * fast/parser/comments-expected.txt:
+ * fast/parser/fragment-parser-doctype-expected.txt:
+ * fast/ruby/ruby-base-merge-block-children-crash-2-expected.txt:
+ * fast/spatial-navigation/snav-radio-group-expected.txt: A line break is generated after a nested table.
+ * fast/sub-pixel/table-cells-have-stable-width-expected.txt:
+ * fast/table/table-row-oveflow-crash-expected.txt: A line break is generated after a table as expected,
+ which is followed by a BR which creates a blank line.
+ * fast/table/table-with-borderattr-null-expected.txt:
+ * fast/table/table-with-borderattr-set-to-null-expected.txt:
+ * fast/text/international/dynamic-text-combine-crash-expected.txt:
+ * fast/xsl/mozilla-tests-expected.txt:
+ * http/tests/misc/large-js-program-expected.txt:
+ * imported/blink/plugins/empty-per-context-data-expected.txt:
+ * inspector/console/js-isLikelyStackTrace-expected.txt:
+ * inspector/console/js-source-locations-expected.txt:
+ * mathml/out-of-flow-in-token-crash-expected.txt:
+ * mathml/presentation/stretchy-depth-height-expected.txt:
+ * platform/mac/accessibility/table-cells-roles-expected.txt: Line breaks are generated after a block
+ followed by two two consecutive BRs.
+ * platform/mac/accessibility/table-roles-hierarchy-expected.txt: Ditto.
+ * svg/foreignObject/fO-fixed-position-crash-expected.txt:
+ * tiled-drawing/scrolling/non-fast-region/wheel-handler-region-basic-expected.txt:
+ * transforms/3d/hit-testing/coplanar-with-camera-expected.txt:
+
2018-05-11 Chris Dumez <[email protected]>
REGRESSION (async policy delegate): Revoking an object URL immediately after triggering download breaks file download
Modified: trunk/LayoutTests/accessibility/internal-link-anchors2-expected.txt (231716 => 231717)
--- trunk/LayoutTests/accessibility/internal-link-anchors2-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/accessibility/internal-link-anchors2-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -97,7 +97,6 @@
2.2 Tourette syndrome
-
[edit] Tourette syndrome
Link to anchor Link to div
Modified: trunk/LayoutTests/accessibility/mac/mathml-elements-expected.txt (231716 => 231717)
--- trunk/LayoutTests/accessibility/mac/mathml-elements-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/accessibility/mac/mathml-elements-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -33,7 +33,7 @@
under
over
-3 2 1
+3 2 1
This tests ensures that Mac specific attributes and roles for MathML elements work as expected.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Modified: trunk/LayoutTests/accessibility/table-headers-expected.txt (231716 => 231717)
--- trunk/LayoutTests/accessibility/table-headers-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/accessibility/table-headers-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -3,6 +3,7 @@
2. Russia Moscow
3. Ukraine Kiev
+
This tests that the columnHeaders() and rowHeaders() functions return the correct headers for a table cell.
The table cell at (0,3) should have exactly one column header, currently it has 1 column header(s).
Modified: trunk/LayoutTests/compositing/layer-creation/overlap-transformed-preserved-3d-expected.txt (231716 => 231717)
--- trunk/LayoutTests/compositing/layer-creation/overlap-transformed-preserved-3d-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/compositing/layer-creation/overlap-transformed-preserved-3d-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,4 +1,5 @@
-123456Before:
+123456
+Before:
(GraphicsLayer
(anchor 0.00 0.00)
(bounds 800.00 600.00)
Modified: trunk/LayoutTests/css3/flexbox/box-orient-button-expected.txt (231716 => 231717)
--- trunk/LayoutTests/css3/flexbox/box-orient-button-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/css3/flexbox/box-orient-button-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -11,18 +11,22 @@
hello
world
+
horizontal:
hello
world
+
vertical:
hello
world
+
default => vertical:
hello
world
+
vertical => horizontal:
hello
Modified: trunk/LayoutTests/css3/flexbox/flexitem-expected.txt (231716 => 231717)
--- trunk/LayoutTests/css3/flexbox/flexitem-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/css3/flexbox/flexitem-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -28,6 +28,7 @@
+
button
@@ -39,6 +40,7 @@
+
Some text
Some more text
Modified: trunk/LayoutTests/editing/execCommand/19087-expected.txt (231716 => 231717)
--- trunk/LayoutTests/editing/execCommand/19087-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/editing/execCommand/19087-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -4,4 +4,3 @@
-
Modified: trunk/LayoutTests/editing/inserting/insert-list-in-table-cell-08-expected.txt (231716 => 231717)
--- trunk/LayoutTests/editing/inserting/insert-list-in-table-cell-08-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/editing/inserting/insert-list-in-table-cell-08-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -33,4 +33,5 @@
| <td>
| "gghfg"
| <td>
-| "fsfg<#selection-focus>"
+| "fsfg"
+| <#selection-focus>
Added: trunk/LayoutTests/editing/selection/tapping-in-table-at-end-of-document-expected.txt (0 => 231717)
--- trunk/LayoutTests/editing/selection/tapping-in-table-at-end-of-document-expected.txt (rev 0)
+++ trunk/LayoutTests/editing/selection/tapping-in-table-at-end-of-document-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -0,0 +1,6 @@
+This tests tapping on after a CSS table doesn't cause a hang.
+To manually test, click on the right of the text below inside the red box.
+WebKit should not hang, and you should see PASS below immediately:
+
+PASS
+Click here >
Added: trunk/LayoutTests/editing/selection/tapping-in-table-at-end-of-document.html (0 => 231717)
--- trunk/LayoutTests/editing/selection/tapping-in-table-at-end-of-document.html (rev 0)
+++ trunk/LayoutTests/editing/selection/tapping-in-table-at-end-of-document.html 2018-05-11 20:39:30 UTC (rev 231717)
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<script src=""
+<script>
+
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ window._onload_ = async () => {
+ const table = document.getElementById('table');
+ const rect = table.getBoundingClientRect();
+ await UIHelper.activateAt(rect.x + rect.width / 2, rect.y + 10);
+ setTimeout(() => testRunner.notifyDone(), 0);
+ }
+}
+
+</script>
+</head>
+<body>
+<p>This tests tapping on after a CSS table doesn't cause a hang.<br>
+To manually test, click on the right of the text below inside the red box.<br>
+WebKit should not hang, and you should see PASS below immediately:</p>
+<div id="result"></div>
+<div id="table" _onclick_="result.textContent = 'PASS'" style="width: 100%; height: 100%; border: solid 10px red; padding: 10px;">
+ <div style="display: table">
+ <div style="display: table-row">
+ <div style="display: table-cell">
+ Click here >
+ </div>
+ </div>
+ </div>
+</div>
+</body>
+</html>
Added: trunk/LayoutTests/editing/text-iterator/table-at-end-of-document-expected.txt (0 => 231717)
--- trunk/LayoutTests/editing/text-iterator/table-at-end-of-document-expected.txt (rev 0)
+++ trunk/LayoutTests/editing/text-iterator/table-at-end-of-document-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -0,0 +1,7 @@
+This tests getting the plain text of a CSS table followed by a text. You should see X and Y in two seprate lines below twice:
+
+PASS
+X
+Y
+X
+Y
Added: trunk/LayoutTests/editing/text-iterator/table-at-end-of-document.html (0 => 231717)
--- trunk/LayoutTests/editing/text-iterator/table-at-end-of-document.html (rev 0)
+++ trunk/LayoutTests/editing/text-iterator/table-at-end-of-document.html 2018-05-11 20:39:30 UTC (rev 231717)
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<script>
+
+if (window.testRunner)
+ testRunner.dumpAsText();
+
+window._onload_ = () => {
+ let result = document.getElementById('container').innerText;
+ document.getElementById('result').textContent = result;
+ document.getElementById('pass-fail').textContent = result == 'X\nY' ? 'PASS' : 'FAIL';
+}
+
+</script>
+</head>
+<body>
+<p>This tests getting the plain text of a CSS table followed by a text.
+You should see X and Y in two seprate lines below twice:</p>
+<div id="pass-fail"></div>
+<pre><span id="result" style="background: #3cf;"></span></pre>
+<div id="container" style="width:100%; height: 100%'">
+ <div style="display: table">
+ <div style="display: table-row">
+ <div id="cell" style="display: table-cell">
+ X
+ </div>
+ </div>
+ </div>
+ Y
+</div>
+</body>
+</html>
Modified: trunk/LayoutTests/fast/block/positioning/insert-positioned-in-anonymous-crash-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/block/positioning/insert-positioned-in-anonymous-crash-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/block/positioning/insert-positioned-in-anonymous-crash-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1 +1,2 @@
PASSED
+
Modified: trunk/LayoutTests/fast/css/css3-ch-unit-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/css/css3-ch-unit-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/css/css3-ch-unit-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -36,10 +36,14 @@
Four zeroes should be visible, nothing else:
0000
0000
-0000 There should be more than one green '|' visible (non-monospaced fonts):
-|||0|||
-|||0|||
-|||0|||
+0000
+There should be more than one green '|' visible (non-monospaced fonts):
+|||0
+|||
+|||0
+|||
+|||0
+|||
This box has a 20px font size. The last two '0's should be the same size.
0
0
Modified: trunk/LayoutTests/fast/css/percent-min-width-img-src-change-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/css/percent-min-width-img-src-change-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/css/percent-min-width-img-src-change-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,2 +1,3 @@
PASS
-
+
+
Modified: trunk/LayoutTests/fast/css/percent-width-img-src-change-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/css/percent-width-img-src-change-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/css/percent-width-img-src-change-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,3 +1,4 @@
PASS
-
+
+
Modified: trunk/LayoutTests/fast/css/pseudo-empty-display-none-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/css/pseudo-empty-display-none-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/css/pseudo-empty-display-none-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,3 +1,4 @@
Test for bug 26570. There should be two green boxes on this page.
+
PASS
Modified: trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-in-noscroll-iframe-crash-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-in-noscroll-iframe-crash-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-in-noscroll-iframe-crash-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,4 +1,3 @@
This tests whether clicking on an anchor in an iframe with scrolling="no" will scroll to anchor. If clicking on the link below triggers a scroll, the test passes.
-
PASS
Modified: trunk/LayoutTests/fast/dom/HTMLDivElement/align/getset-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/dom/HTMLDivElement/align/getset-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/dom/HTMLDivElement/align/getset-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,4 +1,5 @@
Tests: getting and setting HTMLDivElement::align
+
Condition(s):
Testing valid, invalid, and empty values
Modified: trunk/LayoutTests/fast/dom/HTMLSelectElement/listbox-select-reset-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/dom/HTMLSelectElement/listbox-select-reset-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/dom/HTMLSelectElement/listbox-select-reset-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -2,6 +2,7 @@
This test verifies that list-box-style select form controls with no "selected" attributes are properly cleared when reset.
You should see two element IDs below, and the word "SUCCESS" twice:
+
multiSelectElement: SUCCESS
singleSelectElement: SUCCESS
Modified: trunk/LayoutTests/fast/dom/HTMLTableElement/table-with-invalid-border-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/dom/HTMLTableElement/table-with-invalid-border-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/dom/HTMLTableElement/table-with-invalid-border-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,3 +1,4 @@
https://bugs.webkit.org/show_bug.cgi?id=102112: There should be a black box below.
+
PASS getComputedStyle(document.querySelector("table")).borderTopWidth is "1px"
Modified: trunk/LayoutTests/fast/forms/option-mouseevents-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/forms/option-mouseevents-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/forms/option-mouseevents-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -6,6 +6,7 @@
+
PASS: event type should be mousedown and is
PASS: event target should be [object HTMLOptionElement] and is
PASS: event.pageX should be 22 and is
Modified: trunk/LayoutTests/fast/history/multiple-classes-visited-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/history/multiple-classes-visited-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/history/multiple-classes-visited-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,6 +1,7 @@
These two links should be the same color (orange):
One Two
+
PASS firstStyle.color became secondStyle.color
PASS successfullyParsed is true
Modified: trunk/LayoutTests/fast/history/self-is-visited-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/history/self-is-visited-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/history/self-is-visited-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,6 +1,7 @@
These two links should be different colors (green and orange):
One Two
+
PASS firstStyle.color became different from secondStyle.color
PASS firstStyle.backgroundColor became different from secondStyle.backgroundColor
PASS successfullyParsed is true
Modified: trunk/LayoutTests/fast/html/marquee-reparent-check-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/html/marquee-reparent-check-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/html/marquee-reparent-check-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -7,4 +7,5 @@
TEST COMPLETE
-TEST
+TEST
+
Modified: trunk/LayoutTests/fast/inline/inline-position-top-align-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/inline/inline-position-top-align-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/inline/inline-position-top-align-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,4 +1,5 @@
pre-text after-text Something
+
Tests for hitTest of element
bug 45164: REGRESSION: Clickable area too large
Modified: trunk/LayoutTests/fast/inline-block/anonymous-block-crash-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/inline-block/anonymous-block-crash-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/inline-block/anonymous-block-crash-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,3 +1,2 @@
This test verifies that no crash occurs.
-
PASS
Modified: trunk/LayoutTests/fast/invalid/test-case-tr-th-td-should-not-close-dl-list-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/invalid/test-case-tr-th-td-should-not-close-dl-list-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/invalid/test-case-tr-th-td-should-not-close-dl-list-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -5,5 +5,6 @@
test
test
+
PASSED.
PASSED.
Modified: trunk/LayoutTests/fast/overflow/scrollbar-click-retains-focus-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/overflow/scrollbar-click-retains-focus-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/overflow/scrollbar-click-retains-focus-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -3,7 +3,6 @@
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
Focus should remain in the input
PASS document.activeElement.tagName is "INPUT"
Modified: trunk/LayoutTests/fast/parser/comments-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/parser/comments-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/parser/comments-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -2,8 +2,10 @@
Basic comments:
PASSED
+
Comment series:
PASSED
+
Dash runs:
PASSED PASSED PASSED
@@ -17,6 +19,7 @@
PASSED PASSED
White space after comment close:
+
Extra comment after markup declaration close:
FAILED: extra comment end and markup declaration close -->
PASSED (outer nested comment) -->
Modified: trunk/LayoutTests/fast/parser/fragment-parser-doctype-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/parser/fragment-parser-doctype-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/parser/fragment-parser-doctype-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -6,4 +6,3 @@
TEST COMPLETE
-
Modified: trunk/LayoutTests/fast/ruby/ruby-base-merge-block-children-crash-2-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/ruby/ruby-base-merge-block-children-crash-2-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/ruby/ruby-base-merge-block-children-crash-2-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,3 +1,4 @@
+
WebKit bug #127515. This test must be run under Guard Malloc. It passes if it does not crash.
Modified: trunk/LayoutTests/fast/spatial-navigation/snav-radio-group-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/spatial-navigation/snav-radio-group-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/spatial-navigation/snav-radio-group-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -2,7 +2,8 @@
4
- 6
+
+6
8
PASS gFocusedDocument.activeElement.getAttribute("id") is "down"
PASS gFocusedDocument.activeElement.getAttribute("id") is "8"
Modified: trunk/LayoutTests/fast/sub-pixel/table-cells-have-stable-width-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/sub-pixel/table-cells-have-stable-width-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/sub-pixel/table-cells-have-stable-width-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,6 +1,6 @@
PASS Cell in AutoTable has expected size
PASS Cell in FixedTable has expected size
-Cc: AutoTableLayout
+Cc: AutoTableLayout
foo
FixedTableLayout
Tests that setting the width of an element inside a cell to the computed width of said element does not change the width of the cell itself.
Modified: trunk/LayoutTests/fast/table/table-row-oveflow-crash-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/table/table-row-oveflow-crash-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/table/table-row-oveflow-crash-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,4 +1,5 @@
PASS if no crash.
5
2
+
43
Modified: trunk/LayoutTests/fast/table/table-with-borderattr-null-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/table/table-with-borderattr-null-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/table/table-with-borderattr-null-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,3 +1,4 @@
There should be a black box below.
+
PASS getComputedStyle(document.querySelector("table")).borderTopWidth is "1px"
Modified: trunk/LayoutTests/fast/table/table-with-borderattr-set-to-null-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/table/table-with-borderattr-set-to-null-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/table/table-with-borderattr-set-to-null-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,3 +1,4 @@
There should be a black box below.
+
PASS getComputedStyle(document.querySelector("table")).borderTopWidth is "1px"
Modified: trunk/LayoutTests/fast/text/international/dynamic-text-combine-crash-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/text/international/dynamic-text-combine-crash-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/text/international/dynamic-text-combine-crash-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -3,4 +3,3 @@
-
Modified: trunk/LayoutTests/fast/xsl/mozilla-tests-expected.txt (231716 => 231717)
--- trunk/LayoutTests/fast/xsl/mozilla-tests-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/fast/xsl/mozilla-tests-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -38,6 +38,7 @@
Test:see source
Desired Result: true
Result:true
+
Testing basic xsl:apply-templates
Test:<xsl:apply-templates/>
Desired Result:element x, element y, element z
Modified: trunk/LayoutTests/http/tests/misc/large-js-program-expected.txt (231716 => 231717)
--- trunk/LayoutTests/http/tests/misc/large-js-program-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/http/tests/misc/large-js-program-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -3,3 +3,4 @@
This test should generate an out of stack exception, but have no other output.
+
Modified: trunk/LayoutTests/imported/blink/plugins/empty-per-context-data-expected.txt (231716 => 231717)
--- trunk/LayoutTests/imported/blink/plugins/empty-per-context-data-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/imported/blink/plugins/empty-per-context-data-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,4 +1,3 @@
-
This tests that invoking a plugin object from a (iframe) document that is no longer visible in a frame doesn't crash the renderer. If this test is successful, the word SUCCESS should be seen below.
SUCCESS
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (231716 => 231717)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,3 +1,21 @@
+2018-05-11 Ryosuke Niwa <[email protected]>
+
+ Tapping after CSS-based table casues an infinite loop in wordRangeFromPosition
+ https://bugs.webkit.org/show_bug.cgi?id=185465
+ <rdar://problem/35263057>
+
+ Reviewed by Antti Koivisto.
+
+ Rebaselined the tests. h2
+
+ * web-platform-tests/dom/nodes/getElementsByClassName-30-expected.txt: table is generating a new line as expected.
+ * web-platform-tests/html/syntax/parsing/html5lib_menuitem-element-expected.txt: h2 is generating an extra line
+ to emulate its margin as expected.
+ * web-platform-tests/html/syntax/parsing/html5lib_tests11-expected.txt: Ditto.
+ * web-platform-tests/html/syntax/parsing/html5lib_tests21-expected.txt: Ditto.
+ * web-platform-tests/html/syntax/parsing/html5lib_tests25-expected.txt: Ditto.
+ * web-platform-tests/html/syntax/parsing/html5lib_webkit02-expected.txt: Ditto.
+
2018-05-11 Youenn Fablet <[email protected]>
Rebase some fetch API tests
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/getElementsByClassName-30-expected.txt (231716 => 231717)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/getElementsByClassName-30-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/getElementsByClassName-30-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -26,6 +26,7 @@
q s samp small span strike strong sub sup colgroup
caption
th
-td tt u
+td
+ tt u
ul
var
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/html5lib_menuitem-element-expected.txt (231716 => 231717)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/html5lib_menuitem-element-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/html5lib_menuitem-element-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -22,6 +22,7 @@
PASS html5lib_menuitem-element.html 6d596b9e342db2306365fbdfb7615377c5b26347
PASS html5lib_menuitem-element.html 4b712b488be9ee047c139c1b0cd955bae990b8e5
afcd3b1e3317ac609ddab924d836ba1e3873b80f
+
Input
<!DOCTYPE html><body><menuitem>A<menuitem>B
@@ -48,6 +49,7 @@
| <menuitem>
| "B"
95c0c6923fe609297c1592f2cb82bb9f2d0f5aed
+
Input
<!DOCTYPE html><body><menuitem>A<menu>B</menu>
@@ -74,6 +76,7 @@
| <menu>
| "B"
e2772fe779cbcefb4458f169a0cd495cf7115845
+
Input
<!DOCTYPE html><body><menuitem>A<hr>B
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/html5lib_tests11-expected.txt (231716 => 231717)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/html5lib_tests11-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/html5lib_tests11-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -18,6 +18,7 @@
PASS html5lib_tests11.html af40d26164229c29b9be77ed6dd7dda780cba55c
PASS html5lib_tests11.html 16e68d18f8f0fb81013fe77a30b7d396c5081e5e
0e5897aafe87e460f84576c2d1d983504d12a7db
+
Input
<!DOCTYPE html><body><svg attributename='' attributetype='' basefrequency='' baseprofile='' calcmode='' clippathunits='' diffuseconstant='' edgemode='' filterunits='' filterres='' glyphref='' gradienttransform='' gradientunits='' kernelmatrix='' kernelunitlength='' keypoints='' keysplines='' keytimes='' lengthadjust='' limitingconeangle='' markerheight='' markerunits='' markerwidth='' maskcontentunits='' maskunits='' numoctaves='' pathlength='' patterncontentunits='' patterntransform='' patternunits='' pointsatx='' pointsaty='' pointsatz='' preservealpha='' preserveaspectratio='' primitiveunits='' refx='' refy='' repeatcount='' repeatdur='' requiredextensions='' requiredfeatures='' specularconstant='' specularexponent='' spreadmethod='' startoffset='' stddeviation='' stitchtiles='' surfacescale='' systemlanguage='' tablevalues='' targetx='' targety='' textlength='' viewbox='' viewtarget='' xchannelselector='' ychannelselector='' zoomandpan=''&g
t;</svg>
@@ -156,6 +157,7 @@
| yChannelSelector=""
| zoomAndPan=""
a8f7a23601363454b4a13f66aed99ec9708ae87b
+
Input
<!DOCTYPE html><body><svg contentScriptType='' contentStyleType='' externalResourcesRequired='' filterRes=''></svg>
@@ -184,6 +186,7 @@
| externalResourcesRequired=""
| filterRes=""
f8f7f6c576acc9eb874acb0dce6988f0f7b6fc5f
+
Input
<!DOCTYPE html><body><svg CONTENTSCRIPTTYPE='' CONTENTSTYLETYPE='' EXTERNALRESOURCESREQUIRED='' FILTERRES=''></svg>
@@ -212,6 +215,7 @@
| externalResourcesRequired=""
| filterRes=""
fb4dc9f70129a8a045fca3a1e3acee052d0990b3
+
Input
<!DOCTYPE html><body><svg contentscripttype='' contentstyletype='' externalresourcesrequired='' filterres=''></svg>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/html5lib_tests21-expected.txt (231716 => 231717)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/html5lib_tests21-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/html5lib_tests21-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -25,6 +25,7 @@
PASS html5lib_tests21.html 671f606f5cb7033854d99b96b040994f0f451496
PASS html5lib_tests21.html caa80af33c7880aaddd17824efff1774ece01325
80607dd011814b8d3ef5c9ca380fec044dd5e1aa
+
Input
<!DOCTYPE html><svg><![CDATA[foo]]]>
@@ -47,6 +48,7 @@
| <svg svg>
| "foo]]]>"
c9f579bf49de2d4c553d03e43772c0d94be474c0
+
Input
<!DOCTYPE html><svg><![CDATA[foo]]]]]>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/html5lib_tests25-expected.txt (231716 => 231717)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/html5lib_tests25-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/html5lib_tests25-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -22,6 +22,7 @@
PASS html5lib_tests25.html 7f684d19be362ec9aa4fe7ecbba4ff3fc9730a43
PASS html5lib_tests25.html d79f9119d02447226cc2d151044e6cffc5409e81
de4aa726e09215ba9c50b97d257e6c6b880107f1
+
Input
<!DOCTYPE html><body><command>A
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/html5lib_webkit02-expected.txt (231716 => 231717)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/html5lib_webkit02-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/html5lib_webkit02-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -19,6 +19,7 @@
PASS html5lib_webkit02.html 21a5b2b413c4db8ed588334b9a50dea9872bbcfa
PASS html5lib_webkit02.html 90d3f6f2dff994f63293ca46f7cd50a75cde96a6
6e33515b4dc011dd390d433a6358bf68b786b1fd
+
Input
<b><em><foo><foo><foo><aside></b></em>
Modified: trunk/LayoutTests/inspector/console/js-isLikelyStackTrace-expected.txt (231716 => 231717)
--- trunk/LayoutTests/inspector/console/js-isLikelyStackTrace-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/inspector/console/js-isLikelyStackTrace-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,5 +1,6 @@
Test stack trace detection heuristic.
+
== Running test suite: WI.StackTrace.isLikelyStackTrace
-- Running test case: notStacktrace
PASS: Should NOT be a stacktrace.
Modified: trunk/LayoutTests/inspector/console/js-source-locations-expected.txt (231716 => 231717)
--- trunk/LayoutTests/inspector/console/js-source-locations-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/inspector/console/js-source-locations-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -7,6 +7,7 @@
CONSOLE MESSAGE: line 9: error 1
CONSOLE MESSAGE: line 10: error 2
Tests that _javascript_ errors and warnings from inline script tags and external files are sent to the console with correct line and column information.
+
{"source":"console-api","level":"error","text":"error script","location":"errors.js:1:14","parameters":[{"type":"string"}]}
{"source":"console-api","level":"warning","text":"warn script","location":"errors.js:1:44","parameters":[{"type":"string"}]}
{"source":"console-api","level":"error","text":"error script","location":"errors.js:5:18","parameters":[{"type":"string"}]}
Modified: trunk/LayoutTests/mathml/out-of-flow-in-token-crash-expected.txt (231716 => 231717)
--- trunk/LayoutTests/mathml/out-of-flow-in-token-crash-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/mathml/out-of-flow-in-token-crash-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -18,7 +18,6 @@
RenderMathMLScripts
RenderMathMLToken
-
RenderMathMLUnderOver
RenderMathMLBlock (invalid markup)
Modified: trunk/LayoutTests/mathml/presentation/stretchy-depth-height-expected.txt (231716 => 231717)
--- trunk/LayoutTests/mathml/presentation/stretchy-depth-height-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/mathml/presentation/stretchy-depth-height-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -8,6 +8,7 @@
{
x y z x y z x y z x y z x y z
+
{
1
2
Modified: trunk/LayoutTests/platform/mac/accessibility/table-cells-roles-expected.txt (231716 => 231717)
--- trunk/LayoutTests/platform/mac/accessibility/table-cells-roles-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/platform/mac/accessibility/table-cells-roles-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -5,6 +5,7 @@
3. Ukraine Kiev
All 3 countries 3 capitals
+
table2
No Country Capital
1. Germany Berlin
Modified: trunk/LayoutTests/platform/mac/accessibility/table-roles-hierarchy-expected.txt (231716 => 231717)
--- trunk/LayoutTests/platform/mac/accessibility/table-roles-hierarchy-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/platform/mac/accessibility/table-roles-hierarchy-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -5,6 +5,7 @@
All 3 countries 3 capitals
+
This shows the hierarchy of table roles.
role: AXRole: AXTable
Modified: trunk/LayoutTests/svg/foreignObject/fO-fixed-position-crash-expected.txt (231716 => 231717)
--- trunk/LayoutTests/svg/foreignObject/fO-fixed-position-crash-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/svg/foreignObject/fO-fixed-position-crash-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1 +1,2 @@
PASS
+
Modified: trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-region-basic-expected.txt (231716 => 231717)
--- trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-region-basic-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-region-basic-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,5 +1,6 @@
Some text
-Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. here Container
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+here Container
Intermediate
Child
Container
Modified: trunk/LayoutTests/transforms/3d/hit-testing/coplanar-with-camera-expected.txt (231716 => 231717)
--- trunk/LayoutTests/transforms/3d/hit-testing/coplanar-with-camera-expected.txt 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/LayoutTests/transforms/3d/hit-testing/coplanar-with-camera-expected.txt 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,4 +1,5 @@
-The text on this element should be selectable. Hovering on this element should cause a highlight. Element at 98, 200 has id "background": PASS
+The text on this element should be selectable. Hovering on this element should cause a highlight.
+Element at 98, 200 has id "background": PASS
Element at 302, 200 has id "background": PASS
Element at 200, 98 has id "background": PASS
Element at 200, 302 has id "background": PASS
Modified: trunk/Source/WebCore/ChangeLog (231716 => 231717)
--- trunk/Source/WebCore/ChangeLog 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/Source/WebCore/ChangeLog 2018-05-11 20:39:30 UTC (rev 231717)
@@ -1,3 +1,44 @@
+2018-05-11 Ryosuke Niwa <[email protected]>
+
+ Tapping after CSS-based table casues an infinite loop in wordRangeFromPosition
+ https://bugs.webkit.org/show_bug.cgi?id=185465
+ <rdar://problem/35263057>
+
+ Reviewed by Antti Koivisto.
+
+ The bug was caused by TextIterator not emitting a line break when exiting a CSS-based table when an element
+ with `display: table-row` has an invisible text node. Specifically, TextIterator::exitNode is never called on
+ an element with `table-cell: row` when m_node is a text node with whitespaces which appears after an element
+ with `display: table-cell`.
+
+ For example, for a tree structure like:
+ table-row (R)
+ table-cell (C)
+ "text" (1)
+ " " (2)
+ Getting out of (C) would result in moving onto (2) without generating a line break for (R).
+
+ When this happens in nextBoundary as it tries to find the end of the last word in the table cell, we end up
+ finding the end of the document as the end of the word. As a result, nextWordBoundaryInDirection, the caller
+ of nextBoundary, ends up infinite looping between the positon at the end of the document and the position
+ immediately before the last word in the last table cell when it traverses words backwards.
+
+ This patch fixes the hang by addressing this root cause in TextIterator. Namely, TextIterator now generates
+ a line break when exiting a block while walking up ancestors in TextIterator::advance().
+
+ Tests: editing/selection/tapping-in-table-at-end-of-document.html
+ editing/text-iterator/table-at-end-of-document.html
+
+ * editing/TextIterator.cpp:
+ (WebCore::TextIterator::advance): Fixed the bug.
+ (WebCore::shouldEmitNewlineAfterNode): Do generate a new line at the end of a document when we're trying to
+ generate every visible poitions even there are no renderers beyond this point. e.g. a position inside the
+ last cell of a table at the end of a document hits this condition.
+ (WebCore::shouldEmitExtraNewlineForNode): Don't emit a line break when the render box's height is 0px
+ to avoid generating many empty lines for empty paragraph and header elements (this function is used to generate
+ a blank line between p's and h1/h2/...'s).
+ (WebCore::TextIterator::exitNode):
+
2018-05-11 Dean Jackson <[email protected]>
System preview badge doesn't show on <picture> elements
Modified: trunk/Source/WebCore/editing/TextIterator.cpp (231716 => 231717)
--- trunk/Source/WebCore/editing/TextIterator.cpp 2018-05-11 20:18:27 UTC (rev 231716)
+++ trunk/Source/WebCore/editing/TextIterator.cpp 2018-05-11 20:39:30 UTC (rev 231717)
@@ -536,6 +536,8 @@
return;
}
next = nextSibling(m_behavior, *m_node);
+ if (next && m_node->renderer())
+ exitNode(m_node);
}
}
m_fullyClippedStack.pop();
@@ -998,13 +1000,15 @@
&& !renderer->isRubyText();
}
-static bool shouldEmitNewlineAfterNode(Node& node)
+static bool shouldEmitNewlineAfterNode(Node& node, bool emitsCharactersBetweenAllVisiblePositions = false)
{
// FIXME: It should be better but slower to create a VisiblePosition here.
if (!shouldEmitNewlinesBeforeAndAfterNode(node))
return false;
- // Check if this is the very last renderer in the document.
- // If so, then we should not emit a newline.
+
+ // Don't emit a new line at the end of the document unless we're matching the behavior of VisiblePosition.
+ if (emitsCharactersBetweenAllVisiblePositions)
+ return true;
Node* subsequentNode = &node;
while ((subsequentNode = NodeTraversal::nextSkippingChildren(*subsequentNode))) {
if (subsequentNode->renderer())
@@ -1037,8 +1041,12 @@
if (!hasHeaderTag(element) && !is<HTMLParagraphElement>(element))
return false;
- int bottomMargin = downcast<RenderBox>(*renderer).collapsedMarginAfter();
- int fontSize = downcast<RenderBox>(*renderer).style().fontDescription().computedPixelSize();
+ auto& renderBox = downcast<RenderBox>(*renderer);
+ if (!renderBox.height())
+ return false;
+
+ int bottomMargin = renderBox.collapsedMarginAfter();
+ int fontSize = renderBox.style().fontDescription().computedPixelSize();
return bottomMargin * 2 >= fontSize;
}
@@ -1174,7 +1182,7 @@
// the logic in _web_attributedStringFromRange match. We'll get that for free when we switch to use
// TextIterator in _web_attributedStringFromRange.
// See <rdar://problem/5428427> for an example of how this mismatch will cause problems.
- if (m_lastTextNode && shouldEmitNewlineAfterNode(*m_node)) {
+ if (m_lastTextNode && shouldEmitNewlineAfterNode(*m_node, m_behavior & TextIteratorEmitsCharactersBetweenAllVisiblePositions)) {
// use extra newline to represent margin bottom, as needed
bool addNewline = shouldEmitExtraNewlineForNode(*m_node);