<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[171744] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/171744">171744</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2014-07-29 07:51:31 -0700 (Tue, 29 Jul 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Cleanup RenderSelectionInfoBase/RenderSelectionInfo/RenderBlockSelectionInfo.
https://bugs.webkit.org/show_bug.cgi?id=135326
Reviewed by Darin Adler.
1. Move implementation to RenderSelectInfo.cpp
2. RenderSelectionInfoBase/RenderSelectionInfo/RenderBlockSelectionInfo take Render* reference.
3. Remove unused functions.
4. Add RenderSelectionInfoBase::repaintRectangle()
No change in behavior.
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderSelectionInfo.cpp: Added.
(WebCore::RenderSelectionInfoBase::RenderSelectionInfoBase):
(WebCore::RenderSelectionInfoBase::repaintRectangle):
(WebCore::RenderSelectionInfo::RenderSelectionInfo):
(WebCore::RenderSelectionInfo::repaint):
(WebCore::RenderBlockSelectionInfo::RenderBlockSelectionInfo):
(WebCore::RenderBlockSelectionInfo::repaint):
* rendering/RenderSelectionInfo.h:
(WebCore::RenderSelectionInfo::collectedSelectionRects):
(WebCore::RenderSelectionInfoBase::RenderSelectionInfoBase): Deleted.
(WebCore::RenderSelectionInfoBase::object): Deleted.
(WebCore::RenderSelectionInfo::RenderSelectionInfo): Deleted.
(WebCore::RenderSelectionInfo::repaint): Deleted.
(WebCore::RenderSelectionInfo::rects): Deleted.
(WebCore::RenderBlockSelectionInfo::RenderBlockSelectionInfo): Deleted.
(WebCore::RenderBlockSelectionInfo::repaint): Deleted.
(WebCore::RenderBlockSelectionInfo::block): Deleted.
* rendering/RenderView.cpp:
(WebCore::RenderView::subtreeSelectionBounds):
(WebCore::RenderView::repaintSubtreeSelection):
(WebCore::RenderView::clearSubtreeSelection):
(WebCore::RenderView::applySubtreeSelection):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderSelectionInfoh">trunk/Source/WebCore/rendering/RenderSelectionInfo.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderViewcpp">trunk/Source/WebCore/rendering/RenderView.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderingAllInOnecpp">trunk/Source/WebCore/rendering/RenderingAllInOne.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorerenderingRenderSelectionInfocpp">trunk/Source/WebCore/rendering/RenderSelectionInfo.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (171743 => 171744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-07-29 14:35:13 UTC (rev 171743)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-07-29 14:51:31 UTC (rev 171744)
</span><span class="lines">@@ -2352,6 +2352,7 @@
</span><span class="cx"> rendering/RenderScrollbarPart.cpp
</span><span class="cx"> rendering/RenderScrollbarTheme.cpp
</span><span class="cx"> rendering/RenderSearchField.cpp
</span><ins>+ rendering/RenderSelectionInfo.cpp
</ins><span class="cx"> rendering/RenderSlider.cpp
</span><span class="cx"> rendering/RenderSnapshottedPlugIn.cpp
</span><span class="cx"> rendering/RenderTable.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (171743 => 171744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-07-29 14:35:13 UTC (rev 171743)
+++ trunk/Source/WebCore/ChangeLog        2014-07-29 14:51:31 UTC (rev 171744)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2014-07-29 Zalan Bujtas <zalan@apple.com>
+
+ Cleanup RenderSelectionInfoBase/RenderSelectionInfo/RenderBlockSelectionInfo.
+ https://bugs.webkit.org/show_bug.cgi?id=135326
+
+ Reviewed by Darin Adler.
+
+ 1. Move implementation to RenderSelectInfo.cpp
+ 2. RenderSelectionInfoBase/RenderSelectionInfo/RenderBlockSelectionInfo take Render* reference.
+ 3. Remove unused functions.
+ 4. Add RenderSelectionInfoBase::repaintRectangle()
+
+ No change in behavior.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * rendering/RenderSelectionInfo.cpp: Added.
+ (WebCore::RenderSelectionInfoBase::RenderSelectionInfoBase):
+ (WebCore::RenderSelectionInfoBase::repaintRectangle):
+ (WebCore::RenderSelectionInfo::RenderSelectionInfo):
+ (WebCore::RenderSelectionInfo::repaint):
+ (WebCore::RenderBlockSelectionInfo::RenderBlockSelectionInfo):
+ (WebCore::RenderBlockSelectionInfo::repaint):
+ * rendering/RenderSelectionInfo.h:
+ (WebCore::RenderSelectionInfo::collectedSelectionRects):
+ (WebCore::RenderSelectionInfoBase::RenderSelectionInfoBase): Deleted.
+ (WebCore::RenderSelectionInfoBase::object): Deleted.
+ (WebCore::RenderSelectionInfo::RenderSelectionInfo): Deleted.
+ (WebCore::RenderSelectionInfo::repaint): Deleted.
+ (WebCore::RenderSelectionInfo::rects): Deleted.
+ (WebCore::RenderBlockSelectionInfo::RenderBlockSelectionInfo): Deleted.
+ (WebCore::RenderBlockSelectionInfo::repaint): Deleted.
+ (WebCore::RenderBlockSelectionInfo::block): Deleted.
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::subtreeSelectionBounds):
+ (WebCore::RenderView::repaintSubtreeSelection):
+ (WebCore::RenderView::clearSubtreeSelection):
+ (WebCore::RenderView::applySubtreeSelection):
+
</ins><span class="cx"> 2014-07-28 Pratik Solanki <psolanki@apple.com>
</span><span class="cx">
</span><span class="cx"> Get SharedBuffer.h out of ResourceBuffer.h (and a few other places)
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (171743 => 171744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-07-29 14:35:13 UTC (rev 171743)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-07-29 14:51:31 UTC (rev 171744)
</span><span class="lines">@@ -10862,6 +10862,20 @@
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="..\rendering\RenderSelectionInfo.cpp">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
+ </ClCompile>
</ins><span class="cx"> <ClCompile Include="..\rendering\RenderSlider.cpp">
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (171743 => 171744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-07-29 14:35:13 UTC (rev 171743)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-07-29 14:51:31 UTC (rev 171744)
</span><span class="lines">@@ -2598,6 +2598,9 @@
</span><span class="cx"> <ClCompile Include="..\rendering\RenderSearchField.cpp">
</span><span class="cx"> <Filter>rendering</Filter>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="..\rendering\RenderSelectionInfo.cpp">
+ <Filter>rendering</Filter>
+ </ClCompile>
</ins><span class="cx"> <ClCompile Include="..\rendering\RenderSlider.cpp">
</span><span class="cx"> <Filter>rendering</Filter>
</span><span class="cx"> </ClCompile>
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (171743 => 171744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-07-29 14:35:13 UTC (rev 171743)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-07-29 14:51:31 UTC (rev 171744)
</span><span class="lines">@@ -2066,6 +2066,7 @@
</span><span class="cx">                 589556ED18D4A44000764B03 /* BorderEdge.h in Headers */ = {isa = PBXBuildFile; fileRef = 589556EC18D4A44000764B03 /* BorderEdge.h */; };
</span><span class="cx">                 58AEE2F418D4BCCF0022E7FE /* BorderEdge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 58AEE2F318D4BCCF0022E7FE /* BorderEdge.cpp */; };
</span><span class="cx">                 58CD35CB18EB4C3900B9F3AC /* FloatSizeHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 58CD35CA18EB4C3900B9F3AC /* FloatSizeHash.h */; };
</span><ins>+                58DEED8619873FF000888FF3 /* RenderSelectionInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 58DEED8519873FF000888FF3 /* RenderSelectionInfo.cpp */; };
</ins><span class="cx">                 5905ADBF1302F3CE00F116DF /* XMLTreeViewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5905ADBD1302F3CE00F116DF /* XMLTreeViewer.cpp */; };
</span><span class="cx">                 5905ADC01302F3CE00F116DF /* XMLTreeViewer.h in Headers */ = {isa = PBXBuildFile; fileRef = 5905ADBE1302F3CE00F116DF /* XMLTreeViewer.h */; };
</span><span class="cx">                 590E1B4911E4EF4B0069F784 /* DeviceOrientationData.h in Headers */ = {isa = PBXBuildFile; fileRef = 590E1B4811E4EF4B0069F784 /* DeviceOrientationData.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -9184,6 +9185,7 @@
</span><span class="cx">                 589556EC18D4A44000764B03 /* BorderEdge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BorderEdge.h; sourceTree = "<group>"; };
</span><span class="cx">                 58AEE2F318D4BCCF0022E7FE /* BorderEdge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BorderEdge.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 58CD35CA18EB4C3900B9F3AC /* FloatSizeHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FloatSizeHash.h; sourceTree = "<group>"; };
</span><ins>+                58DEED8519873FF000888FF3 /* RenderSelectionInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSelectionInfo.cpp; sourceTree = "<group>"; };
</ins><span class="cx">                 5905ADBD1302F3CE00F116DF /* XMLTreeViewer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLTreeViewer.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 5905ADBE1302F3CE00F116DF /* XMLTreeViewer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLTreeViewer.h; sourceTree = "<group>"; };
</span><span class="cx">                 590E1B4811E4EF4B0069F784 /* DeviceOrientationData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceOrientationData.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -22432,6 +22434,7 @@
</span><span class="cx">                                 BC3BE9980E9C1E5D00835588 /* RenderScrollbarTheme.h */,
</span><span class="cx">                                 458FE4071589DF0B005609E6 /* RenderSearchField.cpp */,
</span><span class="cx">                                 458FE4081589DF0B005609E6 /* RenderSearchField.h */,
</span><ins>+                                58DEED8519873FF000888FF3 /* RenderSelectionInfo.cpp */,
</ins><span class="cx">                                 0F11A54E0F39233100C37884 /* RenderSelectionInfo.h */,
</span><span class="cx">                                 AB247A6A0AFD6383003FA5FD /* RenderSlider.cpp */,
</span><span class="cx">                                 AB247A6B0AFD6383003FA5FD /* RenderSlider.h */,
</span><span class="lines">@@ -27555,6 +27558,7 @@
</span><span class="cx">                                 85DF812A0AA7787200486AD7 /* DOMHTMLImageElement.mm in Sources */,
</span><span class="cx">                                 85F32AED0AA63B8700FF3184 /* DOMHTMLInputElement.mm in Sources */,
</span><span class="cx">                                 A6148A6812E41D940044A784 /* DOMHTMLKeygenElement.mm in Sources */,
</span><ins>+                                58DEED8619873FF000888FF3 /* RenderSelectionInfo.cpp in Sources */,
</ins><span class="cx">                                 85BA4CE20AA6861B0088052D /* DOMHTMLLabelElement.mm in Sources */,
</span><span class="cx">                                 85BA4CE40AA6861B0088052D /* DOMHTMLLegendElement.mm in Sources */,
</span><span class="cx">                                 85BA4D120AA688680088052D /* DOMHTMLLIElement.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderSelectionInfocpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/rendering/RenderSelectionInfo.cpp (0 => 171744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderSelectionInfo.cpp         (rev 0)
+++ trunk/Source/WebCore/rendering/RenderSelectionInfo.cpp        2014-07-29 14:51:31 UTC (rev 171744)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "RenderSelectionInfo.h"
+
+#include "RenderText.h"
+
+namespace WebCore {
+
+RenderSelectionInfoBase::RenderSelectionInfoBase(RenderObject& renderer)
+ : m_renderer(renderer)
+ , m_repaintContainer(renderer.containerForRepaint())
+ , m_state(renderer.selectionState())
+{
+}
+
+void RenderSelectionInfoBase::repaintRectangle(const LayoutRect& repaintRect)
+{
+ m_renderer.repaintUsingContainer(m_repaintContainer, enclosingIntRect(repaintRect));
+}
+
+RenderSelectionInfo::RenderSelectionInfo(RenderObject& renderer, bool clipToVisibleContent)
+ : RenderSelectionInfoBase(renderer)
+{
+ if (renderer.canUpdateSelectionOnRootLineBoxes()) {
+ if (renderer.isText())
+ m_rect = toRenderText(renderer).collectSelectionRectsForLineBoxes(m_repaintContainer, clipToVisibleContent, m_collectedSelectionRects);
+ else
+ m_rect = renderer.selectionRectForRepaint(m_repaintContainer, clipToVisibleContent);
+ }
+}
+
+void RenderSelectionInfo::repaint()
+{
+ repaintRectangle(m_rect);
+}
+
+RenderBlockSelectionInfo::RenderBlockSelectionInfo(RenderBlock& renderer)
+ : RenderSelectionInfoBase(renderer)
+ , m_rects(renderer.canUpdateSelectionOnRootLineBoxes() ? renderer.selectionGapRectsForRepaint(m_repaintContainer) : GapRects())
+{
+}
+
+void RenderBlockSelectionInfo::repaint()
+{
+ repaintRectangle(m_rects);
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderSelectionInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderSelectionInfo.h (171743 => 171744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderSelectionInfo.h        2014-07-29 14:35:13 UTC (rev 171743)
+++ trunk/Source/WebCore/rendering/RenderSelectionInfo.h        2014-07-29 14:51:31 UTC (rev 171744)
</span><span class="lines">@@ -26,64 +26,39 @@
</span><span class="cx"> #define RenderSelectionInfo_h
</span><span class="cx">
</span><span class="cx"> #include "GapRects.h"
</span><del>-#include "IntRect.h"
</del><span class="cx"> #include "RenderBlock.h"
</span><del>-#include "RenderText.h"
</del><ins>+#include "RenderObject.h"
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class RenderSelectionInfoBase {
</span><span class="cx"> WTF_MAKE_NONCOPYABLE(RenderSelectionInfoBase); WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>- RenderSelectionInfoBase()
- : m_object(0)
- , m_repaintContainer(0)
- , m_state(RenderObject::SelectionNone)
- {
- }
-
- explicit RenderSelectionInfoBase(RenderObject* o)
- : m_object(o)
- , m_repaintContainer(o->containerForRepaint())
- , m_state(o->selectionState())
- {
- }
-
- RenderObject* object() const { return m_object; }
</del><ins>+ explicit RenderSelectionInfoBase(RenderObject& renderer);
</ins><span class="cx"> RenderLayerModelObject* repaintContainer() const { return m_repaintContainer; }
</span><span class="cx"> RenderObject::SelectionState state() const { return m_state; }
</span><span class="cx">
</span><span class="cx"> protected:
</span><del>- RenderObject* m_object;
</del><ins>+ void repaintRectangle(const LayoutRect& repaintRect);
+
+ RenderObject& m_renderer;
</ins><span class="cx"> RenderLayerModelObject* m_repaintContainer;
</span><ins>+
+private:
</ins><span class="cx"> RenderObject::SelectionState m_state;
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> // This struct is used when the selection changes to cache the old and new state of the selection for each RenderObject.
</span><span class="cx"> class RenderSelectionInfo : public RenderSelectionInfoBase {
</span><span class="cx"> public:
</span><del>- RenderSelectionInfo(RenderObject* o, bool clipToVisibleContent)
- : RenderSelectionInfoBase(o)
- {
- ASSERT(o);
- if (o->canUpdateSelectionOnRootLineBoxes()) {
- if (o->isText())
- m_rect = toRenderText(*o).collectSelectionRectsForLineBoxes(m_repaintContainer, clipToVisibleContent, m_rects);
- else
- m_rect = o->selectionRectForRepaint(m_repaintContainer, clipToVisibleContent);
- }
- }
-
- void repaint()
- {
- m_object->repaintUsingContainer(m_repaintContainer, enclosingIntRect(m_rect));
- }
</del><ins>+ RenderSelectionInfo(RenderObject& renderer, bool clipToVisibleContent);
</ins><span class="cx">
</span><del>- const Vector<LayoutRect>& rects() const { return m_rects; }
</del><ins>+ void repaint();
+ const Vector<LayoutRect>& collectedSelectionRects() const { return m_collectedSelectionRects; }
</ins><span class="cx"> LayoutRect rect() const { return m_rect; }
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- Vector<LayoutRect> m_rects;
</del><ins>+ Vector<LayoutRect> m_collectedSelectionRects; // relative to repaint container
</ins><span class="cx"> LayoutRect m_rect; // relative to repaint container
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -91,18 +66,9 @@
</span><span class="cx"> // This struct is used when the selection changes to cache the old and new state of the selection for each RenderBlock.
</span><span class="cx"> class RenderBlockSelectionInfo : public RenderSelectionInfoBase {
</span><span class="cx"> public:
</span><del>- explicit RenderBlockSelectionInfo(RenderBlock* b)
- : RenderSelectionInfoBase(b)
- , m_rects(b->canUpdateSelectionOnRootLineBoxes() ? block()->selectionGapRectsForRepaint(m_repaintContainer) : GapRects())
- {
- }
</del><ins>+ explicit RenderBlockSelectionInfo(RenderBlock& renderer);
</ins><span class="cx">
</span><del>- void repaint()
- {
- m_object->repaintUsingContainer(m_repaintContainer, enclosingIntRect(m_rects));
- }
-
- RenderBlock* block() const { return toRenderBlock(m_object); }
</del><ins>+ void repaint();
</ins><span class="cx"> GapRects rects() const { return m_rects; }
</span><span class="cx">
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderView.cpp (171743 => 171744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderView.cpp        2014-07-29 14:35:13 UTC (rev 171743)
+++ trunk/Source/WebCore/rendering/RenderView.cpp        2014-07-29 14:51:31 UTC (rev 171744)
</span><span class="lines">@@ -753,13 +753,13 @@
</span><span class="cx"> while (os && os != stop) {
</span><span class="cx"> if ((os->canBeSelectionLeaf() || os == root.selectionStart() || os == root.selectionEnd()) && os->selectionState() != SelectionNone) {
</span><span class="cx"> // Blocks are responsible for painting line gaps and margin gaps. They must be examined as well.
</span><del>- selectedObjects.set(os, std::make_unique<RenderSelectionInfo>(os, clipToVisibleContent));
</del><ins>+ selectedObjects.set(os, std::make_unique<RenderSelectionInfo>(*os, clipToVisibleContent));
</ins><span class="cx"> RenderBlock* cb = os->containingBlock();
</span><span class="cx"> while (cb && !cb->isRenderView()) {
</span><span class="cx"> std::unique_ptr<RenderSelectionInfo>& blockInfo = selectedObjects.add(cb, nullptr).iterator->value;
</span><span class="cx"> if (blockInfo)
</span><span class="cx"> break;
</span><del>- blockInfo = std::make_unique<RenderSelectionInfo>(cb, clipToVisibleContent);
</del><ins>+ blockInfo = std::make_unique<RenderSelectionInfo>(*cb, clipToVisibleContent);
</ins><span class="cx"> cb = cb->containingBlock();
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -805,13 +805,13 @@
</span><span class="cx"> if (o->selectionState() == SelectionNone)
</span><span class="cx"> continue;
</span><span class="cx">
</span><del>- RenderSelectionInfo(o, true).repaint();
</del><ins>+ RenderSelectionInfo(*o, true).repaint();
</ins><span class="cx">
</span><span class="cx"> // Blocks are responsible for painting line gaps and margin gaps. They must be examined as well.
</span><span class="cx"> for (RenderBlock* block = o->containingBlock(); block && !block->isRenderView(); block = block->containingBlock()) {
</span><span class="cx"> if (!processedBlocks.add(block).isNewEntry)
</span><span class="cx"> break;
</span><del>- RenderSelectionInfo(block, true).repaint();
</del><ins>+ RenderSelectionInfo(*block, true).repaint();
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -954,14 +954,14 @@
</span><span class="cx"> if ((os->canBeSelectionLeaf() || os == root.selectionStart() || os == root.selectionEnd())
</span><span class="cx"> && os->selectionState() != SelectionNone) {
</span><span class="cx"> // Blocks are responsible for painting line gaps and margin gaps. They must be examined as well.
</span><del>- oldSelectionData.selectedObjects.set(os, std::make_unique<RenderSelectionInfo>(os, true));
</del><ins>+ oldSelectionData.selectedObjects.set(os, std::make_unique<RenderSelectionInfo>(*os, true));
</ins><span class="cx"> if (blockRepaintMode == RepaintNewXOROld) {
</span><span class="cx"> RenderBlock* cb = os->containingBlock();
</span><span class="cx"> while (cb && !cb->isRenderView()) {
</span><span class="cx"> std::unique_ptr<RenderBlockSelectionInfo>& blockInfo = oldSelectionData.selectedBlocks.add(cb, nullptr).iterator->value;
</span><span class="cx"> if (blockInfo)
</span><span class="cx"> break;
</span><del>- blockInfo = std::make_unique<RenderBlockSelectionInfo>(cb);
</del><ins>+ blockInfo = std::make_unique<RenderBlockSelectionInfo>(*cb);
</ins><span class="cx"> cb = cb->containingBlock();
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -1008,10 +1008,10 @@
</span><span class="cx"> selectionIterator = SelectionIterator(o);
</span><span class="cx"> while (o && o != stop) {
</span><span class="cx"> if ((o->canBeSelectionLeaf() || o == start || o == end) && o->selectionState() != SelectionNone) {
</span><del>- std::unique_ptr<RenderSelectionInfo> selectionInfo = std::make_unique<RenderSelectionInfo>(o, true);
</del><ins>+ std::unique_ptr<RenderSelectionInfo> selectionInfo = std::make_unique<RenderSelectionInfo>(*o, true);
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(SERVICE_CONTROLS)
</span><del>- for (auto& rect : selectionInfo->rects())
</del><ins>+ for (auto& rect : selectionInfo->collectedSelectionRects())
</ins><span class="cx"> m_selectionRectGatherer.addRect(rect);
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="lines">@@ -1022,7 +1022,7 @@
</span><span class="cx"> std::unique_ptr<RenderBlockSelectionInfo>& blockInfo = newSelectedBlocks.add(cb, nullptr).iterator->value;
</span><span class="cx"> if (blockInfo)
</span><span class="cx"> break;
</span><del>- blockInfo = std::make_unique<RenderBlockSelectionInfo>(cb);
</del><ins>+ blockInfo = std::make_unique<RenderBlockSelectionInfo>(*cb);
</ins><span class="cx"> cb = cb->containingBlock();
</span><span class="cx">
</span><span class="cx"> #if ENABLE(SERVICE_CONTROLS)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderingAllInOnecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderingAllInOne.cpp (171743 => 171744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderingAllInOne.cpp        2014-07-29 14:35:13 UTC (rev 171743)
+++ trunk/Source/WebCore/rendering/RenderingAllInOne.cpp        2014-07-29 14:51:31 UTC (rev 171744)
</span><span class="lines">@@ -96,6 +96,7 @@
</span><span class="cx"> #include "RenderScrollbarPart.cpp"
</span><span class="cx"> #include "RenderScrollbarTheme.cpp"
</span><span class="cx"> #include "RenderSearchField.cpp"
</span><ins>+#include "RenderSelectionInfo.cpp"
</ins><span class="cx"> #include "RenderSlider.cpp"
</span><span class="cx"> #include "RenderSnapshottedPlugIn.cpp"
</span><span class="cx"> #include "RenderTable.cpp"
</span></span></pre>
</div>
</div>
</body>
</html>