Title: [186631] branches/safari-600.8-branch

Diff

Modified: branches/safari-600.8-branch/LayoutTests/ChangeLog (186630 => 186631)


--- branches/safari-600.8-branch/LayoutTests/ChangeLog	2015-07-09 21:03:29 UTC (rev 186630)
+++ branches/safari-600.8-branch/LayoutTests/ChangeLog	2015-07-09 21:03:34 UTC (rev 186631)
@@ -1,5 +1,28 @@
 2015-07-09  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r186575. rdar://problem/21716377
+
+    2015-07-08  Lucas Forschler  <lforsch...@apple.com>
+
+            Merge r185665. rdar://problem/21716515
+
+        2015-06-17  Zalan Bujtas  <za...@apple.com>
+
+                Selection cache produces invalid result when ancestor has float element.
+                https://bugs.webkit.org/show_bug.cgi?id=146042
+                rdar://problem/20604592
+
+                Reviewed by Ryosuke Niwa.
+
+                Selection cache already takes floats into account, however it's not enough to check current
+                block against floats. Any of the ancestor's float starting from the selection root block
+                can impact the selection offsets.
+
+                * fast/block/selection-cache-is-incorrect-when-non-direct-parent-has-float-expected.txt: Added.
+                * fast/block/selection-cache-is-incorrect-when-non-direct-parent-has-float.html: Added.
+
+2015-07-09  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r186571. rdar://problem/21716420
 
     2015-07-08  Lucas Forschler  <lforsch...@apple.com>

Added: branches/safari-600.8-branch/LayoutTests/fast/block/selection-cache-is-incorrect-when-non-direct-parent-has-float-expected.txt (0 => 186631)


--- branches/safari-600.8-branch/LayoutTests/fast/block/selection-cache-is-incorrect-when-non-direct-parent-has-float-expected.txt	                        (rev 0)
+++ branches/safari-600.8-branch/LayoutTests/fast/block/selection-cache-is-incorrect-when-non-direct-parent-has-float-expected.txt	2015-07-09 21:03:34 UTC (rev 186631)
@@ -0,0 +1,2 @@
+Pass if no crash or assert in debug.
+bar

Added: branches/safari-600.8-branch/LayoutTests/fast/block/selection-cache-is-incorrect-when-non-direct-parent-has-float.html (0 => 186631)


--- branches/safari-600.8-branch/LayoutTests/fast/block/selection-cache-is-incorrect-when-non-direct-parent-has-float.html	                        (rev 0)
+++ branches/safari-600.8-branch/LayoutTests/fast/block/selection-cache-is-incorrect-when-non-direct-parent-has-float.html	2015-07-09 21:03:34 UTC (rev 186631)
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+    ol {
+	    margin: 0px;
+    }
+
+    .float {
+        float: left;
+        width: 100px;
+	    height: 100px;
+    }
+</style>
+<script>
+    if (window.testRunner)
+        testRunner.dumpAsText();
+</script>
+</head>
+<body>
+    <ol><li>Pass if no crash or assert in debug.</li></ol>
+    <div class=float>bar</div>
+    <script>
+        document.designMode = "on";
+        document.execCommand("SelectAll");
+    </script>
+</body>
+</html>
\ No newline at end of file

Modified: branches/safari-600.8-branch/Source/WebCore/ChangeLog (186630 => 186631)


--- branches/safari-600.8-branch/Source/WebCore/ChangeLog	2015-07-09 21:03:29 UTC (rev 186630)
+++ branches/safari-600.8-branch/Source/WebCore/ChangeLog	2015-07-09 21:03:34 UTC (rev 186631)
@@ -1,5 +1,35 @@
 2015-07-09  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r186575. rdar://problem/21716377
+
+    2015-07-08  Lucas Forschler  <lforsch...@apple.com>
+
+            Merge r185665. rdar://problem/21716515
+
+        2015-06-17  Zalan Bujtas  <za...@apple.com>
+
+                Selection cache produces invalid result when ancestor has float element.
+                https://bugs.webkit.org/show_bug.cgi?id=146042
+                rdar://problem/20604592
+
+                Reviewed by Ryosuke Niwa.
+
+                Selection cache already takes floats into account, however it's not enough to check current
+                block against floats. Any of the ancestor's float starting from the selection root block
+                can impact the selection offsets.
+
+                Test: fast/block/selection-cache-is-incorrect-when-non-direct-parent-has-float.html
+
+                * rendering/LogicalSelectionOffsetCaches.h:
+                (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::ContainingBlockInfo):
+                (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::setBlock):
+                (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::block):
+                (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::cache):
+                (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::hasFloatsOrFlowThreads):
+                (WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
+
+2015-07-09  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r186571. rdar://problem/21716420
 
     2015-07-08  Lucas Forschler  <lforsch...@apple.com>

Modified: branches/safari-600.8-branch/Source/WebCore/rendering/LogicalSelectionOffsetCaches.h (186630 => 186631)


--- branches/safari-600.8-branch/Source/WebCore/rendering/LogicalSelectionOffsetCaches.h	2015-07-09 21:03:29 UTC (rev 186630)
+++ branches/safari-600.8-branch/Source/WebCore/rendering/LogicalSelectionOffsetCaches.h	2015-07-09 21:03:34 UTC (rev 186631)
@@ -79,25 +79,20 @@
     class ContainingBlockInfo {
     public:
         ContainingBlockInfo()
-            : m_block(0)
-            , m_cache(0)
-            , m_hasFloatsOrFlowThreads(false)
+            : m_hasFloatsOrFlowThreads(false)
             , m_cachedLogicalLeftSelectionOffset(false)
             , m_cachedLogicalRightSelectionOffset(false)
         { }
 
-        void setBlock(RenderBlock* block, const LogicalSelectionOffsetCaches* cache)
+        void setBlock(RenderBlock* block, const LogicalSelectionOffsetCaches* cache, bool parentCacheHasFloatsOrFlowThreads = false)
         {
             m_block = block;
-            m_hasFloatsOrFlowThreads = m_hasFloatsOrFlowThreads || m_block->containsFloats() || m_block->flowThreadContainingBlock();
+            m_hasFloatsOrFlowThreads = parentCacheHasFloatsOrFlowThreads || m_hasFloatsOrFlowThreads || m_block->containsFloats() || m_block->flowThreadContainingBlock();
             m_cache = cache;
             m_cachedLogicalLeftSelectionOffset = false;
             m_cachedLogicalRightSelectionOffset = false;
         }
 
-        RenderBlock* block() const { return m_block; }
-        const LogicalSelectionOffsetCaches* cache() const { return m_cache; }
-
         LayoutUnit logicalLeftSelectionOffset(RenderBlock& rootBlock, LayoutUnit position) const
         {
             ASSERT(m_cache);
@@ -120,9 +115,13 @@
             return m_logicalRightSelectionOffset;
         }
 
+        RenderBlock* block() const { return m_block; }
+        const LogicalSelectionOffsetCaches* cache() const { return m_cache; }
+        bool hasFloatsOrFlowThreads() const { return m_hasFloatsOrFlowThreads; }
+
     private:
-        RenderBlock* m_block;
-        const LogicalSelectionOffsetCaches* m_cache;
+        RenderBlock* m_block { nullptr };
+        const LogicalSelectionOffsetCaches* m_cache { nullptr };
         bool m_hasFloatsOrFlowThreads : 1;
         mutable bool m_cachedLogicalLeftSelectionOffset : 1;
         mutable bool m_cachedLogicalRightSelectionOffset : 1;
@@ -151,12 +150,12 @@
         , m_containingBlockForAbsolutePosition(cache.m_containingBlockForAbsolutePosition)
     {
         if (block.canContainFixedPositionObjects())
-            m_containingBlockForFixedPosition.setBlock(&block, &cache);
+            m_containingBlockForFixedPosition.setBlock(&block, &cache, cache.m_containingBlockForFixedPosition.hasFloatsOrFlowThreads());
 
         if (isContainingBlockCandidateForAbsolutelyPositionedObject(block) && !block.isRenderInline() && !block.isAnonymousBlock())
-            m_containingBlockForFixedPosition.setBlock(&block, &cache);
+            m_containingBlockForAbsolutePosition.setBlock(&block, &cache, cache.m_containingBlockForAbsolutePosition.hasFloatsOrFlowThreads());
 
-        m_containingBlockForInflowPosition.setBlock(&block, &cache);
+        m_containingBlockForInflowPosition.setBlock(&block, &cache, cache.m_containingBlockForInflowPosition.hasFloatsOrFlowThreads());
     }
 
     const ContainingBlockInfo& containingBlockInfo(RenderBlock& block) const
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to