[LayoutReloaded] Set inline-block box position.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Apr 2018 14:32:46 +0000 (14:32 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Apr 2018 14:32:46 +0000 (14:32 +0000)
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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230707 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js
Tools/LayoutReloaded/Utils.js
Tools/LayoutReloaded/test/inline-block-with-fixed-width-height.html

index f395606..5fd2753 100644 (file)
@@ -1,3 +1,16 @@
+2018-04-17  Zalan Bujtas  <zalan@apple.com>
+
+        [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  <cgarcia@igalia.com>
 
         [GLIB] Add API to clear JSCContext uncaught exception
index d32583c..c421cb8 100644 (file)
@@ -118,6 +118,7 @@ class InlineFormattingContext extends FormattingContext {
         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);
     }
 
index a738670..b491924 100644 (file)
@@ -584,16 +584,11 @@ class Utils {
             }
             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) {
index b00001c..b060219 100644 (file)
@@ -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>