Title: [230148] trunk/Tools
- Revision
- 230148
- Author
- [email protected]
- Date
- 2018-04-01 22:03:57 -0700 (Sun, 01 Apr 2018)
Log Message
[LayoutReloaded] Use containing block's contentBox left edge when the float is to the right.
https://bugs.webkit.org/show_bug.cgi?id=184230
Reviewed by Antti Koivisto.
* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext.prototype._mapFloatingPosition):
(InlineFormattingContext):
* LayoutReloaded/test/index.html:
* LayoutReloaded/test/inline-formatting-context-with-floats2.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/Tools/ChangeLog (230147 => 230148)
--- trunk/Tools/ChangeLog 2018-04-02 03:18:50 UTC (rev 230147)
+++ trunk/Tools/ChangeLog 2018-04-02 05:03:57 UTC (rev 230148)
@@ -1,5 +1,18 @@
2018-04-01 Zalan Bujtas <[email protected]>
+ [LayoutReloaded] Use containing block's contentBox left edge when the float is to the right.
+ https://bugs.webkit.org/show_bug.cgi?id=184230
+
+ Reviewed by Antti Koivisto.
+
+ * LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
+ (InlineFormattingContext.prototype._mapFloatingPosition):
+ (InlineFormattingContext):
+ * LayoutReloaded/test/index.html:
+ * LayoutReloaded/test/inline-formatting-context-with-floats2.html: Added.
+
+2018-04-01 Zalan Bujtas <[email protected]>
+
[LayoutReloaded] Right floating box reduces available line width.
https://bugs.webkit.org/show_bug.cgi?id=184226
Modified: trunk/Tools/LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js (230147 => 230148)
--- trunk/Tools/LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js 2018-04-02 03:18:50 UTC (rev 230147)
+++ trunk/Tools/LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js 2018-04-02 05:03:57 UTC (rev 230148)
@@ -124,7 +124,12 @@
let floatFormattingRoot = this.displayBox(this.floatingContext().formattingRoot());
if (root == floatFormattingRoot)
return verticalPosition;
- return verticalPosition - Utils.mapPosition(root.topLeft(), root, floatFormattingRoot).left();
+ let rootLeft = Utils.mapPosition(root.topLeft(), root, floatFormattingRoot).left();
+ rootLeft += root.contentBox().left();
+ // The left most float is to the right of the root.
+ if (rootLeft >= verticalPosition)
+ return root.contentBox().left();
+ return verticalPosition - rootLeft;
}
}
Modified: trunk/Tools/LayoutReloaded/test/index.html (230147 => 230148)
--- trunk/Tools/LayoutReloaded/test/index.html 2018-04-02 03:18:50 UTC (rev 230147)
+++ trunk/Tools/LayoutReloaded/test/index.html 2018-04-02 05:03:57 UTC (rev 230148)
@@ -65,7 +65,8 @@
"simple-inline-text.html",
"simple-multiline-text.html",
"inline-formatting-context-with-floats.html",
- "inline-with-floats-right-left-simple.html"
+ "inline-with-floats-right-left-simple.html",
+ "inline-formatting-context-with-floats2.html"
];
let debugThis = [];
Added: trunk/Tools/LayoutReloaded/test/inline-formatting-context-with-floats2.html (0 => 230148)
--- trunk/Tools/LayoutReloaded/test/inline-formatting-context-with-floats2.html (rev 0)
+++ trunk/Tools/LayoutReloaded/test/inline-formatting-context-with-floats2.html 2018-04-02 05:03:57 UTC (rev 230148)
@@ -0,0 +1,7 @@
+<div style="padding: 20px; width: 200px; height: 800px;">
+ <div style="float: left; width: 10px; height: 100px;"></div>
+ <div>
+ <div style="float: left; width: 20px; height: 60px"></div>
+ </div>
+ <div style="padding-left: 1px; margin-left: 60px">foobar</div>
+</div>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes