When a block element is made inline positioned and has static left and right, it...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Feb 2013 20:10:31 +0000 (20:10 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Feb 2013 20:10:31 +0000 (20:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=91665

Patch by Pravin D <pravind.2k4@gmail.com> on 2013-02-06
Reviewed by Julien Chaffraix.

Source/WebCore:

Out-of-flow-positioned elements have their display overriden to BLOCK. When a static block elements
changes to inline out-of-flow-positioned or vice-versa, the element current and previous display properties
are same. This causes the element to follow a wrong flow context(in this case Block context) and the element
is laid out incorrectly. The patch fixes the issue by reattaching the renderers of the node whenever either
position property changes or when its floating property changes.
Also the cases when an out-of-flow-positioned/floating element changes to static/non-floating element where
being specially handled. As reattaching the renderers in the above cases correctly handles the above cases,
special handling for such cases is no more required and the related code can be safely removed.

Reattaching renderers for the afore mentioned issues takes a different(longer) code path. Performance measurements
summary for the same is as follows:
                                                      % increase in time
 Absolute-block-to-static-block                            2.00
 Absolute-inline-to-static-block                           1.21
 Absolute-inline-to-static-inline                          1.18
 Static-block-to-absolute-block                            1.13
 Static-inline-to-absolute-inline                          1.35
 Floating-block-non-floating-block                         0.85
 Floating-inline-non-floating-block                        0.66
 Floating-inline-non-floating-inline                       0.57
 Non-floating-block-floating-block                         0.12
 Non-floating-inline-floating-inline                       1.36

Tests: fast/dynamic/absolute-positioned-to-static-positioned.html
       fast/dynamic/floating-to-non-floating.html
       fast/dynamic/non-floating-to-floating.html
       fast/dynamic/static-positioned-to-absolute-positioned.html

* dom/Node.cpp:
(WebCore::Node::diff):
  Return detach in the following conditions:
     1) Element changes to out-of-flow-positioned or vice-versa.
     2) Element becomes floating or vice-versa.

* rendering/RenderBlock.cpp:
(WebCore):
* rendering/RenderBlock.h:
(RenderBlock):
* rendering/RenderBoxModelObject.h:
(RenderBoxModelObject):
* rendering/RenderInline.cpp:
(WebCore):
* rendering/RenderInline.h:
(RenderInline):
* rendering/RenderObject.cpp:
(WebCore):
(WebCore::RenderObject::styleWillChange):
(WebCore::RenderObject::styleDidChange):
* rendering/RenderObject.h:
(RenderObject):
  The fix in Node::diff() obsoletes some code. The above deletion are part of this dead code cleanup.

LayoutTests:

* fast/dynamic/absolute-positioned-to-static-positioned-expected.txt: Added.
* fast/dynamic/absolute-positioned-to-static-positioned.html: Added.
* fast/dynamic/floating-to-non-floating-expected.txt: Added.
* fast/dynamic/floating-to-non-floating.html: Added.
* fast/dynamic/non-floating-to-floating-expected.txt: Added.
* fast/dynamic/non-floating-to-floating.html: Added.
* fast/dynamic/static-positioned-to-absolute-positioned-expected.txt: Added.
* fast/dynamic/static-positioned-to-absolute-positioned.html: Added.
   Testcases for the patch.

* fast/dynamic/resources/helper-bug91665.js: Added.
* fast/dynamic/resources/style-bug91665.css: Added.
   Common javascript functions and css classes used by the above testcases.

* fast/css/first-letter-removed-added-expected.txt:
   Previously failing sub-test is passing.

* fullscreen/full-screen-fixed-pos-parent-expected.txt:
   Change orthogonal to the current patch.

* platform/mac/fast/dynamic/002-expected.txt:
* platform/chromium-win/fast/dynamic/002-expected.txt:
* platform/chromium/fast/dynamic/002-expected.txt:
   Expected change. The testcase has a static block element followed by a text node wrapped
   in an anonymous block. When the block element becomes floating, it is out of the flow context.
   Thus the text node must no longer be wrapped by the anonymous block.

* platform/chromium-mac/fast/repaint/absolute-position-change-containing-block-expected.png:
* platform/chromium-mac/fast/repaint/fixed-to-relative-position-with-absolute-child-expected.png:
   Progression. Previously we used to repaint the a much larger area as compared to the behavior
   with the patch, which repaints only the area affected due to the change in style(position)
   of certain elements.

* platform/chromium/fast/repaint/absolute-position-change-containing-block-expected.png: Added.
* platform/chromium/fast/repaint/fixed-to-relative-position-with-absolute-child-expected.png: Added.
* platform/mac/fast/repaint/absolute-position-change-containing-block-expected.png: Added.
* platform/mac/fast/repaint/fixed-to-relative-position-with-absolute-child-expected.png: Added.
   Added platform specific images.

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

31 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/first-letter-removed-added-expected.txt
LayoutTests/fast/dynamic/absolute-positioned-to-static-positioned-expected.txt [new file with mode: 0644]
LayoutTests/fast/dynamic/absolute-positioned-to-static-positioned.html [new file with mode: 0644]
LayoutTests/fast/dynamic/floating-to-non-floating-expected.txt [new file with mode: 0644]
LayoutTests/fast/dynamic/floating-to-non-floating.html [new file with mode: 0644]
LayoutTests/fast/dynamic/non-floating-to-floating-expected.txt [new file with mode: 0644]
LayoutTests/fast/dynamic/non-floating-to-floating.html [new file with mode: 0644]
LayoutTests/fast/dynamic/resources/helper-bug91665.js [new file with mode: 0644]
LayoutTests/fast/dynamic/resources/style-bug91665.css [new file with mode: 0644]
LayoutTests/fast/dynamic/static-positioned-to-absolute-positioned-expected.txt [new file with mode: 0644]
LayoutTests/fast/dynamic/static-positioned-to-absolute-positioned.html [new file with mode: 0644]
LayoutTests/fullscreen/full-screen-fixed-pos-parent-expected.txt
LayoutTests/platform/chromium-mac/fast/repaint/absolute-position-change-containing-block-expected.png
LayoutTests/platform/chromium-mac/fast/repaint/fixed-to-relative-position-with-absolute-child-expected.png
LayoutTests/platform/chromium-win/fast/dynamic/002-expected.txt
LayoutTests/platform/chromium/fast/dynamic/002-expected.txt
LayoutTests/platform/chromium/fast/repaint/absolute-position-change-containing-block-expected.png [new file with mode: 0644]
LayoutTests/platform/chromium/fast/repaint/fixed-to-relative-position-with-absolute-child-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/dynamic/002-expected.txt
LayoutTests/platform/mac/fast/repaint/absolute-position-change-containing-block-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/fixed-to-relative-position-with-absolute-child-expected.png [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Node.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlock.h
Source/WebCore/rendering/RenderBoxModelObject.h
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderInline.h
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h

index 3b10c79cad1bd67e7a9076f9ae9b35e5896df9e3..7bd3135852842f0239ebb6ba9d5f7675a40f2397 100644 (file)
@@ -1,3 +1,49 @@
+2013-02-06  Pravin D  <pravind.2k4@gmail.com>
+
+        When a block element is made inline positioned and has static left and right,  it does not follow inline formatting context
+        https://bugs.webkit.org/show_bug.cgi?id=91665
+
+        Reviewed by Julien Chaffraix.
+
+        * fast/dynamic/absolute-positioned-to-static-positioned-expected.txt: Added.
+        * fast/dynamic/absolute-positioned-to-static-positioned.html: Added.
+        * fast/dynamic/floating-to-non-floating-expected.txt: Added.
+        * fast/dynamic/floating-to-non-floating.html: Added.
+        * fast/dynamic/non-floating-to-floating-expected.txt: Added.
+        * fast/dynamic/non-floating-to-floating.html: Added.
+        * fast/dynamic/static-positioned-to-absolute-positioned-expected.txt: Added.
+        * fast/dynamic/static-positioned-to-absolute-positioned.html: Added.
+           Testcases for the patch.
+
+        * fast/dynamic/resources/helper-bug91665.js: Added.
+        * fast/dynamic/resources/style-bug91665.css: Added.
+           Common javascript functions and css classes used by the above testcases.
+
+        * fast/css/first-letter-removed-added-expected.txt:
+           Previously failing sub-test is passing.
+
+        * fullscreen/full-screen-fixed-pos-parent-expected.txt:
+           Change orthogonal to the current patch.
+
+        * platform/mac/fast/dynamic/002-expected.txt:
+        * platform/chromium-win/fast/dynamic/002-expected.txt:
+        * platform/chromium/fast/dynamic/002-expected.txt:
+           Expected change. The testcase has a static block element followed by a text node wrapped 
+           in an anonymous block. When the block element becomes floating, it is out of the flow context.
+           Thus the text node must no longer be wrapped by the anonymous block.
+
+        * platform/chromium-mac/fast/repaint/absolute-position-change-containing-block-expected.png:
+        * platform/chromium-mac/fast/repaint/fixed-to-relative-position-with-absolute-child-expected.png:
+           Progression. Previously we used to repaint the a much larger area as compared to the behavior 
+           with the patch, which repaints only the area affected due to the change in style(position) 
+           of certain elements.
+
+        * platform/chromium/fast/repaint/absolute-position-change-containing-block-expected.png: Added.
+        * platform/chromium/fast/repaint/fixed-to-relative-position-with-absolute-child-expected.png: Added.
+        * platform/mac/fast/repaint/absolute-position-change-containing-block-expected.png: Added.
+        * platform/mac/fast/repaint/fixed-to-relative-position-with-absolute-child-expected.png: Added.
+           Added platform specific images.
+
 2013-02-06  Chris Fleizach  <cfleizach@apple.com>
 
         AX: if <html> has an ARIA attribute, it's exposed as an AXGroup
index 1f84e32baa31d2ffd4a874fccf9a68b28165a8db..62ca062a4df40d0d0e5d81477e68aa7a2adb1211 100644 (file)
@@ -34,7 +34,7 @@ PASS document.getElementById('test3').offsetWidth == document.getElementById('re
 FAIL document.getElementById('test4').offsetWidth == document.getElementById('ref4').offsetWidth should be true. Was false.
 PASS document.getElementById('test5').offsetWidth == document.getElementById('ref5').offsetWidth is true
 PASS document.getElementById('test6').offsetWidth == document.getElementById('ref6').offsetWidth is true
-FAIL document.getElementById('test7').offsetWidth == document.getElementById('ref7').offsetWidth should be true. Was false.
+PASS document.getElementById('test7').offsetWidth == document.getElementById('ref7').offsetWidth is true
 PASS document.getElementById('test8').offsetWidth == document.getElementById('ref8').offsetWidth is true
 PASS successfullyParsed is true
 
diff --git a/LayoutTests/fast/dynamic/absolute-positioned-to-static-positioned-expected.txt b/LayoutTests/fast/dynamic/absolute-positioned-to-static-positioned-expected.txt
new file mode 100644 (file)
index 0000000..49272bb
--- /dev/null
@@ -0,0 +1,82 @@
+Testcase for Bug #91665.
+This testcase checks if an element is properly placed with respect to its previous sibling when its position changes from absolute to static for various combinations of display property toggeled between inline-block and block for both testElement and its previous sibling.
+
+Case 1: <Block Element><Positioned Block Element> To <Block Element><Block Element>
+
+PASS
+Case 2: <Block Element><Positioned Block Element> To <Block Element><Inline Element>
+
+PASS
+Case 3: <Block Element><Positioned Block Element> To <Inline Element><Block Element>
+
+PASS
+Case 4: <Block Element><Positioned Block Element> To <Inline Element><Inline Element>
+
+PASS
+Case 5: <Block Element><Positioned Inline Element> To <Block Element><Block Element>
+
+PASS
+Case 6: <Block Element><Positioned Block Element> To <Inline Element><Block Element>
+
+PASS
+Case 7: <Block Element><Positioned Inline Element> To <Inline Element><Inline Element>
+
+PASS
+Case 8: <Inline Element><Positioned Block Element> To <Block Element><Inline Element>
+
+PASS
+Case 9: <Inline Element><Positioned Block Element> To <Inline Element><Block Element>
+
+PASS
+Case 10: <Inline Element><Positioned Block Element> To <Inline Element><Inline Element>
+
+PASS
+Case 11: <Inline Element><Positioned Block Element> To <Block Element><Inline Element>
+
+PASS
+Case 12: <Inline Element><Positioned Inline Element> To <Inline Element><Block Element>
+
+PASS
+Case 13: <Inline Element><Positioned Inline Element> To <Inline Element><Inline Element>
+
+PASS
+Case 14: <Block Element><Positioned Table Element> To <Block Element><Table Element>
+
+PASS
+Case 15: <Block Element><Positioned Table Element> To <Block Element><Inline-Table Element>
+
+PASS
+Case 16: <Block Element><Positioned Table Element> To <Inline Element><Table Element>
+
+PASS
+Case 17: <Block Element><Positioned Table Element> To <Inline Element><Inline-Table Element>
+
+PASS
+Case 18: <Block Element><Positioned Inline-Table Element> To <Block Element><Inline-Table Element>
+
+PASS
+Case 19: <Block Element><Positioned Inline Element> To <Block Element><Table Element>
+
+PASS
+Case 20: <Block Element><Positioned Inline-Table Element> To <Inline Element><Inline-Table Element>
+
+PASS
+Case 21: <Inline Element><Positioned Table Element> To <Inline Element><Inline-Table Element>
+
+PASS
+Case 22: <Inline Element><Positioned Table Element> To <Inline Element><Table Element>
+
+PASS
+Case 23: <Inline Element><Positioned Block Element> To <Inline Element><Inline-Table Element>
+
+PASS
+Case 24: <Inline Element><Positioned Inline-Table Element> To <Block Element><Inline-Table Element>
+
+PASS
+Case 25: <Inline Element><Positioned Inline-Table Element> To <Inline Element><Table Element>
+
+PASS
+Case 26: <Inline Element><Positioned Inline-Table Element> To <Inline Element><Inline-Table Element>
+
+PASS
+
diff --git a/LayoutTests/fast/dynamic/absolute-positioned-to-static-positioned.html b/LayoutTests/fast/dynamic/absolute-positioned-to-static-positioned.html
new file mode 100644 (file)
index 0000000..4a501a9
--- /dev/null
@@ -0,0 +1,118 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" type="text/css" href="resources/style-bug91665.css">
+<script src="../../resources/check-layout.js"></script>
+<script src="resources/helper-bug91665.js"></script>
+</head>
+<body onload="runTest('.position-static');">
+<h4>Testcase for<a href="https://bugs.webkit.org/show_bug.cgi?id=91665"> Bug #91665.</a><br>This testcase checks
+if an element is properly placed with respect to its previous sibling when its position changes from absolute to static for
+various combinations of display property toggeled between inline-block and block for both testElement and its previous sibling.
+</h4>
+<p><b>Case 1</b>: &lt;Block Element&gt;&lt;Positioned Block Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><div class="testElement" data-offset-y="20"></div>
+</div>
+<p><b>Case 2</b>: &lt;Block Element&gt;&lt;Positioned Block Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><div class="testElement" makeInline=true data-offset-y="20"></div>
+</div>
+<p><b>Case 3</b>: &lt;Block Element&gt;&lt;Positioned Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><div class="testElement" data-offset-y="23"></div>
+</div>
+<p><b>Case 4</b>: &lt;Block Element&gt;&lt;Positioned Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><div class="testElement" makeInline=true data-offset-y="0"></div>
+</div>
+<p><b>Case 5</b>: &lt;Block Element&gt;&lt;Positioned Inline Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><div class="testElement inline" data-offset-y="20"></div>
+</div>
+<p><b>Case 6</b>: &lt;Block Element&gt;&lt;Positioned Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><div class="testElement inline" makeBlock=true data-offset-y="23"></div>
+</div>
+<p><b>Case 7</b>: &lt;Block Element&gt;&lt;Positioned Inline Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><div class="testElement inline" data-offset-y="0"></div>
+</div>
+<p><b>Case 8</b>: &lt;Inline Element&gt;&lt;Positioned Block Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline" makeBlock=true></div><div class="testElement" makeInline=true data-offset-y="20"></div>
+</div>
+<p><b>Case 9</b>: &lt;Inline Element&gt;&lt;Positioned Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><div class="testElement" data-offset-y="23"></div>
+</div>
+<p><b>Case 10</b>: &lt;Inline Element&gt;&lt;Positioned Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><div class="testElement" makeInline=true data-offset-y="0"></div>
+</div>
+<p><b>Case 11</b>: &lt;Inline Element&gt;&lt;Positioned Block Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline" makeBlock=true></div><div class="testElement inline" data-offset-y="20"></div>
+</div>
+<p><b>Case 12</b>: &lt;Inline Element&gt;&lt;Positioned Inline Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><div class="testElement inline" makeBlock=true data-offset-y="23"></div>
+</div>
+<p><b>Case 13</b>: &lt;Inline Element&gt;&lt;Positioned Inline Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><div class="testElement inline" data-offset-y="0"></div>
+</div>
+<p><b>Case 14</b>: &lt;Block Element&gt;&lt;Positioned Table Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><table class="testElement" data-offset-y="20"></table>
+</div>
+<p><b>Case 15</b>: &lt;Block Element&gt;&lt;Positioned Table Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><table class="testElement" makeInline=true data-offset-y="20"></table>
+</div>
+<p><b>Case 16</b>: &lt;Block Element&gt;&lt;Positioned Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><table class="testElement" data-offset-y="23"></table>
+</div>
+<p><b>Case 17</b>: &lt;Block Element&gt;&lt;Positioned Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><table  class="testElement" makeInline=true data-offset-y="0"></table>
+</div>
+<p><b>Case 18</b>: &lt;Block Element&gt;&lt;Positioned Inline-Table Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><table class="testElement inline" data-offset-y="20"></table>
+</div>
+<p><b>Case 19</b>: &lt;Block Element&gt;&lt;Positioned Inline Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><table class="testElement inline" makeBlock=true data-offset-y="23"></table>
+</div>
+<p><b>Case 20</b>: &lt;Block Element&gt;&lt;Positioned Inline-Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><table class="testElement inline" data-offset-y="0"></table>
+</div>
+<p><b>Case 21</b>: &lt;Inline Element&gt;&lt;Positioned Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline" makeBlock=true></div><table class="testElement" makeInline=true data-offset-y="20"></table>
+</div>
+<p><b>Case 22</b>: &lt;Inline Element&gt;&lt;Positioned Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><table class="testElement" data-offset-y="23"></table>
+</div>
+<p><b>Case 23</b>: &lt;Inline Element&gt;&lt;Positioned Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><table class="testElement" makeInline=true data-offset-y="0"></table>
+</div>
+<p><b>Case 24</b>: &lt;Inline Element&gt;&lt;Positioned Inline-Table Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline" makeBlock=true></div><table class="testElement inline" data-offset-y="20"></table>
+</div>
+<p><b>Case 25</b>: &lt;Inline Element&gt;&lt;Positioned Inline-Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><table class="testElement inline" makeBlock=true data-offset-y="23"></table>
+</div>
+<p><b>Case 26</b>: &lt;Inline Element&gt;&lt;Positioned Inline-Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><table class="testElement inline" data-offset-y="0"></table>
+</div>
+</body>
+</html>
diff --git a/LayoutTests/fast/dynamic/floating-to-non-floating-expected.txt b/LayoutTests/fast/dynamic/floating-to-non-floating-expected.txt
new file mode 100644 (file)
index 0000000..fae3cc2
--- /dev/null
@@ -0,0 +1,82 @@
+Testcase for Bug #91665.
+This testcase checks if an element is properly placed with respect to its previous sibling when float:left changes to float:none for various combinations of display property toggeled between inline-block and block for both testElement and its previous sibling.
+
+Case 1: <Block Element><Floating Block Element> To <Block Element><Block Element>
+
+PASS
+Case 2: <Block Element><Floating Block Element> To <Block Element><Inline Element>
+
+PASS
+Case 3: <Block Element><Floating Block Element> To <Inline Element><Block Element>
+
+PASS
+Case 4: <Block Element><Floating Block Element> To <Inline Element><Inline Element>
+
+PASS
+Case 5: <Block Element><Floating Inline Element> To <Block Element><Block Element>
+
+PASS
+Case 6: <Block Element><Floating Block Element> To <Inline Element><Block Element>
+
+PASS
+Case 7: <Block Element><Floating Inline Element> To <Inline Element><Inline Element>
+
+PASS
+Case 8: <Inline Element><Floating Block Element> To <Block Element><Inline Element>
+
+PASS
+Case 9: <Inline Element><Floating Block Element> To <Inline Element><Block Element>
+
+PASS
+Case 10: <Inline Element><Floating Block Element> To <Inline Element><Inline Element>
+
+PASS
+Case 11: <Inline Element><Floating Block Element> To <Block Element><Inline Element>
+
+PASS
+Case 12: <Inline Element><Floating Inline Element> To <Inline Element><Block Element>
+
+PASS
+Case 13: <Inline Element><Floating Inline Element> To <Inline Element><Inline Element>
+
+PASS
+Case 14: <Block Element><Floating Table Element> To <Block Element><Table Element>
+
+PASS
+Case 15: <Block Element><Floating Table Element> To <Block Element><Inline-Table Element>
+
+PASS
+Case 16: <Block Element><Floating Table Element> To <Inline Element><Table Element>
+
+PASS
+Case 17: <Block Element><Floating Table Element> To <Inline Element><Inline-Table Element>
+
+PASS
+Case 18: <Block Element><Floating Inline-Table Element> To <Block Element><Inline-Table Element>
+
+PASS
+Case 19: <Block Element><Floating Inline Element> To <Block Element><Table Element>
+
+PASS
+Case 20: <Block Element><Floating Inline-Table Element> To <Inline Element><Inline-Table Element>
+
+PASS
+Case 21: <Inline Element><Floating Table Element> To <Inline Element><Inline-Table Element>
+
+PASS
+Case 22: <Inline Element><Floating Table Element> To <Inline Element><Table Element>
+
+PASS
+Case 23: <Inline Element><Floating Block Element> To <Inline Element><Inline-Table Element>
+
+PASS
+Case 24: <Inline Element><Floating Inline-Table Element> To <Block Element><Inline-Table Element>
+
+PASS
+Case 25: <Inline Element><Floating Inline-Table Element> To <Inline Element><Table Element>
+
+PASS
+Case 26: <Inline Element><Floating Inline-Table Element> To <Inline Element><Inline-Table Element>
+
+PASS
+
diff --git a/LayoutTests/fast/dynamic/floating-to-non-floating.html b/LayoutTests/fast/dynamic/floating-to-non-floating.html
new file mode 100644 (file)
index 0000000..5971cb0
--- /dev/null
@@ -0,0 +1,118 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" type="text/css" href="resources/style-bug91665.css">
+<script src="../../resources/check-layout.js"></script>
+<script src="resources/helper-bug91665.js"></script>
+</head>
+<body onload="runTest('.non-floating');">
+<h4>Testcase for<a href="https://bugs.webkit.org/show_bug.cgi?id=91665"> Bug #91665.</a><br>This testcase checks
+if an element is properly placed with respect to its previous sibling when float:left changes to float:none for
+various combinations of display property toggeled between inline-block and block for both testElement and its previous sibling.
+</h4>
+<p><b>Case 1</b>: &lt;Block Element&gt;&lt;Floating Block Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><div class="testElement" data-offset-y="20"></div>
+</div>
+<p><b>Case 2</b>: &lt;Block Element&gt;&lt;Floating Block Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><div class="testElement" makeInline=true data-offset-y="20"></div>
+</div>
+<p><b>Case 3</b>: &lt;Block Element&gt;&lt;Floating Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><div class="testElement" data-offset-y="23"></div>
+</div>
+<p><b>Case 4</b>: &lt;Block Element&gt;&lt;Floating Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><div class="testElement" makeInline=true data-offset-y="0"></div>
+</div>
+<p><b>Case 5</b>: &lt;Block Element&gt;&lt;Floating Inline Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><div class="testElement inline" data-offset-y="20"></div>
+</div>
+<p><b>Case 6</b>: &lt;Block Element&gt;&lt;Floating Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><div class="testElement inline" makeBlock=true data-offset-y="23"></div>
+</div>
+<p><b>Case 7</b>: &lt;Block Element&gt;&lt;Floating Inline Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><div class="testElement inline" data-offset-y="0"></div>
+</div>
+<p><b>Case 8</b>: &lt;Inline Element&gt;&lt;Floating Block Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline" makeBlock=true></div><div class="testElement" makeInline=true data-offset-y="20"></div>
+</div>
+<p><b>Case 9</b>: &lt;Inline Element&gt;&lt;Floating Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><div class="testElement" data-offset-y="23"></div>
+</div>
+<p><b>Case 10</b>: &lt;Inline Element&gt;&lt;Floating Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><div class="testElement" makeInline=true data-offset-y="0"></div>
+</div>
+<p><b>Case 11</b>: &lt;Inline Element&gt;&lt;Floating Block Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline" makeBlock=true></div><div class="testElement inline" data-offset-y="20"></div>
+</div>
+<p><b>Case 12</b>: &lt;Inline Element&gt;&lt;Floating Inline Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><div class="testElement inline" makeBlock=true data-offset-y="23"></div>
+</div>
+<p><b>Case 13</b>: &lt;Inline Element&gt;&lt;Floating Inline Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><div class="testElement inline" data-offset-y="0"></div>
+</div>
+<p><b>Case 14</b>: &lt;Block Element&gt;&lt;Floating Table Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><table class="testElement" data-offset-y="20"></table>
+</div>
+<p><b>Case 15</b>: &lt;Block Element&gt;&lt;Floating Table Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><table class="testElement" makeInline=true data-offset-y="20"></table>
+</div>
+<p><b>Case 16</b>: &lt;Block Element&gt;&lt;Floating Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><table class="testElement" data-offset-y="23"></table>
+</div>
+<p><b>Case 17</b>: &lt;Block Element&gt;&lt;Floating Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><table class="testElement" makeInline=true data-offset-y="0"></table>
+</div>
+<p><b>Case 18</b>: &lt;Block Element&gt;&lt;Floating Inline-Table Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><table class="testElement inline" data-offset-y="20"></table>
+</div>
+<p><b>Case 19</b>: &lt;Block Element&gt;&lt;Floating Inline Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><table class="testElement inline" makeBlock=true data-offset-y="23"></table>
+</div>
+<p><b>Case 20</b>: &lt;Block Element&gt;&lt;Floating Inline-Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><table class="testElement inline" data-offset-y="0"></table>
+</div>
+<p><b>Case 21</b>: &lt;Inline Element&gt;&lt;Floating Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline" makeBlock=true></div><table class="testElement" makeInline=true data-offset-y="20"></table>
+</div>
+<p><b>Case 22</b>: &lt;Inline Element&gt;&lt;Floating Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><table class="testElement" data-offset-y="23"></table>
+</div>
+<p><b>Case 23</b>: &lt;Inline Element&gt;&lt;Floating Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><table class="testElement" makeInline=true data-offset-y="0"></table>
+</div>
+<p><b>Case 24</b>: &lt;Inline Element&gt;&lt;Floating Inline-Table Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline" makeBlock=true></div><table class="testElement inline" data-offset-y="20"></table>
+</div>
+<p><b>Case 25</b>: &lt;Inline Element&gt;&lt;Floating Inline-Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><table class="testElement inline" makeBlock=true data-offset-y="23"></table>
+</div>
+<p><b>Case 26</b>: &lt;Inline Element&gt;&lt;Floating Inline-Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><table class="testElement inline" data-offset-y="0"></table>
+</div>
+</body>
+</html>
diff --git a/LayoutTests/fast/dynamic/non-floating-to-floating-expected.txt b/LayoutTests/fast/dynamic/non-floating-to-floating-expected.txt
new file mode 100644 (file)
index 0000000..ea51e9e
--- /dev/null
@@ -0,0 +1,82 @@
+Testcase for Bug #91665. 
+This testcase checks if an element is properly placed with respect to its previous sibling when float:none changes to float:left for various combinations of display property toggeled between inline-block and block for both testElement and its previous sibling.
+
+Case 1: <Block Element><Block Element> To <Block Element><Floating Block Element>
+
+PASS
+Case 2: <Block Element><Block Element> To <Block Element><Floating Inline Element>
+
+PASS
+Case 3: <Block Element><Block Element> To <Inline Element><Floating Block Element>
+
+PASS
+Case 4: <Block Element><Block Element> To <Inline Element><Floating Inline Element>
+
+PASS
+Case 5: <Block Element><Inline Element> To <Block Element><Floating Block Element>
+
+PASS
+Case 6: <Block Element><Block Element> To <Inline Element><Floating Block Element>
+
+PASS
+Case 7: <Block Element><Inline Element> To <Inline Element><Floating Inline Element>
+
+PASS
+Case 8: <Inline Element><Block Element> To <Block Element><Floating Inline Element>
+
+PASS
+Case 9: <Inline Element><Block Element> To <Inline Element><Floating Block Element>
+
+PASS
+Case 10: <Inline Element><Block Element> To <Inline Element><Floating Inline Element>
+
+PASS
+Case 11: <Inline Element><Block Element> To <Block Element><Floating Inline Element>
+
+PASS
+Case 12: <Inline Element><Inline Element> To <Inline Element><Floating Block Element>
+
+PASS
+Case 13: <Inline Element><Inline Element> To <Inline Element><Floating Inline Element>
+
+PASS
+Case 14: <Block Element><Table Element> To <Block Element><Floating Table Element>
+
+PASS
+Case 15: <Block Element><Table Element> To <Block Element><Floating Inline-Table Element>
+
+PASS
+Case 16: <Block Element><Table Element> To <Inline Element><Floating Table Element>
+
+PASS
+Case 17: <Block Element><Table Element> To <Inline Element><Floating Inline-Table Element>
+
+PASS
+Case 18: <Block Element><Inline-Table Element> To <Block Element><Floating Inline-Table Element>
+
+PASS
+Case 19: <Block Element><Inline Element> To <Block Element><Floating Table Element>
+
+PASS
+Case 20: <Block Element><Inline-Table Element> To <Inline Element><Floating Inline-Table Element>
+
+PASS
+Case 21: <Inline Element><Table Element> To <Inline Element><Floating Inline-Table Element>
+
+PASS
+Case 22: <Inline Element><Table Element> To <Inline Element><Floating Table Element>
+
+PASS
+Case 23: <Inline Element><Block Element> To <Inline Element><Floating Inline-Table Element>
+
+PASS
+Case 24: <Inline Element><Inline-Table Element> To <Block Element><Floating Inline-Table Element>
+
+PASS
+Case 25: <Inline Element><Inline-Table Element> To <Inline Element><Floating Table Element>
+
+PASS
+Case 26: <Inline Element><Inline-Table Element> To <Inline Element><Floating Inline-Table Element>
+
+PASS
+
diff --git a/LayoutTests/fast/dynamic/non-floating-to-floating.html b/LayoutTests/fast/dynamic/non-floating-to-floating.html
new file mode 100644 (file)
index 0000000..c14d7bd
--- /dev/null
@@ -0,0 +1,130 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" type="text/css" href="resources/style-bug91665.css">
+<script src="../../resources/check-layout.js"></script>
+<script src="resources/helper-bug91665.js"></script>
+<script>
+function runTest() {
+    var testElems = document.getElementsByClassName('testElement');
+    for(var i = 0; i < testElems.length; i++) {
+        var element = testElems[i];
+        changeDisplayIfNeeded(element);
+        element.className += ' floating';
+        changeDisplayIfNeeded(element.previousSibling);  
+    }
+    checkLayout('.testElement');
+}
+</script>
+</head>
+<body onload="runTest('.floating');">
+<h4>Testcase for<a href="https://bugs.webkit.org/show_bug.cgi?id=91665"> Bug #91665. </a><br>This testcase checks
+if an element is properly placed with respect to its previous sibling when float:none changes to float:left for
+various combinations of display property toggeled between inline-block and block for both testElement and its previous sibling.
+</h4>
+<p><b>Case 1</b>: &lt;Block Element&gt;&lt;Block Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Floating Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><div class="testElement" data-offset-y="20"></div>
+</div>
+<p><b>Case 2</b>: &lt;Block Element&gt;&lt;Block Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Floating Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><div class="testElement" makeInline=true data-offset-y="20"></div>
+</div>
+<p><b>Case 3</b>: &lt;Block Element&gt;&lt;Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Floating Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><div class="testElement" data-offset-y="0"></div>
+</div>
+<p><b>Case 4</b>: &lt;Block Element&gt;&lt;Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Floating Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><div class="testElement" makeInline=true data-offset-y="0"></div>
+</div>
+<p><b>Case 5</b>: &lt;Block Element&gt;&lt;Inline Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Floating Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><div class="testElement inline" data-offset-y="20"></div>
+</div>
+<p><b>Case 6</b>: &lt;Block Element&gt;&lt;Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Floating Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><div class="testElement inline" makeBlock=true data-offset-y="0"></div>
+</div>
+<p><b>Case 7</b>: &lt;Block Element&gt;&lt;Inline Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Floating Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><div class="testElement inline" data-offset-y="0"></div>
+</div>
+<p><b>Case 8</b>: &lt;Inline Element&gt;&lt;Block Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Floating Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline" makeBlock=true></div><div class="testElement" makeInline=true data-offset-y="20"></div>
+</div>
+<p><b>Case 9</b>: &lt;Inline Element&gt;&lt;Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Floating Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><div class="testElement" data-offset-y="0"></div>
+</div>
+<p><b>Case 10</b>: &lt;Inline Element&gt;&lt;Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Floating Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><div class="testElement" makeInline=true data-offset-y="0"></div>
+</div>
+<p><b>Case 11</b>: &lt;Inline Element&gt;&lt;Block Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Floating Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline" makeBlock=true></div><div class="testElement inline" data-offset-y="20"></div>
+</div>
+<p><b>Case 12</b>: &lt;Inline Element&gt;&lt;Inline Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Floating Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><div class="testElement inline" makeBlock=true data-offset-y="0"></div>
+</div>
+<p><b>Case 13</b>: &lt;Inline Element&gt;&lt;Inline Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Floating Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><div class="testElement inline" data-offset-y="0"></div>
+</div>
+<p><b>Case 14</b>: &lt;Block Element&gt;&lt;Table Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Floating Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><table class="testElement" data-offset-y="20"></table>
+</div>
+<p><b>Case 15</b>: &lt;Block Element&gt;&lt;Table Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Floating Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><table class="testElement" makeInline=true data-offset-y="20"></table>
+</div>
+<p><b>Case 16</b>: &lt;Block Element&gt;&lt;Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Floating Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><table class="testElement" data-offset-y="0"></table>
+</div>
+<p><b>Case 17</b>: &lt;Block Element&gt;&lt;Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Floating Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><table class="testElement" makeInline=true data-offset-y="0"></table>
+</div>
+<p><b>Case 18</b>: &lt;Block Element&gt;&lt;Inline-Table Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Floating Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><table class="testElement inline" data-offset-y="20"></table>
+</div>
+<p><b>Case 19</b>: &lt;Block Element&gt;&lt;Inline Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Floating Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><table class="testElement inline" makeBlock=true data-offset-y="0"></table>
+</div>
+<p><b>Case 20</b>: &lt;Block Element&gt;&lt;Inline-Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Floating Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><table class="testElement inline" data-offset-y="0"></table>
+</div>
+<p><b>Case 21</b>: &lt;Inline Element&gt;&lt;Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Floating Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline" makeBlock=true></div><table class="testElement" makeInline=true data-offset-y="20"></table>
+</div>
+<p><b>Case 22</b>: &lt;Inline Element&gt;&lt;Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Floating Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><table class="testElement" data-offset-y="0"></table>
+</div>
+<p><b>Case 23</b>: &lt;Inline Element&gt;&lt;Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Floating Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><table class="testElement" makeInline=true data-offset-y="0"></table>
+</div>
+<p><b>Case 24</b>: &lt;Inline Element&gt;&lt;Inline-Table Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Floating Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline" makeBlock=true></div><table class="testElement inline" data-offset-y="20"></table>
+</div>
+<p><b>Case 25</b>: &lt;Inline Element&gt;&lt;Inline-Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Floating Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><table class="testElement inline" makeBlock=true data-offset-y="0"></table>
+</div>
+<p><b>Case 26</b>: &lt;Inline Element&gt;&lt;Inline-Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Floating Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><table class="testElement inline" data-offset-y="0"></table>
+</div>
+</body>
+</html>
diff --git a/LayoutTests/fast/dynamic/resources/helper-bug91665.js b/LayoutTests/fast/dynamic/resources/helper-bug91665.js
new file mode 100644 (file)
index 0000000..c582ac8
--- /dev/null
@@ -0,0 +1,30 @@
+function changeDisplayIfNeeded(element) {
+    if(element.getAttribute) {
+        var additionalClasses = '';
+        if(element.getAttribute('makeInline')) {
+            if (element.tagName == 'TABLE') 
+                additionalClasses += ' inline-table';
+            else
+                additionalClasses += ' inline';
+        }
+        else if (element.getAttribute('makeBlock')) {
+            if (element.tagName == 'TABLE') 
+                additionalClasses += ' table';
+            else
+                additionalClasses += ' block';
+        }
+        element.className += additionalClasses;
+    }
+
+}
+
+function runTest(additionalClass) {
+    var testElems = document.getElementsByClassName('testElement');
+    for(var i = 0; i < testElems.length; i++) {
+        var element = testElems[i];
+        changeDisplayIfNeeded(element);
+        element.className += ' ' + additionalClass.substring(1);
+        changeDisplayIfNeeded(element.previousSibling);  
+    }
+    checkLayout('.testElement');
+}
diff --git a/LayoutTests/fast/dynamic/resources/style-bug91665.css b/LayoutTests/fast/dynamic/resources/style-bug91665.css
new file mode 100644 (file)
index 0000000..9c372b8
--- /dev/null
@@ -0,0 +1,38 @@
+.box {
+  width:50px;
+  height:20px;
+  background:blue;
+}
+.wrapper {
+  position:relative;
+  line-height:1;
+}
+.testElement {
+  width:50px;
+  height:20px;
+  background:yellow;
+}
+.inline {
+  display:inline-block;
+}
+.block {
+  display:block;
+}
+.inline-table {
+  display:inline-table;
+}
+.table {
+  display:table;
+}
+.position-absolute {
+  position:absolute;
+}
+.position-static {
+  position:static;
+}
+.non-floating {
+  float:none;
+}
+.floating {
+  float:left;
+}
diff --git a/LayoutTests/fast/dynamic/static-positioned-to-absolute-positioned-expected.txt b/LayoutTests/fast/dynamic/static-positioned-to-absolute-positioned-expected.txt
new file mode 100644 (file)
index 0000000..70cad59
--- /dev/null
@@ -0,0 +1,82 @@
+Testcase for Bug #91665.
+This testcase checks if an element is properly placed with respect to its previous sibling when its position changes from static to absolute for various combinations of display property, toggeled between inline-block and block for both testElement and its previous sibling.
+
+Case 1: <Block Element><Block Element> To <Block Element><Positioned Block Element>
+
+PASS
+Case 2: <Block Element><Block Element> To <Block Element><Positioned Inline Element>
+
+PASS
+Case 3: <Block Element><Block Element> To <Inline Element><Positioned Block Element>
+
+PASS
+Case 4: <Block Element><Block Element> To <Inline Element><Positioned Inline Element>
+
+PASS
+Case 5: <Block Element><Inline Element> To <Block Element><Positioned Block Element>
+
+PASS
+Case 6: <Block Element><Block Element> To <Inline Element><Positioned Block Element>
+
+PASS
+Case 7: <Block Element><Inline Element> To <Inline Element><Positioned Inline Element>
+
+PASS
+Case 8: <Inline Element><Block Element> To <Block Element><Positioned Inline Element>
+
+PASS
+Case 9: <Inline Element><Block Element> To <Inline Element><Positioned Block Element>
+
+PASS
+Case 10: <Inline Element><Block Element> To <Inline Element><Positioned Inline Element>
+
+PASS
+Case 11: <Inline Element><Block Element> To <Block Element><Positioned Inline Element>
+
+PASS
+Case 12: <Inline Element><Inline Element> To <Inline Element><Positioned Block Element>
+
+PASS
+Case 13: <Inline Element><Inline Element> To <Inline Element><Positioned Inline Element>
+
+PASS
+Case 14: <Block Element><Table Element> To <Block Element><Positioned Table Element>
+
+PASS
+Case 15: <Block Element><Table Element> To <Block Element><Positioned Inline-Table Element>
+
+PASS
+Case 16: <Block Element><Table Element> To <Inline Element><Positioned Table Element>
+
+PASS
+Case 17: <Block Element><Table Element> To <Inline Element><Positioned Inline-Table Element>
+
+PASS
+Case 18: <Block Element><Inline-Table Element> To <Block Element><Positioned Inline-Table Element>
+
+PASS
+Case 19: <Block Element><Inline Element> To <Block Element><Positioned Table Element>
+
+PASS
+Case 20: <Block Element><Inline-Table Element> To <Inline Element><Positioned Inline-Table Element>
+
+PASS
+Case 21: <Inline Element><Table Element> To <Inline Element><Positioned Inline-Table Element>
+
+PASS
+Case 22: <Inline Element><Table Element> To <Inline Element><Positioned Table Element>
+
+PASS
+Case 23: <Inline Element><Block Element> To <Inline Element><Positioned Inline-Table Element>
+
+PASS
+Case 24: <Inline Element><Inline-Table Element> To <Block Element><Positioned Inline-Table Element>
+
+PASS
+Case 25: <Inline Element><Inline-Table Element> To <Inline Element><Positioned Table Element>
+
+PASS
+Case 26: <Inline Element><Inline-Table Element> To <Inline Element><Positioned Inline-Table Element>
+
+PASS
+
diff --git a/LayoutTests/fast/dynamic/static-positioned-to-absolute-positioned.html b/LayoutTests/fast/dynamic/static-positioned-to-absolute-positioned.html
new file mode 100644 (file)
index 0000000..1e5bc87
--- /dev/null
@@ -0,0 +1,118 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" type="text/css" href="resources/style-bug91665.css">
+<script src="../../resources/check-layout.js"></script>
+<script src="resources/helper-bug91665.js"></script>
+</head>
+<body onload="runTest('.position-absolute');">
+<h4>Testcase for<a href="https://bugs.webkit.org/show_bug.cgi?id=91665"> Bug #91665.</a><br>This testcase checks
+if an element is properly placed with respect to its previous sibling when its position changes from static to absolute for
+various combinations of display property, toggeled between inline-block and block for both testElement and its previous sibling.
+</h4>
+<p><b>Case 1</b>: &lt;Block Element&gt;&lt;Block Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Positioned Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><div class="testElement" data-offset-y="20"></div>
+</div>
+<p><b>Case 2</b>: &lt;Block Element&gt;&lt;Block Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Positioned Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><div class="testElement" makeInline=true data-offset-y="20"></div>
+</div>
+<p><b>Case 3</b>: &lt;Block Element&gt;&lt;Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Positioned Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><div class="testElement" data-offset-y="23"></div>
+</div>
+<p><b>Case 4</b>: &lt;Block Element&gt;&lt;Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Positioned Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><div class="testElement" makeInline=true data-offset-y="0"></div>
+</div>
+<p><b>Case 5</b>: &lt;Block Element&gt;&lt;Inline Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Positioned Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><div class="testElement inline" data-offset-y="20"></div>
+</div>
+<p><b>Case 6</b>: &lt;Block Element&gt;&lt;Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Positioned Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><div class="testElement inline" makeBlock=true data-offset-y="23"></div>
+</div>
+<p><b>Case 7</b>: &lt;Block Element&gt;&lt;Inline Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Positioned Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><div class="testElement inline" data-offset-y="0"></div>
+</div>
+<p><b>Case 8</b>: &lt;Inline Element&gt;&lt;Block Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Positioned Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline" makeBlock=true></div><div class="testElement" makeInline=true data-offset-y="20"></div>
+</div>
+<p><b>Case 9</b>: &lt;Inline Element&gt;&lt;Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Positioned Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><div class="testElement" data-offset-y="23"></div>
+</div>
+<p><b>Case 10</b>: &lt;Inline Element&gt;&lt;Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Positioned Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><div class="testElement" makeInline=true data-offset-y="0"></div>
+</div>
+<p><b>Case 11</b>: &lt;Inline Element&gt;&lt;Block Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Positioned Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline" makeBlock=true></div><div class="testElement inline" data-offset-y="20"></div>
+</div>
+<p><b>Case 12</b>: &lt;Inline Element&gt;&lt;Inline Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Positioned Block Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><div class="testElement inline" makeBlock=true data-offset-y="23"></div>
+</div>
+<p><b>Case 13</b>: &lt;Inline Element&gt;&lt;Inline Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Positioned Inline Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><div class="testElement inline" data-offset-y="0"></div>
+</div>
+<p><b>Case 14</b>: &lt;Block Element&gt;&lt;Table Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Positioned Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><table class="testElement" data-offset-y="20"></table>
+</div>
+<p><b>Case 15</b>: &lt;Block Element&gt;&lt;Table Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Positioned Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><table class="testElement" makeInline=true data-offset-y="20"></table>
+</div>
+<p><b>Case 16</b>: &lt;Block Element&gt;&lt;Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Positioned Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><table class="testElement" data-offset-y="23"></table>
+</div>
+<p><b>Case 17</b>: &lt;Block Element&gt;&lt;Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Positioned Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><table class="testElement" makeInline=true data-offset-y="0"></table>
+</div>
+<p><b>Case 18</b>: &lt;Block Element&gt;&lt;Inline-Table Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Positioned Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box"></div><table class="testElement inline" data-offset-y="20"></table>
+</div>
+<p><b>Case 19</b>: &lt;Block Element&gt;&lt;Inline Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Positioned Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><table class="testElement inline" makeBlock=true data-offset-y="23"></table>
+</div>
+<p><b>Case 20</b>: &lt;Block Element&gt;&lt;Inline-Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Positioned Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box" makeInline=true></div><table class="testElement inline" data-offset-y="0"></table>
+</div>
+<p><b>Case 21</b>: &lt;Inline Element&gt;&lt;Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Positioned Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline" makeBlock=true></div><table class="testElement" makeInline=true data-offset-y="20"></table>
+</div>
+<p><b>Case 22</b>: &lt;Inline Element&gt;&lt;Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Positioned Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><table class="testElement" data-offset-y="23"></table>
+</div>
+<p><b>Case 23</b>: &lt;Inline Element&gt;&lt;Block Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Positioned Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><table class="testElement" makeInline=true data-offset-y="0"></table>
+</div>
+<p><b>Case 24</b>: &lt;Inline Element&gt;&lt;Inline-Table Element&gt; <b>To </b> &lt;Block Element&gt;&lt;Positioned Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline" makeBlock=true></div><table class="testElement inline" data-offset-y="20"></table>
+</div>
+<p><b>Case 25</b>: &lt;Inline Element&gt;&lt;Inline-Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Positioned Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><table class="testElement inline" makeBlock=true data-offset-y="23"></table>
+</div>
+<p><b>Case 26</b>: &lt;Inline Element&gt;&lt;Inline-Table Element&gt; <b>To </b> &lt;Inline Element&gt;&lt;Positioned Inline-Table Element&gt;</p>
+<div class="wrapper">
+  <div class="box inline"></div><table class="testElement inline" data-offset-y="0"></table>
+</div>
+</body>
+</html>
index 33a6f234f853b2731f0d31dab7d5732fa4e36e0c..b2c9fb83fcd57d66b8a43e439e41ce29407d9419 100644 (file)
Binary files a/LayoutTests/platform/chromium-mac/fast/repaint/absolute-position-change-containing-block-expected.png and b/LayoutTests/platform/chromium-mac/fast/repaint/absolute-position-change-containing-block-expected.png differ
index 080171cc8ade7f11d5c4b34d4b56f6b81b928962..7f0fa760cdaf874e6b529d1bfad5f2a052e7542a 100644 (file)
Binary files a/LayoutTests/platform/chromium-mac/fast/repaint/fixed-to-relative-position-with-absolute-child-expected.png and b/LayoutTests/platform/chromium-mac/fast/repaint/fixed-to-relative-position-with-absolute-child-expected.png differ
index 1908a34ebff2c385a3e4afc47eaec5da76d2ea8b..6146ec5db9a5555b8b4f6685fe2509031d59d831 100644 (file)
@@ -7,10 +7,9 @@ layer at (0,0) size 800x600
         RenderBlock (floating) {DIV} at (536,0) size 248x104 [border: (2px solid #FF0000)]
           RenderText {#text} at (2,2) size 244x19
             text run at (2,2) width 244: "I should become a right-floating element."
-        RenderBlock (anonymous) at (0,0) size 784x20
-          RenderText {#text} at (0,0) size 371x19
-            text run at (0,0) width 184: "This text should be on the left. "
-            text run at (184,0) width 187: "The float should be to the right."
+        RenderText {#text} at (0,0) size 371x19
+          text run at (0,0) width 184: "This text should be on the left. "
+          text run at (184,0) width 187: "The float should be to the right."
       RenderBlock {DIV} at (0,20) size 784x30
       RenderBlock {DIV} at (0,50) size 784x40
         RenderBlock (floating) {SPAN} at (0,0) size 240x104 [border: (2px solid #FF0000)]
index 75ed716121e127a2a7d8d77da10f35e6b91df253..c156a603d8eb5d29ef586a5307bde1727a5eb81a 100644 (file)
@@ -7,10 +7,9 @@ layer at (0,0) size 800x600
         RenderBlock (floating) {DIV} at (522,0) size 262x104 [border: (2px solid #FF0000)]
           RenderText {#text} at (2,2) size 258x18
             text run at (2,2) width 258: "I should become a right-floating element."
-        RenderBlock (anonymous) at (0,0) size 784x18
-          RenderText {#text} at (0,0) size 393x18
-            text run at (0,0) width 195: "This text should be on the left. "
-            text run at (195,0) width 198: "The float should be to the right."
+        RenderText {#text} at (0,0) size 393x18
+          text run at (0,0) width 195: "This text should be on the left. "
+          text run at (195,0) width 198: "The float should be to the right."
       RenderBlock {DIV} at (0,18) size 784x30
       RenderBlock {DIV} at (0,48) size 784x36
         RenderBlock (floating) {SPAN} at (0,0) size 253x104 [border: (2px solid #FF0000)]
diff --git a/LayoutTests/platform/chromium/fast/repaint/absolute-position-change-containing-block-expected.png b/LayoutTests/platform/chromium/fast/repaint/absolute-position-change-containing-block-expected.png
new file mode 100644 (file)
index 0000000..f5bef7d
Binary files /dev/null and b/LayoutTests/platform/chromium/fast/repaint/absolute-position-change-containing-block-expected.png differ
diff --git a/LayoutTests/platform/chromium/fast/repaint/fixed-to-relative-position-with-absolute-child-expected.png b/LayoutTests/platform/chromium/fast/repaint/fixed-to-relative-position-with-absolute-child-expected.png
new file mode 100644 (file)
index 0000000..9153d47
Binary files /dev/null and b/LayoutTests/platform/chromium/fast/repaint/fixed-to-relative-position-with-absolute-child-expected.png differ
index 75ed716121e127a2a7d8d77da10f35e6b91df253..c156a603d8eb5d29ef586a5307bde1727a5eb81a 100644 (file)
@@ -7,10 +7,9 @@ layer at (0,0) size 800x600
         RenderBlock (floating) {DIV} at (522,0) size 262x104 [border: (2px solid #FF0000)]
           RenderText {#text} at (2,2) size 258x18
             text run at (2,2) width 258: "I should become a right-floating element."
-        RenderBlock (anonymous) at (0,0) size 784x18
-          RenderText {#text} at (0,0) size 393x18
-            text run at (0,0) width 195: "This text should be on the left. "
-            text run at (195,0) width 198: "The float should be to the right."
+        RenderText {#text} at (0,0) size 393x18
+          text run at (0,0) width 195: "This text should be on the left. "
+          text run at (195,0) width 198: "The float should be to the right."
       RenderBlock {DIV} at (0,18) size 784x30
       RenderBlock {DIV} at (0,48) size 784x36
         RenderBlock (floating) {SPAN} at (0,0) size 253x104 [border: (2px solid #FF0000)]
diff --git a/LayoutTests/platform/mac/fast/repaint/absolute-position-change-containing-block-expected.png b/LayoutTests/platform/mac/fast/repaint/absolute-position-change-containing-block-expected.png
new file mode 100644 (file)
index 0000000..d3c8502
Binary files /dev/null and b/LayoutTests/platform/mac/fast/repaint/absolute-position-change-containing-block-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/repaint/fixed-to-relative-position-with-absolute-child-expected.png b/LayoutTests/platform/mac/fast/repaint/fixed-to-relative-position-with-absolute-child-expected.png
new file mode 100644 (file)
index 0000000..466034a
Binary files /dev/null and b/LayoutTests/platform/mac/fast/repaint/fixed-to-relative-position-with-absolute-child-expected.png differ
index 1e98409a52167238f3e6639403745482250c10eb..93f887d57b9b69b355fc9f344d5e484a1ed42de9 100644 (file)
@@ -1,3 +1,62 @@
+2013-02-06  Pravin D  <pravind.2k4@gmail.com>
+
+        When a block element is made inline positioned and has static left and right,  it does not follow inline formatting context
+        https://bugs.webkit.org/show_bug.cgi?id=91665
+
+        Reviewed by Julien Chaffraix.
+
+        Out-of-flow-positioned elements have their display overriden to BLOCK. When a static block elements 
+        changes to inline out-of-flow-positioned or vice-versa, the element current and previous display properties 
+        are same. This causes the element to follow a wrong flow context(in this case Block context) and the element
+        is laid out incorrectly. The patch fixes the issue by reattaching the renderers of the node whenever either
+        position property changes or when its floating property changes.
+        Also the cases when an out-of-flow-positioned/floating element changes to static/non-floating element where
+        being specially handled. As reattaching the renderers in the above cases correctly handles the above cases,
+        special handling for such cases is no more required and the related code can be safely removed.
+        Reattaching renderers for the afore mentioned issues takes a different(longer) code path. Performance measurements
+        summary for the same is as follows:
+                                                              % increase in time
+         Absolute-block-to-static-block                            2.00
+         Absolute-inline-to-static-block                           1.21
+         Absolute-inline-to-static-inline                          1.18
+         Static-block-to-absolute-block                            1.13
+         Static-inline-to-absolute-inline                          1.35
+         Floating-block-non-floating-block                         0.85
+         Floating-inline-non-floating-block                        0.66
+         Floating-inline-non-floating-inline                       0.57
+         Non-floating-block-floating-block                         0.12
+         Non-floating-inline-floating-inline                       1.36
+
+        Tests: fast/dynamic/absolute-positioned-to-static-positioned.html
+               fast/dynamic/floating-to-non-floating.html
+               fast/dynamic/non-floating-to-floating.html
+               fast/dynamic/static-positioned-to-absolute-positioned.html
+
+        * dom/Node.cpp:
+        (WebCore::Node::diff):
+          Return detach in the following conditions:
+             1) Element changes to out-of-flow-positioned or vice-versa.
+             2) Element becomes floating or vice-versa.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore):
+        * rendering/RenderBlock.h:
+        (RenderBlock):
+        * rendering/RenderBoxModelObject.h:
+        (RenderBoxModelObject):
+        * rendering/RenderInline.cpp:
+        (WebCore):
+        * rendering/RenderInline.h:
+        (RenderInline):
+        * rendering/RenderObject.cpp:
+        (WebCore):
+        (WebCore::RenderObject::styleWillChange):
+        (WebCore::RenderObject::styleDidChange):
+        * rendering/RenderObject.h:
+        (RenderObject):
+          The fix in Node::diff() obsoletes some code. The above deletion are part of this dead code cleanup.
+
 2013-02-06  Chris Fleizach  <cfleizach@apple.com>
 
         AX: if <html> has an ARIA attribute, it's exposed as an AXGroup
index c843c7273654a91027b6fd0bf03ec60844a9592b..d64939b54e2486089837ed7479c14d5ecbd7cf92 100644 (file)
@@ -380,6 +380,11 @@ Node::StyleChange Node::diff(const RenderStyle* s1, const RenderStyle* s2, Docum
     if ((s1 && s2) && (s1->regionThread() != s2->regionThread()))
         ch = Detach;
 
+    // Re-attach the renderer when either the element changes from position:static to position:absolute/fixed, vice-versa
+    // or float:none to floating, vice-versa.
+    if ((s1 && s2 ) && (s1->isFloating() != s2->isFloating() || s1->hasOutOfFlowPosition() != s2->hasOutOfFlowPosition()))
+        ch = Detach;
+
     return ch;
 }
 
index 5a4a83d959425734b26614474e3dcd76e0d047b1..3ffaba66e16fd2223024cd7858c588532363c11a 100644 (file)
@@ -6924,14 +6924,6 @@ RenderStyle* RenderBlock::outlineStyleForRepaint() const
     return isAnonymousBlockContinuation() ? continuation()->style() : style();
 }
 
-void RenderBlock::childBecameNonInline(RenderObject*)
-{
-    makeChildrenNonInline();
-    if (isAnonymousBlock() && parent() && parent()->isRenderBlock())
-        toRenderBlock(parent())->removeLeftoverAnonymousBlock(this);
-    // |this| may be dead here
-}
-
 void RenderBlock::updateHitTestResult(HitTestResult& result, const LayoutPoint& point)
 {
     if (result.innerNode())
index 1ed211ce838fd3e6335142f3170de16e85972d7d..4f81ea03776339d239056d2e7a6801a0cbd4b317 100644 (file)
@@ -880,7 +880,6 @@ private:
     
     virtual RenderObject* hoverAncestor() const;
     virtual void updateDragState(bool dragOn);
-    virtual void childBecameNonInline(RenderObject* child);
 
     virtual LayoutRect selectionRectForRepaint(const RenderLayerModelObject* repaintContainer, bool /*clipToVisibleContent*/) OVERRIDE
     {
index 99e6fd9fd87d9d88b804709b8dec139068d5abad..65fe06fb3e162e2534850018381aa7b1de072aa1 100644 (file)
@@ -146,8 +146,6 @@ public:
 
     virtual LayoutUnit containingBlockLogicalWidthForContent() const;
 
-    virtual void childBecameNonInline(RenderObject* /*child*/) { }
-
     void paintBorder(const PaintInfo&, const LayoutRect&, const RenderStyle*, BackgroundBleedAvoidance = BackgroundBleedNone, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true);
     bool paintNinePieceImage(GraphicsContext*, const LayoutRect&, const RenderStyle*, const NinePieceImage&, CompositeOperator = CompositeSourceOver);
     void paintBoxShadow(const PaintInfo&, const LayoutRect&, const RenderStyle*, ShadowStyle, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true);
index cfbe08b8c29ad036daff0f7c02100a2f32dd9994..958cad2dee6d1ac3e0354276648213258763b0fd 100644 (file)
@@ -1224,17 +1224,6 @@ void RenderInline::updateDragState(bool dragOn)
         continuation()->updateDragState(dragOn);
 }
 
-void RenderInline::childBecameNonInline(RenderObject* child)
-{
-    // We have to split the parent flow.
-    RenderBlock* newBox = containingBlock()->createAnonymousBlock();
-    RenderBoxModelObject* oldContinuation = continuation();
-    setContinuation(newBox);
-    RenderObject* beforeChild = child->nextSibling();
-    children()->removeChildNode(this, child);
-    splitFlow(beforeChild, newBox, child, oldContinuation);
-}
-
 void RenderInline::updateHitTestResult(HitTestResult& result, const LayoutPoint& point)
 {
     if (result.innerNode())
index be52cc96c875ff5e2aabfa8a9a5abfa4c80c5c13..39620b65a2fd8f7fc8ffb01adbfe2178de834bd9 100644 (file)
@@ -165,8 +165,6 @@ private:
 
     virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
     virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
-    
-    virtual void childBecameNonInline(RenderObject* child);
 
     virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&);
 
index 23f06f57b8486c43184204e56e6005ce34472b4e..da6db8ea702741422b9a09b2c33a29f7d13e7ab9 100644 (file)
@@ -118,8 +118,6 @@ struct SameSizeAsRenderObject {
 
 COMPILE_ASSERT(sizeof(RenderObject) == sizeof(SameSizeAsRenderObject), RenderObject_should_stay_small);
 
-bool RenderObject::s_affectsParentBlock = false;
-
 RenderObjectAncestorLineboxDirtySet* RenderObject::s_ancestorLineboxDirtySet = 0;
 
 void* RenderObject::operator new(size_t sz, RenderArena* renderArena)
@@ -1671,25 +1669,6 @@ void RenderObject::selectionStartEnd(int& spos, int& epos) const
     view()->selectionStartEnd(spos, epos);
 }
 
-void RenderObject::handleDynamicFloatPositionChange()
-{
-    // We have gone from not affecting the inline status of the parent flow to suddenly
-    // having an impact.  See if there is a mismatch between the parent flow's
-    // childrenInline() state and our state.
-    setInline(style()->isDisplayInlineType());
-    if (isInline() != parent()->childrenInline()) {
-        if (!isInline())
-            toRenderBoxModelObject(parent())->childBecameNonInline(this);
-        else {
-            // An anonymous block must be made to wrap this inline.
-            RenderBlock* block = toRenderBlock(parent())->createAnonymousBlock();
-            RenderObjectChildList* childlist = parent()->virtualChildren();
-            childlist->insertChildNode(parent(), block, this);
-            block->children()->appendChildNode(block, childlist->removeChildNode(parent(), this));
-        }
-    }
-}
-
 void RenderObject::setAnimatableStyle(PassRefPtr<RenderStyle> style)
 {
     if (!isText() && style)
@@ -1887,10 +1866,6 @@ void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle* newS
             // from the positioned objects list.
             toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists();
 
-        s_affectsParentBlock = isFloatingOrOutOfFlowPositioned()
-            && (!newStyle->isFloating() && !newStyle->hasOutOfFlowPosition())
-            && parent() && (parent()->isBlockFlow() || parent()->isRenderInline());
-
         // reset style flags
         if (diff == StyleDifferenceLayout || diff == StyleDifferenceLayoutPositionedMovementOnly) {
             setFloating(false);
@@ -1901,8 +1876,7 @@ void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle* newS
         setHasOverflowClip(false);
         setHasTransform(false);
         setHasReflection(false);
-    } else
-        s_affectsParentBlock = false;
+    }
 
     if (view()->frameView()) {
         bool shouldBlitOnFixedBackgroundImage = false;
@@ -1954,8 +1928,6 @@ static inline bool areCursorsEqual(const RenderStyle* a, const RenderStyle* b)
 
 void RenderObject::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
-    if (s_affectsParentBlock)
-        handleDynamicFloatPositionChange();
 
 #if ENABLE(SVG)
     SVGRenderSupport::styleChanged(this);
index d6874c5f542972eac05f3219da0a3f47e8763456..c60ffcb29e62dbb6f6cd31c6358d9311fd5a9dec 100644 (file)
@@ -244,11 +244,6 @@ public:
     // children.
     virtual RenderBlock* firstLineBlock() const;
 
-    // Called when an object that was floating or positioned becomes a normal flow object
-    // again.  We have to make sure the render tree updates as needed to accommodate the new
-    // normal flow object.
-    void handleDynamicFloatPositionChange();
-    
     // RenderObject tree manipulation
     //////////////////////////////////////////
     virtual bool canHaveChildren() const { return virtualChildren(); }
@@ -1140,10 +1135,6 @@ private:
     void setPaintBackground(bool b) { m_bitfields.setPaintBackground(b); }
     void setIsDragging(bool b) { m_bitfields.setIsDragging(b); }
     void setEverHadLayout(bool b) { m_bitfields.setEverHadLayout(b); }
-
-private:
-    // Store state between styleWillChange and styleDidChange
-    static bool s_affectsParentBlock;
 };
 
 inline bool RenderObject::documentBeingDestroyed() const