<!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>[203660] 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/203660">203660</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2016-07-23 20:11:55 -0700 (Sat, 23 Jul 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Stop isEmpty() from leaking out of SVG.
https://bugs.webkit.org/show_bug.cgi?id=160121

Reviewed by Simon Fraser.

It's unclear what isEmpty() actually means and it doesn't bring any value to Render* classes.

No change in functionality.

* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded):
* rendering/RenderElement.h:
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::isEmpty): Deleted.
* rendering/RenderListItem.h:
* rendering/RenderObject.h:
(WebCore::RenderObject::isEmpty): Deleted.
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::removeChild):
(WebCore::RenderRubyRun::isEmpty): Deleted.
* rendering/RenderRubyRun.h:
* rendering/mathml/RenderMathMLFenced.cpp:
(WebCore::RenderMathMLFenced::updateFromElement):
(WebCore::RenderMathMLFenced::addChild):
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::paint):
* rendering/svg/RenderSVGShape.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsobjcDOMUIKitExtensionsmm">trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm</a></li>
<li><a href="#trunkSourceWebCoreeditingCompositeEditCommandcpp">trunk/Source/WebCore/editing/CompositeEditCommand.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementh">trunk/Source/WebCore/rendering/RenderElement.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderListItemcpp">trunk/Source/WebCore/rendering/RenderListItem.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderListItemh">trunk/Source/WebCore/rendering/RenderListItem.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderObjecth">trunk/Source/WebCore/rendering/RenderObject.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderRubyRuncpp">trunk/Source/WebCore/rendering/RenderRubyRun.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderRubyRunh">trunk/Source/WebCore/rendering/RenderRubyRun.h</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLFencedcpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLRootcpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGShapeh">trunk/Source/WebCore/rendering/svg/RenderSVGShape.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (203659 => 203660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-24 02:15:25 UTC (rev 203659)
+++ trunk/Source/WebCore/ChangeLog        2016-07-24 03:11:55 UTC (rev 203660)
</span><span class="lines">@@ -1,5 +1,35 @@
</span><span class="cx"> 2016-07-23  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Stop isEmpty() from leaking out of SVG.
+        https://bugs.webkit.org/show_bug.cgi?id=160121
+
+        Reviewed by Simon Fraser.
+
+        It's unclear what isEmpty() actually means and it doesn't bring any value to Render* classes.
+
+        No change in functionality.
+
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded):
+        * rendering/RenderElement.h:
+        * rendering/RenderListItem.cpp:
+        (WebCore::RenderListItem::isEmpty): Deleted.
+        * rendering/RenderListItem.h:
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::isEmpty): Deleted.
+        * rendering/RenderRubyRun.cpp:
+        (WebCore::RenderRubyRun::removeChild):
+        (WebCore::RenderRubyRun::isEmpty): Deleted.
+        * rendering/RenderRubyRun.h:
+        * rendering/mathml/RenderMathMLFenced.cpp:
+        (WebCore::RenderMathMLFenced::updateFromElement):
+        (WebCore::RenderMathMLFenced::addChild):
+        * rendering/mathml/RenderMathMLRoot.cpp:
+        (WebCore::RenderMathMLRoot::paint):
+        * rendering/svg/RenderSVGShape.h:
+
+2016-07-23  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
</ins><span class="cx">         table*BorderAdjoiningCell and borderAdjoiningCell* should take reference instead of RenderTableCell*.
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=160123
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsobjcDOMUIKitExtensionsmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm (203659 => 203660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm        2016-07-24 02:15:25 UTC (rev 203659)
+++ trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm        2016-07-24 03:11:55 UTC (rev 203660)
</span><span class="lines">@@ -285,7 +285,7 @@
</span><span class="cx">         if (renderer-&gt;isFloatingOrOutOfFlowPositioned() ||
</span><span class="cx">             renderer-&gt;isWidget()) {
</span><span class="cx">             result = INT_MAX;
</span><del>-        } else if (renderer-&gt;isEmpty()) {
</del><ins>+        } else if (!renderer-&gt;firstChildSlow()) {
</ins><span class="cx">             result = 0;
</span><span class="cx">         } else if (is&lt;RenderBlockFlow&gt;(*renderer) || (is&lt;RenderBlock&gt;(*renderer) &amp;&amp; downcast&lt;RenderBlock&gt;(*renderer).inlineElementContinuation())) {
</span><span class="cx">             BOOL noCost = NO;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingCompositeEditCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/CompositeEditCommand.cpp (203659 => 203660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/CompositeEditCommand.cpp        2016-07-24 02:15:25 UTC (rev 203659)
+++ trunk/Source/WebCore/editing/CompositeEditCommand.cpp        2016-07-24 03:11:55 UTC (rev 203660)
</span><span class="lines">@@ -1065,7 +1065,7 @@
</span><span class="cx">     
</span><span class="cx">     // Append the placeholder to make sure it follows any unrendered blocks.
</span><span class="cx">     auto&amp; blockFlow = downcast&lt;RenderBlockFlow&gt;(*renderer);
</span><del>-    if (!blockFlow.height() || (blockFlow.isListItem() &amp;&amp; blockFlow.isEmpty()))
</del><ins>+    if (!blockFlow.height() || (blockFlow.isListItem() &amp;&amp; !blockFlow.firstChild()))
</ins><span class="cx">         return appendBlockPlaceholder(container);
</span><span class="cx"> 
</span><span class="cx">     return nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.h (203659 => 203660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.h        2016-07-24 02:15:25 UTC (rev 203659)
+++ trunk/Source/WebCore/rendering/RenderElement.h        2016-07-24 03:11:55 UTC (rev 203660)
</span><span class="lines">@@ -68,8 +68,6 @@
</span><span class="cx">     RenderObject* firstChild() const { return m_firstChild; }
</span><span class="cx">     RenderObject* lastChild() const { return m_lastChild; }
</span><span class="cx"> 
</span><del>-    bool isEmpty() const override { return !firstChild(); }
-
</del><span class="cx">     bool canContainFixedPositionObjects() const;
</span><span class="cx">     bool canContainAbsolutelyPositionedObjects() const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderListItemcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderListItem.cpp (203659 => 203660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderListItem.cpp        2016-07-24 02:15:25 UTC (rev 203659)
+++ trunk/Source/WebCore/rendering/RenderListItem.cpp        2016-07-24 03:11:55 UTC (rev 203660)
</span><span class="lines">@@ -220,11 +220,6 @@
</span><span class="cx">     m_isValueUpToDate = true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderListItem::isEmpty() const
-{
-    return lastChild() == m_marker;
-}
-
</del><span class="cx"> static RenderBlock* getParentOfFirstLineBox(RenderBlock&amp; current, RenderObject&amp; marker)
</span><span class="cx"> {
</span><span class="cx">     bool inQuirksMode = current.document().inQuirksMode();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderListItemh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderListItem.h (203659 => 203660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderListItem.h        2016-07-24 02:15:25 UTC (rev 203659)
+++ trunk/Source/WebCore/rendering/RenderListItem.h        2016-07-24 03:11:55 UTC (rev 203660)
</span><span class="lines">@@ -66,7 +66,6 @@
</span><span class="cx">     void insertedIntoTree() override;
</span><span class="cx">     void willBeRemovedFromTree() override;
</span><span class="cx"> 
</span><del>-    bool isEmpty() const override;
</del><span class="cx">     void paint(PaintInfo&amp;, const LayoutPoint&amp;) override;
</span><span class="cx"> 
</span><span class="cx">     void layout() override;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderObject.h (203659 => 203660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderObject.h        2016-07-24 02:15:25 UTC (rev 203659)
+++ trunk/Source/WebCore/rendering/RenderObject.h        2016-07-24 03:11:55 UTC (rev 203660)
</span><span class="lines">@@ -175,9 +175,6 @@
</span><span class="cx"> 
</span><span class="cx">     RenderNamedFlowFragment* currentRenderNamedFlowFragment() const;
</span><span class="cx"> 
</span><del>-    // FIXME: The meaning of this function is unclear.
-    virtual bool isEmpty() const { return !firstChildSlow(); }
-
</del><span class="cx"> #ifndef NDEBUG
</span><span class="cx">     void setHasAXObject(bool flag) { m_hasAXObject = flag; }
</span><span class="cx">     bool hasAXObject() const { return m_hasAXObject; }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderRubyRuncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderRubyRun.cpp (203659 => 203660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderRubyRun.cpp        2016-07-24 02:15:25 UTC (rev 203659)
+++ trunk/Source/WebCore/rendering/RenderRubyRun.cpp        2016-07-24 03:11:55 UTC (rev 203660)
</span><span class="lines">@@ -71,11 +71,6 @@
</span><span class="cx">     return lastChild() &amp;&amp; lastChild()-&gt;isRubyBase();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderRubyRun::isEmpty() const
-{
-    return !hasRubyText() &amp;&amp; !hasRubyBase();
-}
-
</del><span class="cx"> RenderRubyText* RenderRubyRun::rubyText() const
</span><span class="cx"> {
</span><span class="cx">     RenderObject* child = firstChild();
</span><span class="lines">@@ -193,7 +188,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // If any of the above leaves the run empty, destroy it as well.
</span><del>-        if (isEmpty()) {
</del><ins>+        if (!hasRubyText() &amp;&amp; !hasRubyBase()) {
</ins><span class="cx">             parent()-&gt;removeChild(*this);
</span><span class="cx">             deleteLines();
</span><span class="cx">             destroy();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderRubyRunh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderRubyRun.h (203659 => 203660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderRubyRun.h        2016-07-24 02:15:25 UTC (rev 203659)
+++ trunk/Source/WebCore/rendering/RenderRubyRun.h        2016-07-24 03:11:55 UTC (rev 203660)
</span><span class="lines">@@ -48,7 +48,6 @@
</span><span class="cx"> 
</span><span class="cx">     bool hasRubyText() const;
</span><span class="cx">     bool hasRubyBase() const;
</span><del>-    bool isEmpty() const override;
</del><span class="cx">     RenderRubyText* rubyText() const;
</span><span class="cx">     RenderRubyBase* rubyBase() const;
</span><span class="cx">     RenderRubyBase* rubyBaseSafe(); // creates the base if it doesn't already exist
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLFencedcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp (203659 => 203660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp        2016-07-24 02:15:25 UTC (rev 203659)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp        2016-07-24 03:11:55 UTC (rev 203660)
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx">         m_separators = StringImpl::create(&quot;,&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (isEmpty())
</del><ins>+    if (!firstChild())
</ins><span class="cx">         makeFences();
</span><span class="cx">     else {
</span><span class="cx">         // FIXME: The mfenced element fails to update dynamically when its open, close and separators attributes are changed (https://bugs.webkit.org/show_bug.cgi?id=57696).
</span><span class="lines">@@ -103,7 +103,7 @@
</span><span class="cx"> void RenderMathMLFenced::addChild(RenderObject* child, RenderObject* beforeChild)
</span><span class="cx"> {
</span><span class="cx">     // make the fences if the render object is empty
</span><del>-    if (isEmpty())
</del><ins>+    if (!firstChild())
</ins><span class="cx">         updateFromElement();
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Adding or removing a child should possibly cause all later separators to shift places if they're different, as later child positions change by +1 or -1. This should also handle surrogate pairs. See https://bugs.webkit.org/show_bug.cgi?id=125938.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLRootcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp (203659 => 203660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp        2016-07-24 02:15:25 UTC (rev 203659)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp        2016-07-24 03:11:55 UTC (rev 203660)
</span><span class="lines">@@ -251,7 +251,7 @@
</span><span class="cx"> {
</span><span class="cx">     RenderMathMLRow::paint(info, paintOffset);
</span><span class="cx"> 
</span><del>-    if (isEmpty() || info.context().paintingDisabled() || style().visibility() != VISIBLE || !isValid())
</del><ins>+    if (!firstChild() || info.context().paintingDisabled() || style().visibility() != VISIBLE || !isValid())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // We draw the radical operator.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGShapeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGShape.h (203659 => 203660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGShape.h        2016-07-24 02:15:25 UTC (rev 203659)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGShape.h        2016-07-24 03:11:55 UTC (rev 203660)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx">     void element() const = delete;
</span><span class="cx"> 
</span><span class="cx">     virtual void updateShapeFromElement();
</span><del>-    bool isEmpty() const override;
</del><ins>+    virtual bool isEmpty() const;
</ins><span class="cx">     virtual bool shapeDependentStrokeContains(const FloatPoint&amp;);
</span><span class="cx">     virtual bool shapeDependentFillContains(const FloatPoint&amp;, const WindRule) const;
</span><span class="cx">     float strokeWidth() const;
</span></span></pre>
</div>
</div>

</body>
</html>