Title: [230707] trunk/Tools
Revision
230707
Author
[email protected]
Date
2018-04-17 07:32:46 -0700 (Tue, 17 Apr 2018)

Log Message

[LayoutReloaded] Set inline-block box position.
https://bugs.webkit.org/show_bug.cgi?id=184690

Reviewed by Antti Koivisto.

* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext.prototype._handleInlineBlock):
* LayoutReloaded/Utils.js:
(Utils._dumpBox):
* LayoutReloaded/test/inline-block-with-fixed-width-height.html:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (230706 => 230707)


--- trunk/Tools/ChangeLog	2018-04-17 11:29:26 UTC (rev 230706)
+++ trunk/Tools/ChangeLog	2018-04-17 14:32:46 UTC (rev 230707)
@@ -1,3 +1,16 @@
+2018-04-17  Zalan Bujtas  <[email protected]>
+
+        [LayoutReloaded] Set inline-block box position.
+        https://bugs.webkit.org/show_bug.cgi?id=184690
+
+        Reviewed by Antti Koivisto.
+
+        * LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
+        (InlineFormattingContext.prototype._handleInlineBlock):
+        * LayoutReloaded/Utils.js:
+        (Utils._dumpBox):
+        * LayoutReloaded/test/inline-block-with-fixed-width-height.html:
+
 2018-04-17  Carlos Garcia Campos  <[email protected]>
 
         [GLIB] Add API to clear JSCContext uncaught exception

Modified: trunk/Tools/LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js (230706 => 230707)


--- trunk/Tools/LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js	2018-04-17 11:29:26 UTC (rev 230706)
+++ trunk/Tools/LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js	2018-04-17 14:32:46 UTC (rev 230707)
@@ -118,6 +118,7 @@
         this.layoutState().formattingContext(inlineBlockBox).layout();
         displayBox.setHeight(Utils.height(inlineBlockBox) + Utils.computedVerticalBorderAndPadding(inlineBlockBox.node()));
         this._line().addInlineBox(displayBox.size());
+        displayBox.setTopLeft(this._line().lastLineBox().lineBoxRect.topLeft());
         this._adjustLineForInlineContainerEnd(inlineBlockBox);
     }
 

Modified: trunk/Tools/LayoutReloaded/Utils.js (230706 => 230707)


--- trunk/Tools/LayoutReloaded/Utils.js	2018-04-17 11:29:26 UTC (rev 230706)
+++ trunk/Tools/LayoutReloaded/Utils.js	2018-04-17 14:32:46 UTC (rev 230707)
@@ -584,16 +584,11 @@
             }
             return indentation + box.node().tagName + " " + box.name() + "\n";
         }
-        if (box.name() == "RenderImage") {
-            let boxRect = layoutState.displayBox(box).rect();
-            return indentation + box.node().tagName + " " + box.name() + " at (" + Utils.precisionRound(boxRect.left()) + "," + Utils.precisionRound(boxRect.top()) + ") size " + Utils.precisionRound(boxRect.width()) + "x" + Utils.precisionRound(boxRect.height()) + "\n";
-
-        }
         if (box.isAnonymous())
             return "";
         let displayBox = layoutState.displayBox(box);
         let boxRect = displayBox.rect();
-        return indentation + (box.node().tagName ? (box.node().tagName + " ") : "")  + box.name() + " at (" + boxRect.left() + "," + boxRect.top() + ") size " + boxRect.width() + "x" + boxRect.height() + "\n";
+        return indentation + (box.node().tagName ? (box.node().tagName + " ") : "")  + box.name() + " at (" + Utils.precisionRound(boxRect.left()) + "," + Utils.precisionRound(boxRect.top()) + ") size " + Utils.precisionRound(boxRect.width()) + "x" + Utils.precisionRound(boxRect.height()) + "\n";
     }
 
     static _dumpLines(layoutState, root, level) {

Modified: trunk/Tools/LayoutReloaded/test/inline-block-with-fixed-width-height.html (230706 => 230707)


--- trunk/Tools/LayoutReloaded/test/inline-block-with-fixed-width-height.html	2018-04-17 11:29:26 UTC (rev 230706)
+++ trunk/Tools/LayoutReloaded/test/inline-block-with-fixed-width-height.html	2018-04-17 14:32:46 UTC (rev 230707)
@@ -1,6 +1,6 @@
 <!DOCTYPE html>
 <html>
 <body>
-<div style="height: 500px"><span style="display: inline-block; width: 200px; height: 100px;">foobar</span></div>
+<div style="height: 500px">foo<span style="margin-left: 30px; display: inline-block; width: 200px; height: 100px;">foobar</span>foobar</div>
 </body>
 </html>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to