Diff
Modified: trunk/LayoutTests/ChangeLog (214109 => 214110)
--- trunk/LayoutTests/ChangeLog 2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/LayoutTests/ChangeLog 2017-03-17 18:54:47 UTC (rev 214110)
@@ -1,3 +1,17 @@
+2017-03-17 Dave Hyatt <[email protected]>
+
+ Initial letter does not paginate properly.
+ https://bugs.webkit.org/show_bug.cgi?id=169795
+ <rdar://problem/23715770>
+
+ Reviewed by Zalan Bujtas.
+
+ * fast/css-generated-content/initial-letter-pagination-raised-expected.html: Added.
+ * fast/css-generated-content/initial-letter-pagination-raised.html: Added.
+ * fast/css-generated-content/initial-letter-pagination-sunken-expected.html: Added.
+ * fast/css-generated-content/initial-letter-pagination-sunken.html: Added.
+ * platform/ios-simulator/TestExpectations:
+
2017-03-17 Youenn Fablet <[email protected]>
RealtimeIncomingAudioSource is not stopping properly
Added: trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised-expected.html (0 => 214110)
--- trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised-expected.html (rev 0)
+++ trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised-expected.html 2017-03-17 18:54:47 UTC (rev 214110)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title></title>
+ <meta charset="utf-8" />
+ <style>
+ body { margin:0; overflow:hidden }
+ div.main { height:500px; width:800px; overflow:hidden; background-color:#eeeeee; }
+ div.column { height:500px; width:200px; float:left }
+ .test-name {
+ font-size:1em;
+ font-weight:bold;
+ line-height:1.2;
+ }
+ p {
+ margin:0;
+ }
+ .drop::first-letter {
+ -webkit-initial-letter:4 3;
+ initial-letter:5 3;
+ padding-right:0.1em;
+ font-weight:normal;
+ }
+ .brk-after {
+ -webkit-column-break-after: always;
+ }
+ .most-of-the-page {
+ height:90px;
+ background-color:#DEF;
+ width:200px;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="main">
+ <div class="column">
+ <p class="drop"><b>Example A: This dropcap appears naturally at the top of the page.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+
+ <p class="brk-after">This paragraph has page-break-after:always; set on it.</p>
+ </div>
+ <div class="column">
+ <p class="drop"><b>Example B: This dropcap appears after a CSS-induced page break.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+
+ <p class="most-of-the-page">This block takes up most of a page, forcing the next paragraph to a new page.</p>
+ </div>
+ <div class="column">
+ <p class="drop"><b>Example C: This dropcap is forced to the top of a new page by being near the bottom of the page.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+ </div>
+ </div>
+
+
+
+ </body>
+</html>
+
+
Added: trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised-rl-expected.html (0 => 214110)
--- trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised-rl-expected.html (rev 0)
+++ trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised-rl-expected.html 2017-03-17 18:54:47 UTC (rev 214110)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title></title>
+ <meta charset="utf-8" />
+ <style>
+ html { writing-mode: vertical-rl }
+ body { margin:0; overflow:hidden }
+ div.main { position:absolute; right:0; top:0; width:500px; height:800px; overflow:hidden; background-color:#eeeeee; }
+ div.column { width:500px; height:200px; float:left }
+ .test-name {
+ font-size:1em;
+ font-weight:bold;
+ line-height:1.2;
+ }
+ p {
+ margin:0;
+ }
+ .drop::first-letter {
+ -webkit-initial-letter:4 3;
+ initial-letter:4 3;
+ padding-bottom:0.1em;
+ font-weight:normal;
+ }
+ .brk-after {
+ -webkit-column-break-after: always;
+ }
+ .most-of-the-page {
+ width:90px;
+ background-color:#DEF;
+ height:200px;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="main">
+ <div class="column">
+ <p class="drop"><b>Example A: This dropcap appears naturally at the top of the page.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+
+ <p class="brk-after">This paragraph has page-break-after:always; set on it.</p>
+ </div><div class="column">
+ <p class="drop"><b>Example B: This dropcap appears after a CSS-induced page break.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+
+ <p class="most-of-the-page">This block takes up most of a page, forcing the next paragraph to a new page.</p>
+ </div><div class="column">
+ <p class="drop"><b>Example C: This dropcap is forced to the top of a new page by being near the bottom of the page.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+ </div>
+ </div>
+
+
+
+ </body>
+</html>
+
+
Added: trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised-rl.html (0 => 214110)
--- trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised-rl.html (rev 0)
+++ trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised-rl.html 2017-03-17 18:54:47 UTC (rev 214110)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title></title>
+ <meta charset="utf-8" />
+ <style>
+ html { writing-mode: vertical-rl }
+ body { margin:0; overflow:hidden }
+ div { column-width:200px; width:500px; height:800px; overflow:hidden; column-gap:0; background-color:#eeeeee; column-fill:auto }
+ .test-name {
+ font-size:1em;
+ font-weight:bold;
+ line-height:1.2;
+ }
+ p {
+ margin:0;
+ }
+ .drop::first-letter {
+ -webkit-initial-letter:4 3;
+ initial-letter:4 3;
+ padding-bottom:0.1em;
+ font-weight:normal;
+ }
+ .brk-after {
+ -webkit-column-break-after: always;
+ }
+ .most-of-the-page {
+ width:90px;
+ background-color:#DEF;
+ height:200px;
+ }
+ </style>
+ </head>
+ <body>
+ <div>
+ <p class="drop"><b>Example A: This dropcap appears naturally at the top of the page.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+
+ <p class="brk-after">This paragraph has page-break-after:always; set on it.</p>
+
+ <p class="drop"><b>Example B: This dropcap appears after a CSS-induced page break.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+
+ <p class="most-of-the-page">This block takes up most of a page, forcing the next paragraph to a new page.</p>
+
+ <p class="drop"><b>Example C: This dropcap is forced to the top of a new page by being near the bottom of the page.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+
+
+
+
+ </body>
+</html>
+
+
Added: trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised.html (0 => 214110)
--- trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised.html (rev 0)
+++ trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-raised.html 2017-03-17 18:54:47 UTC (rev 214110)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title></title>
+ <meta charset="utf-8" />
+ <style>
+ body { margin:0 ; overflow:hidden }
+ div { column-width:200px; height:500px; width:800px; overflow:hidden; column-gap:0; background-color:#eeeeee; column-fill:auto }
+ .test-name {
+ font-size:1em;
+ font-weight:bold;
+ line-height:1.2;
+ }
+ p {
+ margin:0;
+ }
+ .drop::first-letter {
+ -webkit-initial-letter:4 3;
+ initial-letter:5 3;
+ padding-right:0.1em;
+ font-weight:normal;
+ }
+ .brk-after {
+ -webkit-column-break-after: always;
+ }
+ .most-of-the-page {
+ height:90px;
+ background-color:#DEF;
+ width:200px;
+ }
+ </style>
+ </head>
+ <body>
+ <div>
+ <p class="drop"><b>Example A: This dropcap appears naturally at the top of the page.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+
+ <p class="brk-after">This paragraph has page-break-after:always; set on it.</p>
+
+ <p class="drop"><b>Example B: This dropcap appears after a CSS-induced page break.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+
+ <p class="most-of-the-page">This block takes up most of a page, forcing the next paragraph to a new page.</p>
+
+ <p class="drop"><b>Example C: This dropcap is forced to the top of a new page by being near the bottom of the page.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+
+
+
+
+ </body>
+</html>
+
+
Added: trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken-expected.html (0 => 214110)
--- trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken-expected.html (rev 0)
+++ trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken-expected.html 2017-03-17 18:54:47 UTC (rev 214110)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title></title>
+ <meta charset="utf-8" />
+ <style>
+ body { margin:0; overflow:hidden }
+ div.main { height:500px; width:800px; overflow:hidden; background-color:#eeeeee; }
+ div.column { height:500px; width:200px; float:left }
+ .test-name {
+ font-size:1em;
+ font-weight:bold;
+ line-height:1.2;
+ }
+ p {
+ margin:0;
+ }
+ .drop::first-letter {
+ -webkit-initial-letter:2 4;
+ initial-letter:2 4;
+ padding-right:0.1em;
+ font-weight:normal;
+ }
+ .brk-after {
+ -webkit-column-break-after: always;
+ }
+ .most-of-the-page {
+ height:90px;
+ background-color:#DEF;
+ width:200px;
+
+ }
+ </style>
+ </head>
+ <body>
+ <div class="main">
+ <div class="column">
+ <p class="drop"><b>Example A: This dropcap appears naturally at the top of the page.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+
+ <p class="brk-after">This paragraph has page-break-after:always; set on it.</p>
+ </div>
+ <div class="column">
+ <p class="drop"><b>Example B: This dropcap appears after a CSS-induced page break.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+
+ <p class="most-of-the-page">This block takes up most of a page, forcing the next paragraph to a new page.</p>
+ </div>
+ <div class="column">
+ <p class="drop"><b>Example C: This dropcap is forced to the top of a new page by being near the bottom of the page.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+ </div>
+ </div>
+
+
+
+ </body>
+</html>
+
+
Added: trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken-rl-expected.html (0 => 214110)
--- trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken-rl-expected.html (rev 0)
+++ trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken-rl-expected.html 2017-03-17 18:54:47 UTC (rev 214110)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title></title>
+ <meta charset="utf-8" />
+ <style>
+ html { writing-mode: vertical-rl }
+ body { margin:0; overflow:hidden }
+ div.main { position:absolute; right:0; top:0; width:500px; height:800px; overflow:hidden; background-color:#eeeeee; }
+ div.column { width:500px; height:200px; float:left }
+ .test-name {
+ font-size:1em;
+ font-weight:bold;
+ line-height:1.2;
+ }
+ p {
+ margin:0;
+ }
+ .drop::first-letter {
+ -webkit-initial-letter:2 4;
+ initial-letter:2 4;
+ padding-bottom:0.1em;
+ font-weight:normal;
+ }
+ .brk-after {
+ -webkit-column-break-after: always;
+ }
+ .most-of-the-page {
+ width:90px;
+ background-color:#DEF;
+ height:200px;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="main">
+ <div class="column">
+ <p class="drop"><b>Example A: This dropcap appears naturally at the top of the page.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+
+ <p class="brk-after">This paragraph has page-break-after:always; set on it.</p>
+ </div>
+ <div class="column">
+ <p class="drop"><b>Example B: This dropcap appears after a CSS-induced page break.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+
+ <p class="most-of-the-page">This block takes up most of a page, forcing the next paragraph to a new page.</p>
+ </div>
+ <div class="column">
+ <p class="drop"><b>Example C: This dropcap is forced to the top of a new page by being near the bottom of the page.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+ </div>
+ </div>
+
+
+
+ </body>
+</html>
+
+
Added: trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken-rl.html (0 => 214110)
--- trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken-rl.html (rev 0)
+++ trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken-rl.html 2017-03-17 18:54:47 UTC (rev 214110)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title></title>
+ <meta charset="utf-8" />
+ <style>
+ html { writing-mode: vertical-rl }
+ body { margin:0; overflow:hidden }
+ div { column-width:200px; height:800px; width:500px; overflow:hidden; column-gap:0; background-color:#eeeeee; column-fill:auto }
+ .test-name {
+ font-size:1em;
+ font-weight:bold;
+ line-height:1.2;
+ }
+ p {
+ margin:0;
+ }
+ .drop::first-letter {
+ -webkit-initial-letter:2 4;
+ initial-letter:2 4;
+ padding-bottom:0.1em;
+ font-weight:normal;
+ }
+ .brk-after {
+ -webkit-column-break-after: always;
+ }
+ .most-of-the-page {
+ width:90px;
+ background-color:#DEF;
+ height:200px;
+
+ }
+ </style>
+ </head>
+ <body>
+ <div>
+ <p class="drop"><b>Example A: This dropcap appears naturally at the top of the page.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+
+ <p class="brk-after">This paragraph has page-break-after:always; set on it.</p>
+
+ <p class="drop"><b>Example B: This dropcap appears after a CSS-induced page break.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+
+ <p class="most-of-the-page">This block takes up most of a page, forcing the next paragraph to a new page.</p>
+
+ <p class="drop"><b>Example C: This dropcap is forced to the top of a new page by being near the bottom of the page.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+
+
+
+
+ </body>
+</html>
+
+
Added: trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken.html (0 => 214110)
--- trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken.html (rev 0)
+++ trunk/LayoutTests/fast/css-generated-content/initial-letter-pagination-sunken.html 2017-03-17 18:54:47 UTC (rev 214110)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title></title>
+ <meta charset="utf-8" />
+ <style>
+ body { margin:0; overflow:hidden }
+ div { column-width:200px; height:500px; width:800px; overflow:hidden; column-gap:0; background-color:#eeeeee; column-fill:auto }
+ .test-name {
+ font-size:1em;
+ font-weight:bold;
+ line-height:1.2;
+ }
+ p {
+ margin:0;
+ }
+ .drop::first-letter {
+ -webkit-initial-letter:2 4;
+ initial-letter:2 4;
+ padding-right:0.1em;
+ font-weight:normal;
+ }
+ .brk-after {
+ -webkit-column-break-after: always;
+ }
+ .most-of-the-page {
+ height:90px;
+ background-color:#DEF;
+ width:200px;
+
+ }
+ </style>
+ </head>
+ <body>
+ <div>
+ <p class="drop"><b>Example A: This dropcap appears naturally at the top of the page.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+
+ <p class="brk-after">This paragraph has page-break-after:always; set on it.</p>
+
+ <p class="drop"><b>Example B: This dropcap appears after a CSS-induced page break.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+
+ <p class="most-of-the-page">This block takes up most of a page, forcing the next paragraph to a new page.</p>
+
+ <p class="drop"><b>Example C: This dropcap is forced to the top of a new page by being near the bottom of the page.</b> Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. </p>
+
+
+
+
+ </body>
+</html>
+
+
Modified: trunk/LayoutTests/fast/multicol/tall-image-behavior-lr.html (214109 => 214110)
--- trunk/LayoutTests/fast/multicol/tall-image-behavior-lr.html 2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/LayoutTests/fast/multicol/tall-image-behavior-lr.html 2017-03-17 18:54:47 UTC (rev 214110)
@@ -1,6 +1,6 @@
<!doctype html>
<body style="-webkit-writing-mode:vertical-lr">
-<div style="-webkit-columns:2; width:300px; border:2px solid blue;-webkit-line-box-contain:glyphs replaced">
+<div style="-webkit-columns:2; width:300px; border:2px solid blue;-webkit-line-box-contain:font replaced">
<p>This image should not be split across columns.<br>
The reason it should not be split is that the line contains no
text and so we should be willing to allow it to sit at the top of a new
@@ -9,4 +9,4 @@
<div style="display:inline-block; width:100%; height:50px;background-color:lime"></div>
<div style="display:inline-block; height:100%; width:50px;background-color:purple"></div>
-</div></div>
\ No newline at end of file
+</div></div>
Modified: trunk/LayoutTests/fast/multicol/tall-image-behavior-rl.html (214109 => 214110)
--- trunk/LayoutTests/fast/multicol/tall-image-behavior-rl.html 2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/LayoutTests/fast/multicol/tall-image-behavior-rl.html 2017-03-17 18:54:47 UTC (rev 214110)
@@ -1,6 +1,6 @@
<!doctype html>
<body style="-webkit-writing-mode:vertical-rl">
-<div style="-webkit-columns:2; width:300px; border:2px solid blue;-webkit-line-box-contain:glyphs replaced">
+<div style="-webkit-columns:2; width:300px; border:2px solid blue;-webkit-line-box-contain:font replaced">
<p>This image should not be split across columns.<br>
The reason it should not be split is that the line contains no
text and so we should be willing to allow it to sit at the top of a new
@@ -9,4 +9,4 @@
<div style="display:inline-block; width:100%; height:50px;background-color:lime"></div>
<div style="display:inline-block; height:100%; width:50px;background-color:purple"></div>
-</div></div>
\ No newline at end of file
+</div></div>
Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (214109 => 214110)
--- trunk/LayoutTests/platform/ios-simulator/TestExpectations 2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations 2017-03-17 18:54:47 UTC (rev 214110)
@@ -2913,3 +2913,8 @@
# Results differ from desktop
fast/hidpi/percent-height-image-nested.html [ Skip ]
+# Tests only match on desktop
+fast/css-generated-content/initial-letter-pagination-raised.html [ Skip ]
+fast/css-generated-content/initial-letter-pagination-sunken.html [ Skip ]
+fast/css-generated-content/initial-letter-pagination-raised-rl.html [ Skip ]
+fast/css-generated-content/initial-letter-pagination-sunken-rl.html [ Skip ]
Modified: trunk/LayoutTests/platform/mac/fast/block/lineboxcontain/block-with-ideographs-expected.txt (214109 => 214110)
--- trunk/LayoutTests/platform/mac/fast/block/lineboxcontain/block-with-ideographs-expected.txt 2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/LayoutTests/platform/mac/fast/block/lineboxcontain/block-with-ideographs-expected.txt 2017-03-17 18:54:47 UTC (rev 214110)
@@ -4,16 +4,16 @@
RenderBlock {html} at (0,0) size 785x637
RenderBody {body} at (8,8) size 769x621
RenderBlock {div} at (0,0) size 769x203
- RenderBlock {div} at (0,0) size 69x146 [border: (1px solid #FF0000)]
- RenderText {#text} at (7,1) size 55x48
- text run at (7,1) width 48: "\x{70BA}"
+ RenderBlock {div} at (0,0) size 57x146 [border: (1px solid #FF0000)]
+ RenderText {#text} at (1,1) size 55x48
+ text run at (1,1) width 48: "\x{70BA}"
RenderRuby (inline) {ruby} at (0,0) size 55x48
- RenderRubyRun (anonymous) at (1,49) size 67x48
- RenderRubyBase (anonymous) at (0,0) size 67x48
- RenderText {#text} at (6,0) size 55x48
- text run at (6,0) width 48: "\x{6AFB}"
- RenderText {#text} at (7,97) size 55x48
- text run at (7,97) width 48: "\x{7530}"
+ RenderRubyRun (anonymous) at (1,49) size 55x48
+ RenderRubyBase (anonymous) at (0,0) size 55x48
+ RenderText {#text} at (0,0) size 55x48
+ text run at (0,0) width 48: "\x{6AFB}"
+ RenderText {#text} at (1,97) size 55x48
+ text run at (1,97) width 48: "\x{7530}"
RenderBlock {div} at (0,146) size 769x57 [border: (1px solid #008000)]
RenderText {#text} at (1,1) size 48x55
text run at (1,1) width 48: "\x{70BA}"
Modified: trunk/Source/WebCore/ChangeLog (214109 => 214110)
--- trunk/Source/WebCore/ChangeLog 2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/Source/WebCore/ChangeLog 2017-03-17 18:54:47 UTC (rev 214110)
@@ -1,3 +1,87 @@
+2017-03-17 Dave Hyatt <[email protected]>
+
+ Initial letter does not paginate properly.
+ https://bugs.webkit.org/show_bug.cgi?id=169795
+ <rdar://problem/23715770>
+
+ Reviewed by Zalan Bujtas.
+
+ Tests: fast/css-generated-content/initial-letter-pagination-raised.html
+ fast/css-generated-content/initial-letter-pagination-raised-rl.html
+ fast/css-generated-content/initial-letter-pagination-sunken.html
+ fast/css-generated-content/initial-letter-pagination-sunken-rl.html
+
+ * rendering/FloatingObjects.cpp:
+ (WebCore::FloatingObject::FloatingObject):
+ (WebCore::FloatingObject::copyToNewContainer):
+ (WebCore::FloatingObject::cloneForNewParent):
+ (WebCore::FloatingObject::translationOffsetToAncestor):
+ * rendering/FloatingObjects.h:
+ (WebCore::FloatingObject::setMarginOffset):
+ (WebCore::FloatingObject::locationOffsetOfBorderBox):
+ (WebCore::FloatingObject::marginOffset):
+ Add the margin offset to the FloatingObject so that we can control the
+ placement of the border box relative to the margin box without relying
+ on only the CSS-specified margins. This allows for sunken initial letter
+ FloatingObjects to be created and propagated out to ancestor blocks for painting
+ without altering the CSS margins of the sunken letter.
+
+ * rendering/RenderBlockFlow.cpp:
+ (WebCore::RenderBlockFlow::adjustForUnsplittableChild):
+ Update the logical height for initial letter containers after the initial
+ letter shifts to the next page, since the lines that follow need to lay out
+ relative to the initial letter, i.e., they shift down if it shifts down.
+
+ (WebCore::RenderBlockFlow::addOverflowFromFloats):
+ (WebCore::RenderBlockFlow::paintFloats):
+ (WebCore::RenderBlockFlow::clipOutFloatingObjects):
+ Patched to use the new helpers on FloatingObject rather than
+ xPositionForFloatIncludingMargins and yPositionForFloatIncludingMargins.
+
+ (WebCore::RenderBlockFlow::computeLogicalLocationForFloat):
+ Updated to set the placement and margins of the floating object before
+ returning. The initial letter adjustments have been factored out into their
+ own function.
+
+ (WebCore::RenderBlockFlow::adjustInitialLetterPosition):
+ A helper function called by computeLogicalLocationForFloat that handles
+ the placement and margin adjustments for initial letters. Note that sunken
+ letters no longer "hack" the top margin of the child but instead rely on
+ the fact that the FloatingObject has its own independent margin offset now
+ that can be set to a value that is distinct from the CSS supplied margin.
+
+ (WebCore::RenderBlockFlow::positionNewFloats):
+ Revised to no longer do the placement, but to let computeLogicalLocationForFloat
+ do it. The height is still set here however, since we don't know that until after
+ the child has received a layout.
+
+ (WebCore::RenderBlockFlow::addOverhangingFloats):
+ (WebCore::RenderBlockFlow::flipFloatForWritingModeForChild):
+ (WebCore::RenderBlockFlow::hitTestFloats):
+ (WebCore::RenderBlockFlow::adjustForBorderFit):
+ Patched to use the new FloatingObject helpers rather than
+ xPositionForFloatIncludingMargins and yPositionForFloatIncludingMargins.
+
+ * rendering/RenderBlockFlow.h:
+ (WebCore::RenderBlockFlow::setLogicalMarginsForFloat):
+ New helper function for setting the margin offsets on a FloatingObject.
+
+ (WebCore::RenderBlockFlow::xPositionForFloatIncludingMargin): Deleted.
+ (WebCore::RenderBlockFlow::yPositionForFloatIncludingMargin): Deleted.
+ Deleted in favor of new FloatingObject helpers.
+
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::isUnsplittableForPagination):
+ Make initial letter unsplittable as far as pagination is concerned.
+
+ * rendering/RootInlineBox.cpp:
+ (WebCore::RootInlineBox::ascentAndDescentForBox):
+ (WebCore::RootInlineBox::includeFontForBox):
+ (WebCore::RootInlineBox::includeGlyphsForBox):
+ (WebCore::RootInlineBox::fitsToGlyphs):
+ Turn off the restriction that you can't fit to vertical glyphs. The numbers returned
+ are fine now. This allows vertical initial letters to work.
+
2017-03-17 Youenn Fablet <[email protected]>
RealtimeIncomingAudioSource is not stopping properly
Modified: trunk/Source/WebCore/rendering/FloatingObjects.cpp (214109 => 214110)
--- trunk/Source/WebCore/rendering/FloatingObjects.cpp 2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/Source/WebCore/rendering/FloatingObjects.cpp 2017-03-17 18:54:47 UTC (rev 214110)
@@ -36,6 +36,7 @@
void* pointers[2];
LayoutRect rect;
int paginationStrut;
+ LayoutSize size;
uint32_t bitfields : 8;
};
@@ -43,8 +44,6 @@
FloatingObject::FloatingObject(RenderBox& renderer)
: m_renderer(renderer)
- , m_originatingLine(nullptr)
- , m_paginationStrut(0)
, m_shouldPaint(true)
, m_isDescendant(false)
, m_isPlaced(false)
@@ -60,11 +59,10 @@
m_type = FloatRight;
}
-FloatingObject::FloatingObject(RenderBox& renderer, Type type, const LayoutRect& frameRect, bool shouldPaint, bool isDescendant)
+FloatingObject::FloatingObject(RenderBox& renderer, Type type, const LayoutRect& frameRect, const LayoutSize& marginOffset, bool shouldPaint, bool isDescendant)
: m_renderer(renderer)
- , m_originatingLine(nullptr)
, m_frameRect(frameRect)
- , m_paginationStrut(0)
+ , m_marginOffset(marginOffset)
, m_type(type)
, m_shouldPaint(shouldPaint)
, m_isDescendant(isDescendant)
@@ -85,17 +83,22 @@
std::unique_ptr<FloatingObject> FloatingObject::copyToNewContainer(LayoutSize offset, bool shouldPaint, bool isDescendant) const
{
- return std::make_unique<FloatingObject>(renderer(), type(), LayoutRect(frameRect().location() - offset, frameRect().size()), shouldPaint, isDescendant);
+ return std::make_unique<FloatingObject>(renderer(), type(), LayoutRect(frameRect().location() - offset, frameRect().size()), marginOffset(), shouldPaint, isDescendant);
}
std::unique_ptr<FloatingObject> FloatingObject::cloneForNewParent() const
{
- auto cloneObject = std::make_unique<FloatingObject>(renderer(), type(), m_frameRect, m_shouldPaint, m_isDescendant);
+ auto cloneObject = std::make_unique<FloatingObject>(renderer(), type(), m_frameRect, m_marginOffset, m_shouldPaint, m_isDescendant);
cloneObject->m_paginationStrut = m_paginationStrut;
cloneObject->m_isPlaced = m_isPlaced;
return cloneObject;
}
+LayoutSize FloatingObject::translationOffsetToAncestor() const
+{
+ return locationOffsetOfBorderBox() - renderer().locationOffset();
+}
+
inline static bool rangesIntersect(LayoutUnit floatTop, LayoutUnit floatBottom, LayoutUnit objectTop, LayoutUnit objectBottom)
{
if (objectTop >= floatBottom || objectBottom < floatTop)
Modified: trunk/Source/WebCore/rendering/FloatingObjects.h (214109 => 214110)
--- trunk/Source/WebCore/rendering/FloatingObjects.h 2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/Source/WebCore/rendering/FloatingObjects.h 2017-03-17 18:54:47 UTC (rev 214110)
@@ -43,7 +43,7 @@
std::unique_ptr<FloatingObject> cloneForNewParent() const;
explicit FloatingObject(RenderBox&);
- FloatingObject(RenderBox&, Type, const LayoutRect&, bool shouldPaint, bool isDescendant);
+ FloatingObject(RenderBox&, Type, const LayoutRect&, const LayoutSize&, bool shouldPaint, bool isDescendant);
Type type() const { return static_cast<Type>(m_type); }
RenderBox& renderer() const { return m_renderer; }
@@ -63,6 +63,8 @@
void setWidth(LayoutUnit width) { ASSERT(!isInPlacedTree()); m_frameRect.setWidth(width); }
void setHeight(LayoutUnit height) { ASSERT(!isInPlacedTree()); m_frameRect.setHeight(height); }
+ void setMarginOffset(LayoutSize offset) { ASSERT(!isInPlacedTree()); m_marginOffset = offset; }
+
const LayoutRect& frameRect() const { ASSERT(isPlaced()); return m_frameRect; }
void setFrameRect(const LayoutRect& frameRect) { ASSERT(!isInPlacedTree()); m_frameRect = frameRect; }
@@ -83,11 +85,20 @@
RootInlineBox* originatingLine() const { return m_originatingLine; }
void setOriginatingLine(RootInlineBox* line) { m_originatingLine = line; }
+ LayoutSize locationOffsetOfBorderBox() const
+ {
+ ASSERT(isPlaced());
+ return LayoutSize(m_frameRect.location().x() + m_marginOffset.width(), m_frameRect.location().y() + m_marginOffset.height());
+ }
+ LayoutSize marginOffset() const { ASSERT(isPlaced()); return m_marginOffset; }
+ LayoutSize translationOffsetToAncestor() const;
+
private:
RenderBox& m_renderer;
- RootInlineBox* m_originatingLine;
+ RootInlineBox* m_originatingLine { nullptr };
LayoutRect m_frameRect;
LayoutUnit m_paginationStrut;
+ LayoutSize m_marginOffset;
unsigned m_type : 2; // Type (left or right aligned)
unsigned m_shouldPaint : 1;
Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (214109 => 214110)
--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2017-03-17 18:54:47 UTC (rev 214110)
@@ -1862,13 +1862,13 @@
return (endRegion && region != endRegion);
}
-LayoutUnit RenderBlockFlow::adjustForUnsplittableChild(RenderBox& child, LayoutUnit logicalOffset, bool includeMargins)
+LayoutUnit RenderBlockFlow::adjustForUnsplittableChild(RenderBox& child, LayoutUnit logicalOffset, LayoutUnit childBeforeMargin, LayoutUnit childAfterMargin)
{
if (!childBoxIsUnsplittableForFragmentation(child))
return logicalOffset;
RenderFlowThread* flowThread = flowThreadContainingBlock();
- LayoutUnit childLogicalHeight = logicalHeightForChild(child) + (includeMargins ? marginBeforeForChild(child) + marginAfterForChild(child) : LayoutUnit());
+ LayoutUnit childLogicalHeight = logicalHeightForChild(child) + childBeforeMargin + childAfterMargin;
LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset);
bool hasUniformPageLogicalHeight = !flowThread || flowThread->regionsHaveUniformLogicalHeight();
updateMinimumPageHeight(logicalOffset, childLogicalHeight);
@@ -1879,8 +1879,15 @@
if (remainingLogicalHeight < childLogicalHeight) {
if (!hasUniformPageLogicalHeight && !pushToNextPageWithMinimumLogicalHeight(remainingLogicalHeight, logicalOffset, childLogicalHeight))
return logicalOffset;
- return logicalOffset + remainingLogicalHeight;
+ auto result = logicalOffset + remainingLogicalHeight;
+ bool isInitialLetter = child.isFloating() && child.style().styleType() == FIRST_LETTER && child.style().initialLetterDrop() > 0;
+ if (isInitialLetter) {
+ // Increase our logical height to ensure that lines all get pushed along with the letter.
+ setLogicalHeight(logicalOffset + remainingLogicalHeight);
+ }
+ return result;
}
+
return logicalOffset;
}
@@ -2166,7 +2173,7 @@
for (auto it = floatingObjectSet.begin(); it != end; ++it) {
const auto& floatingObject = *it->get();
if (floatingObject.isDescendant())
- addOverflowFromChild(&floatingObject.renderer(), IntSize(xPositionForFloatIncludingMargin(floatingObject), yPositionForFloatIncludingMargin(floatingObject)));
+ addOverflowFromChild(&floatingObject.renderer(), floatingObject.locationOffsetOfBorderBox());
}
}
@@ -2233,10 +2240,7 @@
if (floatingObject.shouldPaint() && !renderer.hasSelfPaintingLayer()) {
PaintInfo currentPaintInfo(paintInfo);
currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground;
- // FIXME: LayoutPoint version of xPositionForFloatIncludingMargin would make this much cleaner.
- LayoutPoint childPoint = flipFloatForWritingModeForChild(floatingObject,
- LayoutPoint(paintOffset.x() + xPositionForFloatIncludingMargin(floatingObject) - renderer.x(),
- paintOffset.y() + yPositionForFloatIncludingMargin(floatingObject) - renderer.y()));
+ LayoutPoint childPoint = flipFloatForWritingModeForChild(floatingObject, paintOffset + floatingObject.translationOffsetToAncestor());
renderer.paint(currentPaintInfo, childPoint);
if (!preservePhase) {
currentPaintInfo.phase = PaintPhaseChildBlockBackgrounds;
@@ -2259,9 +2263,8 @@
auto end = floatingObjectSet.end();
for (auto it = floatingObjectSet.begin(); it != end; ++it) {
const auto& floatingObject = *it->get();
- LayoutRect floatBox(offsetFromRootBlock.width() + xPositionForFloatIncludingMargin(floatingObject),
- offsetFromRootBlock.height() + yPositionForFloatIncludingMargin(floatingObject),
- floatingObject.renderer().width(), floatingObject.renderer().height());
+ LayoutRect floatBox(offsetFromRootBlock.width(), offsetFromRootBlock.height(), floatingObject.renderer().width(), floatingObject.renderer().height());
+ floatBox.move(floatingObject.locationOffsetOfBorderBox());
rootBlock.flipForWritingMode(floatBox);
floatBox.move(rootBlockPhysicalPosition.x(), rootBlockPhysicalPosition.y());
paintInfo->context().clipOut(snappedIntRect(floatBox));
@@ -2392,7 +2395,7 @@
return adjustLogicalRightOffsetForLine(offset, applyTextIndent);
}
-LayoutPoint RenderBlockFlow::computeLogicalLocationForFloat(const FloatingObject& floatingObject, LayoutUnit logicalTopOffset)
+void RenderBlockFlow::computeLogicalLocationForFloat(FloatingObject& floatingObject, LayoutUnit& logicalTopOffset)
{
auto& childBox = floatingObject.renderer();
LayoutUnit logicalLeftOffset = logicalLeftOffsetForContent(logicalTopOffset); // Constant part of left offset.
@@ -2448,37 +2451,49 @@
floatLogicalLeft -= logicalWidthForFloat(floatingObject);
}
- if (isInitialLetter) {
- const RenderStyle& style = firstLineStyle();
- const FontMetrics& fontMetrics = style.fontMetrics();
- if (fontMetrics.hasCapHeight()) {
- LayoutUnit heightOfLine = lineHeight(true, isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes);
- LayoutUnit beforeMarginBorderPadding = childBox.borderAndPaddingBefore() + childBox.marginBefore();
-
- // Make an adjustment to align with the cap height of a theoretical block line.
- LayoutUnit adjustment = fontMetrics.ascent() + (heightOfLine - fontMetrics.height()) / 2 - fontMetrics.capHeight() - beforeMarginBorderPadding;
- logicalTopOffset += adjustment;
-
- // For sunken and raised caps, we have to make some adjustments. Test if we're sunken or raised (dropHeightDelta will be
- // positive for raised and negative for sunken).
- int dropHeightDelta = childBox.style().initialLetterHeight() - childBox.style().initialLetterDrop();
-
- // If we're sunken, the float needs to shift down but lines still need to avoid it. In order to do that we increase the float's margin.
- if (dropHeightDelta < 0) {
- LayoutUnit marginTopIncrease = -dropHeightDelta * heightOfLine;
- childBox.setMarginBefore(childBox.marginTop() + marginTopIncrease);
- }
-
- // If we're raised, then we actually have to grow the height of the block, since the lines have to be pushed down as though we're placing
- // empty lines beside the first letter.
- if (dropHeightDelta > 0)
- setLogicalHeight(logicalHeight() + dropHeightDelta * heightOfLine);
- }
- }
+ LayoutUnit childLogicalLeftMargin = style().isLeftToRightDirection() ? marginStartForChild(childBox) : marginEndForChild(childBox);
+ LayoutUnit childBeforeMargin = marginBeforeForChild(childBox);
- return LayoutPoint(floatLogicalLeft, logicalTopOffset);
+ if (isInitialLetter)
+ adjustInitialLetterPosition(childBox, logicalTopOffset, childBeforeMargin);
+
+ setLogicalLeftForFloat(floatingObject, floatLogicalLeft);
+ setLogicalLeftForChild(childBox, floatLogicalLeft + childLogicalLeftMargin);
+
+ setLogicalTopForFloat(floatingObject, logicalTopOffset);
+ setLogicalTopForChild(childBox, logicalTopOffset + childBeforeMargin);
+
+ setLogicalMarginsForFloat(floatingObject, childLogicalLeftMargin, childBeforeMargin);
}
+void RenderBlockFlow::adjustInitialLetterPosition(RenderBox& childBox, LayoutUnit& logicalTopOffset, LayoutUnit& marginBeforeOffset)
+{
+ const RenderStyle& style = firstLineStyle();
+ const FontMetrics& fontMetrics = style.fontMetrics();
+ if (!fontMetrics.hasCapHeight())
+ return;
+
+ LayoutUnit heightOfLine = lineHeight(true, isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes);
+ LayoutUnit beforeMarginBorderPadding = childBox.borderAndPaddingBefore() + childBox.marginBefore();
+
+ // Make an adjustment to align with the cap height of a theoretical block line.
+ LayoutUnit adjustment = fontMetrics.ascent() + (heightOfLine - fontMetrics.height()) / 2 - fontMetrics.capHeight() - beforeMarginBorderPadding;
+ logicalTopOffset += adjustment;
+
+ // For sunken and raised caps, we have to make some adjustments. Test if we're sunken or raised (dropHeightDelta will be
+ // positive for raised and negative for sunken).
+ int dropHeightDelta = childBox.style().initialLetterHeight() - childBox.style().initialLetterDrop();
+
+ // If we're sunken, the float needs to shift down but lines still need to avoid it. In order to do that we increase the float's margin.
+ if (dropHeightDelta < 0)
+ marginBeforeOffset += -dropHeightDelta * heightOfLine;
+
+ // If we're raised, then we actually have to grow the height of the block, since the lines have to be pushed down as though we're placing
+ // empty lines beside the first letter.
+ if (dropHeightDelta > 0)
+ setLogicalHeight(logicalHeight() + dropHeightDelta * heightOfLine);
+}
+
bool RenderBlockFlow::positionNewFloats()
{
if (!m_floatingObjects)
@@ -2524,8 +2539,6 @@
if (childBox.containingBlock() != this)
continue;
- LayoutUnit childLogicalLeftMargin = style().isLeftToRightDirection() ? marginStartForChild(childBox) : marginEndForChild(childBox);
-
LayoutRect oldRect = childBox.frameRect();
if (childBox.style().clear() & CLEFT)
@@ -2533,28 +2546,24 @@
if (childBox.style().clear() & CRIGHT)
logicalTop = std::max(lowestFloatLogicalBottom(FloatingObject::FloatRight), logicalTop);
- LayoutPoint floatLogicalLocation = computeLogicalLocationForFloat(floatingObject, logicalTop);
+ computeLogicalLocationForFloat(floatingObject, logicalTop);
+ LayoutUnit childLogicalTop = logicalTopForChild(childBox);
- setLogicalLeftForFloat(floatingObject, floatLogicalLocation.x());
-
- setLogicalLeftForChild(childBox, floatLogicalLocation.x() + childLogicalLeftMargin);
- setLogicalTopForChild(childBox, floatLogicalLocation.y() + marginBeforeForChild(childBox));
-
estimateRegionRangeForBoxChild(childBox);
childBox.markForPaginationRelayoutIfNeeded();
childBox.layoutIfNeeded();
-
+
LayoutState* layoutState = view().layoutState();
bool isPaginated = layoutState->isPaginated();
if (isPaginated) {
// If we are unsplittable and don't fit, then we need to move down.
// We include our margins as part of the unsplittable area.
- LayoutUnit newLogicalTop = adjustForUnsplittableChild(childBox, floatLogicalLocation.y(), true);
+ LayoutUnit newLogicalTop = adjustForUnsplittableChild(childBox, logicalTop, childLogicalTop - logicalTop, marginAfterForChild(childBox));
// See if we have a pagination strut that is making us move down further.
- // Note that an unsplittable child can't also have a pagination strut, so this is
- // exclusive with the case above.
+ // Note that an unsplittable child can't also have a pagination strut, so this
+ // is exclusive with the case above.
RenderBlock* childBlock = is<RenderBlock>(childBox) ? &downcast<RenderBlock>(childBox) : nullptr;
if (childBlock && childBlock->paginationStrut()) {
newLogicalTop += childBlock->paginationStrut();
@@ -2561,18 +2570,13 @@
childBlock->setPaginationStrut(0);
}
- if (newLogicalTop != floatLogicalLocation.y()) {
- floatingObject.setPaginationStrut(newLogicalTop - floatLogicalLocation.y());
-
- floatLogicalLocation = computeLogicalLocationForFloat(floatingObject, newLogicalTop);
- setLogicalLeftForFloat(floatingObject, floatLogicalLocation.x());
-
- setLogicalLeftForChild(childBox, floatLogicalLocation.x() + childLogicalLeftMargin);
- setLogicalTopForChild(childBox, floatLogicalLocation.y() + marginBeforeForChild(childBox));
-
+ if (newLogicalTop != logicalTop) {
+ floatingObject.setPaginationStrut(newLogicalTop - logicalTop);
+ computeLogicalLocationForFloat(floatingObject, newLogicalTop);
if (childBlock)
childBlock->setChildNeedsLayout(MarkOnlyThis);
childBox.layoutIfNeeded();
+ logicalTop = newLogicalTop;
}
if (updateRegionRangeForBoxChild(childBox)) {
@@ -2581,10 +2585,8 @@
}
}
- setLogicalTopForFloat(floatingObject, floatLogicalLocation.y());
+ setLogicalHeightForFloat(floatingObject, logicalHeightForChildForFragmentation(childBox) + (logicalTopForChild(childBox) - logicalTop) + marginAfterForChild(childBox));
- setLogicalHeightForFloat(floatingObject, logicalHeightForChildForFragmentation(childBox) + marginBeforeForChild(childBox) + marginAfterForChild(childBox));
-
m_floatingObjects->addPlacedObject(&floatingObject);
if (ShapeOutsideInfo* shapeOutside = childBox.shapeOutsideInfo())
@@ -2733,7 +2735,7 @@
// Since the float doesn't overhang, it didn't get put into our list. We need to add its overflow in to the child now.
if (floatingObject.isDescendant())
- child.addOverflowFromChild(&renderer, LayoutSize(xPositionForFloatIncludingMargin(floatingObject), yPositionForFloatIncludingMargin(floatingObject)));
+ child.addOverflowFromChild(&renderer, floatingObject.locationOffsetOfBorderBox());
}
}
return lowestFloatLogicalBottom;
@@ -2851,8 +2853,8 @@
// it's going to get added back in. We hide this complication here so that the calling code looks normal for the unflipped
// case.
if (isHorizontalWritingMode())
- return LayoutPoint(point.x(), point.y() + height() - child.renderer().height() - 2 * yPositionForFloatIncludingMargin(child));
- return LayoutPoint(point.x() + width() - child.renderer().width() - 2 * xPositionForFloatIncludingMargin(child), point.y());
+ return LayoutPoint(point.x(), point.y() + height() - child.renderer().height() - 2 * child.locationOffsetOfBorderBox().height());
+ return LayoutPoint(point.x() + width() - child.renderer().width() - 2 * child.locationOffsetOfBorderBox().width(), point.y());
}
LayoutUnit RenderBlockFlow::getClearDelta(RenderBox& child, LayoutUnit logicalTop)
@@ -2943,9 +2945,7 @@
const auto& floatingObject = *it->get();
auto& renderer = floatingObject.renderer();
if (floatingObject.shouldPaint() && !renderer.hasSelfPaintingLayer()) {
- LayoutUnit xOffset = xPositionForFloatIncludingMargin(floatingObject) - renderer.x();
- LayoutUnit yOffset = yPositionForFloatIncludingMargin(floatingObject) - renderer.y();
- LayoutPoint childPoint = flipFloatForWritingModeForChild(floatingObject, adjustedLocation + LayoutSize(xOffset, yOffset));
+ LayoutPoint childPoint = flipFloatForWritingModeForChild(floatingObject, adjustedLocation + floatingObject.translationOffsetToAncestor());
if (renderer.hitTest(request, result, locationInContainer, childPoint)) {
updateHitTestResult(result, locationInContainer.point() - toLayoutSize(childPoint));
return true;
@@ -3003,7 +3003,7 @@
const auto& floatingObject = *it->get();
// Only examine the object if our m_shouldPaint flag is set.
if (floatingObject.shouldPaint()) {
- LayoutUnit floatLeft = xPositionForFloatIncludingMargin(floatingObject) - floatingObject.renderer().x();
+ LayoutUnit floatLeft = floatingObject.translationOffsetToAncestor().width();
LayoutUnit floatRight = floatLeft + floatingObject.renderer().width();
left = std::min(left, floatLeft);
right = std::max(right, floatRight);
Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.h (214109 => 214110)
--- trunk/Source/WebCore/rendering/RenderBlockFlow.h 2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.h 2017-03-17 18:54:47 UTC (rev 214110)
@@ -333,10 +333,14 @@
else
floatingObject.setHeight(logicalWidth);
}
+ void setLogicalMarginsForFloat(FloatingObject& floatingObject, LayoutUnit logicalLeftMargin, LayoutUnit logicalBeforeMargin)
+ {
+ if (isHorizontalWritingMode())
+ floatingObject.setMarginOffset(LayoutSize(logicalLeftMargin, logicalBeforeMargin));
+ else
+ floatingObject.setMarginOffset(LayoutSize(logicalBeforeMargin, logicalLeftMargin));
+ }
- LayoutUnit xPositionForFloatIncludingMargin(const FloatingObject& floatingObject) const { return isHorizontalWritingMode() ? floatingObject.x() + floatingObject.renderer().marginLeft() : floatingObject.x() + marginBeforeForChild(floatingObject.renderer()); }
- LayoutUnit yPositionForFloatIncludingMargin(const FloatingObject& floatingObject) const { return isHorizontalWritingMode() ? floatingObject.y() + marginBeforeForChild(floatingObject.renderer()) : floatingObject.y() + floatingObject.renderer().marginTop(); }
-
LayoutPoint flipFloatForWritingModeForChild(const FloatingObject&, const LayoutPoint&) const;
RenderLineBoxList& lineBoxes() { return m_lineBoxes; }
@@ -409,7 +413,7 @@
bool pushToNextPageWithMinimumLogicalHeight(LayoutUnit& adjustment, LayoutUnit logicalOffset, LayoutUnit minimumLogicalHeight) const;
// If the child is unsplittable and can't fit on the current page, return the top of the next page/column.
- LayoutUnit adjustForUnsplittableChild(RenderBox& child, LayoutUnit logicalOffset, bool includeMargins = false);
+ LayoutUnit adjustForUnsplittableChild(RenderBox& child, LayoutUnit logicalOffset, LayoutUnit beforeMargin = LayoutUnit(), LayoutUnit afterMargin = LayoutUnit());
LayoutUnit adjustBlockChildForPagination(LayoutUnit logicalTopAfterClear, LayoutUnit estimateWithoutPagination, RenderBox& child, bool atBeforeSideOfBlock);
LayoutUnit applyBeforeBreak(RenderBox& child, LayoutUnit logicalOffset); // If the child has a before break, then return a new yPos that shifts to the top of the next page/column.
LayoutUnit applyAfterBreak(RenderBox& child, LayoutUnit logicalOffset, MarginInfo&); // If the child has an after break, then return a new offset that shifts to the top of the next page/column.
@@ -492,7 +496,7 @@
FloatingObject* insertFloatingObject(RenderBox&);
void removeFloatingObject(RenderBox&);
void removeFloatingObjectsBelow(FloatingObject*, int logicalOffset);
- LayoutPoint computeLogicalLocationForFloat(const FloatingObject&, LayoutUnit logicalTopOffset);
+ void computeLogicalLocationForFloat(FloatingObject&, LayoutUnit& logicalTopOffset);
// Called from lineWidth, to position the floats added in the last line.
// Returns true if and only if it has positioned any floats.
@@ -599,6 +603,8 @@
void computeInlinePreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const;
+ void adjustInitialLetterPosition(RenderBox& childBox, LayoutUnit& logicalTopOffset, LayoutUnit& marginBeforeOffset);
+
#if ENABLE(TEXT_AUTOSIZING)
int m_widthForTextAutosizing;
unsigned m_lineCountForTextAutosizing : 2;
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (214109 => 214110)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2017-03-17 18:54:47 UTC (rev 214110)
@@ -4750,6 +4750,7 @@
return isReplaced()
|| hasUnsplittableScrollingOverflow()
|| (parent() && isWritingModeRoot())
+ || (isFloating() && style().styleType() == FIRST_LETTER && style().initialLetterDrop() > 0)
|| isRenderNamedFlowFragmentContainer()
|| fixedPositionedWithNamedFlowContainingBlock();
}
Modified: trunk/Source/WebCore/rendering/RootInlineBox.cpp (214109 => 214110)
--- trunk/Source/WebCore/rendering/RootInlineBox.cpp 2017-03-17 17:58:18 UTC (rev 214109)
+++ trunk/Source/WebCore/rendering/RootInlineBox.cpp 2017-03-17 18:54:47 UTC (rev 214110)
@@ -986,8 +986,7 @@
}
if (includeInitialLetterForBox(box)) {
- // FIXME: Can't use glyph bounds in vertical writing mode because they are garbage.
- bool canUseGlyphs = isHorizontal() && glyphOverflow && glyphOverflow->computeBounds;
+ bool canUseGlyphs = glyphOverflow && glyphOverflow->computeBounds;
int letterAscent = baselineType() == AlphabeticBaseline ? boxLineStyle.fontMetrics().capHeight() : (canUseGlyphs ? glyphOverflow->top : boxLineStyle.fontMetrics().ascent(baselineType()));
int letterDescent = canUseGlyphs ? glyphOverflow->bottom : (box.isRootInlineBox() ? 0 : boxLineStyle.fontMetrics().descent(baselineType()));
setAscentAndDescent(ascent, descent, letterAscent, letterDescent, ascentDescentSet);
@@ -1104,9 +1103,8 @@
if (!box.behavesLikeText() && is<InlineFlowBox>(box) && !downcast<InlineFlowBox>(box).hasTextChildren())
return false;
- // For now map "glyphs" to "font" in vertical text mode until the bounds returned by glyphs aren't garbage.
LineBoxContain lineBoxContain = renderer().style().lineBoxContain();
- return (lineBoxContain & LineBoxContainFont) || (!isHorizontal() && (lineBoxContain & LineBoxContainGlyphs));
+ return (lineBoxContain & LineBoxContainFont);
}
bool RootInlineBox::includeGlyphsForBox(InlineBox& box) const
@@ -1117,9 +1115,8 @@
if (!box.behavesLikeText() && is<InlineFlowBox>(box) && !downcast<InlineFlowBox>(box).hasTextChildren())
return false;
- // FIXME: We can't fit to glyphs yet for vertical text, since the bounds returned are garbage.
LineBoxContain lineBoxContain = renderer().style().lineBoxContain();
- return isHorizontal() && (lineBoxContain & LineBoxContainGlyphs);
+ return (lineBoxContain & LineBoxContainGlyphs);
}
bool RootInlineBox::includeInitialLetterForBox(InlineBox& box) const
@@ -1146,9 +1143,8 @@
bool RootInlineBox::fitsToGlyphs() const
{
- // FIXME: We can't fit to glyphs yet for vertical text, since the bounds returned are garbage.
LineBoxContain lineBoxContain = renderer().style().lineBoxContain();
- return isHorizontal() && ((lineBoxContain & LineBoxContainGlyphs) || (lineBoxContain & LineBoxContainInitialLetter));
+ return ((lineBoxContain & LineBoxContainGlyphs) || (lineBoxContain & LineBoxContainInitialLetter));
}
bool RootInlineBox::includesRootLineBoxFontOrLeading() const