<!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>[173743] 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/173743">173743</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2014-09-18 18:01:39 -0700 (Thu, 18 Sep 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Remove generator/yield terminology in RenderInline's GeneratorContext
https://bugs.webkit.org/show_bug.cgi?id=119278
Reviewed by Sam Weinig.
Get rid of the icky Generator/yield syntax used for collecting rects in RenderInline.
Just replace the operator() with an explicit addRect().
Also some drive-by nullptr cleanup, and removing default arguments from
addChildIgnoringContinuation() calls.
* rendering/RenderInline.cpp:
(WebCore::RenderInline::willBeDestroyed):
(WebCore::RenderInline::styleDidChange):
(WebCore::RenderInline::splitInlines):
(WebCore::RenderInline::addChildToContinuation):
(WebCore::RenderInline::generateLineBoxRects):
(WebCore::RenderInline::generateCulledLineBoxRects):
* rendering/RenderInline.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderInlinecpp">trunk/Source/WebCore/rendering/RenderInline.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderInlineh">trunk/Source/WebCore/rendering/RenderInline.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (173742 => 173743)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-09-18 23:57:18 UTC (rev 173742)
+++ trunk/Source/WebCore/ChangeLog        2014-09-19 01:01:39 UTC (rev 173743)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2014-09-18 Simon Fraser <simon.fraser@apple.com>
+
+ Remove generator/yield terminology in RenderInline's GeneratorContext
+ https://bugs.webkit.org/show_bug.cgi?id=119278
+
+ Reviewed by Sam Weinig.
+
+ Get rid of the icky Generator/yield syntax used for collecting rects in RenderInline.
+ Just replace the operator() with an explicit addRect().
+
+ Also some drive-by nullptr cleanup, and removing default arguments from
+ addChildIgnoringContinuation() calls.
+
+ * rendering/RenderInline.cpp:
+ (WebCore::RenderInline::willBeDestroyed):
+ (WebCore::RenderInline::styleDidChange):
+ (WebCore::RenderInline::splitInlines):
+ (WebCore::RenderInline::addChildToContinuation):
+ (WebCore::RenderInline::generateLineBoxRects):
+ (WebCore::RenderInline::generateCulledLineBoxRects):
+ * rendering/RenderInline.h:
+
</ins><span class="cx"> 2014-09-18 Jeremy Jones <jeremyj@apple.com>
</span><span class="cx">
</span><span class="cx"> Improve fullscreen video rotation animation.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderInlinecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (173742 => 173743)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderInline.cpp        2014-09-18 23:57:18 UTC (rev 173742)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp        2014-09-19 01:01:39 UTC (rev 173743)
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx"> RenderBoxModelObject* continuation = this->continuation();
</span><span class="cx"> if (continuation) {
</span><span class="cx"> continuation->destroy();
</span><del>- setContinuation(0);
</del><ins>+ setContinuation(nullptr);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!documentBeingDestroyed()) {
</span><span class="lines">@@ -184,7 +184,7 @@
</span><span class="cx"> RenderInline* continuation = inlineElementContinuation();
</span><span class="cx"> for (RenderInline* currCont = continuation; currCont; currCont = currCont->inlineElementContinuation()) {
</span><span class="cx"> RenderBoxModelObject* nextCont = currCont->continuation();
</span><del>- currCont->setContinuation(0);
</del><ins>+ currCont->setContinuation(nullptr);
</ins><span class="cx"> currCont->setStyle(newStyle);
</span><span class="cx"> currCont->setContinuation(nextCont);
</span><span class="cx"> }
</span><span class="lines">@@ -373,7 +373,7 @@
</span><span class="cx"> RenderObject* tmp = o;
</span><span class="cx"> o = tmp->nextSibling();
</span><span class="cx"> removeChildInternal(*tmp, NotifyChildren);
</span><del>- cloneInline->addChildIgnoringContinuation(tmp, 0);
</del><ins>+ cloneInline->addChildIgnoringContinuation(tmp);
</ins><span class="cx"> tmp->setNeedsLayoutAndPrefWidthsRecalc();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -400,7 +400,7 @@
</span><span class="cx"> cloneInline = toRenderInline(curr)->clone();
</span><span class="cx">
</span><span class="cx"> // Insert our child clone as the first child.
</span><del>- cloneInline->addChildIgnoringContinuation(cloneChild.leakPtr(), 0);
</del><ins>+ cloneInline->addChildIgnoringContinuation(cloneChild.leakPtr());
</ins><span class="cx">
</span><span class="cx"> // Hook the clone up as a continuation of |curr|.
</span><span class="cx"> RenderInline* inlineCurr = toRenderInline(curr);
</span><span class="lines">@@ -415,7 +415,7 @@
</span><span class="cx"> RenderObject* tmp = o;
</span><span class="cx"> o = tmp->nextSibling();
</span><span class="cx"> inlineCurr->removeChildInternal(*tmp, NotifyChildren);
</span><del>- cloneInline->addChildIgnoringContinuation(tmp, 0);
</del><ins>+ cloneInline->addChildIgnoringContinuation(tmp);
</ins><span class="cx"> tmp->setNeedsLayoutAndPrefWidthsRecalc();
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -537,7 +537,7 @@
</span><span class="cx"> if (childInline == bcpInline)
</span><span class="cx"> return beforeChildParent->addChildIgnoringContinuation(newChild, beforeChild);
</span><span class="cx"> else if (flowInline == childInline)
</span><del>- return flow->addChildIgnoringContinuation(newChild, 0); // Just treat like an append.
</del><ins>+ return flow->addChildIgnoringContinuation(newChild); // Just treat like an append.
</ins><span class="cx"> else
</span><span class="cx"> return beforeChildParent->addChildIgnoringContinuation(newChild, beforeChild);
</span><span class="cx"> }
</span><span class="lines">@@ -549,22 +549,22 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template<typename GeneratorContext>
</span><del>-void RenderInline::generateLineBoxRects(GeneratorContext& yield) const
</del><ins>+void RenderInline::generateLineBoxRects(GeneratorContext& context) const
</ins><span class="cx"> {
</span><span class="cx"> if (!alwaysCreateLineBoxes())
</span><del>- generateCulledLineBoxRects(yield, this);
</del><ins>+ generateCulledLineBoxRects(context, this);
</ins><span class="cx"> else if (InlineFlowBox* curr = firstLineBox()) {
</span><span class="cx"> for (; curr; curr = curr->nextLineBox())
</span><del>- yield(FloatRect(curr->topLeft(), curr->size()));
</del><ins>+ context.addRect(FloatRect(curr->topLeft(), curr->size()));
</ins><span class="cx"> } else
</span><del>- yield(FloatRect());
</del><ins>+ context.addRect(FloatRect());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template<typename GeneratorContext>
</span><del>-void RenderInline::generateCulledLineBoxRects(GeneratorContext& yield, const RenderInline* container) const
</del><ins>+void RenderInline::generateCulledLineBoxRects(GeneratorContext& context, const RenderInline* container) const
</ins><span class="cx"> {
</span><span class="cx"> if (!culledInlineFirstLineBox()) {
</span><del>- yield(FloatRect());
</del><ins>+ context.addRect(FloatRect());
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -584,31 +584,32 @@
</span><span class="cx"> int logicalTop = rootBox.logicalTop() + (rootBox.lineStyle().font().fontMetrics().ascent() - containerStyle.font().fontMetrics().ascent());
</span><span class="cx"> int logicalHeight = containerStyle.font().fontMetrics().height();
</span><span class="cx"> if (isHorizontal)
</span><del>- yield(FloatRect(currBox->inlineBoxWrapper()->x() - currBox->marginLeft(), logicalTop, currBox->width() + currBox->horizontalMarginExtent(), logicalHeight));
</del><ins>+ context.addRect(FloatRect(currBox->inlineBoxWrapper()->x() - currBox->marginLeft(), logicalTop, currBox->width() + currBox->horizontalMarginExtent(), logicalHeight));
</ins><span class="cx"> else
</span><del>- yield(FloatRect(logicalTop, currBox->inlineBoxWrapper()->y() - currBox->marginTop(), logicalHeight, currBox->height() + currBox->verticalMarginExtent()));
</del><ins>+ context.addRect(FloatRect(logicalTop, currBox->inlineBoxWrapper()->y() - currBox->marginTop(), logicalHeight, currBox->height() + currBox->verticalMarginExtent()));
</ins><span class="cx"> }
</span><span class="cx"> } else if (curr->isRenderInline()) {
</span><span class="cx"> // If the child doesn't need line boxes either, then we can recur.
</span><span class="cx"> RenderInline* currInline = toRenderInline(curr);
</span><span class="cx"> if (!currInline->alwaysCreateLineBoxes())
</span><del>- currInline->generateCulledLineBoxRects(yield, container);
</del><ins>+ currInline->generateCulledLineBoxRects(context, container);
</ins><span class="cx"> else {
</span><span class="cx"> for (InlineFlowBox* childLine = currInline->firstLineBox(); childLine; childLine = childLine->nextLineBox()) {
</span><span class="cx"> const RootInlineBox& rootBox = childLine->root();
</span><span class="cx"> const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style();
</span><span class="cx"> int logicalTop = rootBox.logicalTop() + (rootBox.lineStyle().font().fontMetrics().ascent() - containerStyle.font().fontMetrics().ascent());
</span><span class="cx"> int logicalHeight = containerStyle.fontMetrics().height();
</span><del>- if (isHorizontal)
- yield(FloatRect(childLine->x() - childLine->marginLogicalLeft(),
</del><ins>+ if (isHorizontal) {
+ context.addRect(FloatRect(childLine->x() - childLine->marginLogicalLeft(),
</ins><span class="cx"> logicalTop,
</span><span class="cx"> childLine->logicalWidth() + childLine->marginLogicalLeft() + childLine->marginLogicalRight(),
</span><span class="cx"> logicalHeight));
</span><del>- else
- yield(FloatRect(logicalTop,
</del><ins>+ } else {
+ context.addRect(FloatRect(logicalTop,
</ins><span class="cx"> childLine->y() - childLine->marginLogicalLeft(),
</span><span class="cx"> logicalHeight,
</span><span class="cx"> childLine->logicalWidth() + childLine->marginLogicalLeft() + childLine->marginLogicalRight()));
</span><ins>+ }
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> } else if (curr->isText()) {
</span><span class="lines">@@ -619,9 +620,9 @@
</span><span class="cx"> int logicalTop = rootBox.logicalTop() + (rootBox.lineStyle().font().fontMetrics().ascent() - containerStyle.font().fontMetrics().ascent());
</span><span class="cx"> int logicalHeight = containerStyle.font().fontMetrics().height();
</span><span class="cx"> if (isHorizontal)
</span><del>- yield(FloatRect(childText->x(), logicalTop, childText->logicalWidth(), logicalHeight));
</del><ins>+ context.addRect(FloatRect(childText->x(), logicalTop, childText->logicalWidth(), logicalHeight));
</ins><span class="cx"> else
</span><del>- yield(FloatRect(logicalTop, childText->y(), logicalHeight, childText->logicalWidth()));
</del><ins>+ context.addRect(FloatRect(logicalTop, childText->y(), logicalHeight, childText->logicalWidth()));
</ins><span class="cx"> }
</span><span class="cx"> } else if (curr->isLineBreak()) {
</span><span class="cx"> if (InlineBox* inlineBox = toRenderLineBreak(curr)->inlineBoxWrapper()) {
</span><span class="lines">@@ -631,9 +632,9 @@
</span><span class="cx"> int logicalTop = rootBox.logicalTop() + (rootBox.lineStyle().font().fontMetrics().ascent() - containerStyle.font().fontMetrics().ascent());
</span><span class="cx"> int logicalHeight = containerStyle.fontMetrics().height();
</span><span class="cx"> if (isHorizontal)
</span><del>- yield(FloatRect(inlineBox->x(), logicalTop, inlineBox->logicalWidth(), logicalHeight));
</del><ins>+ context.addRect(FloatRect(inlineBox->x(), logicalTop, inlineBox->logicalWidth(), logicalHeight));
</ins><span class="cx"> else
</span><del>- yield(FloatRect(logicalTop, inlineBox->y(), logicalHeight, inlineBox->logicalWidth()));
</del><ins>+ context.addRect(FloatRect(logicalTop, inlineBox->y(), logicalHeight, inlineBox->logicalWidth()));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -647,7 +648,7 @@
</span><span class="cx"> : m_rects(rects)
</span><span class="cx"> , m_accumulatedOffset(accumulatedOffset) { }
</span><span class="cx">
</span><del>- void operator()(const FloatRect& rect)
</del><ins>+ void addRect(const FloatRect& rect)
</ins><span class="cx"> {
</span><span class="cx"> IntRect intRect = enclosingIntRect(rect);
</span><span class="cx"> intRect.move(m_accumulatedOffset.x(), m_accumulatedOffset.y());
</span><span class="lines">@@ -683,10 +684,10 @@
</span><span class="cx"> : m_quads(quads)
</span><span class="cx"> , m_geometryMap()
</span><span class="cx"> {
</span><del>- m_geometryMap.pushMappingsToAncestor(renderer, 0);
</del><ins>+ m_geometryMap.pushMappingsToAncestor(renderer, nullptr);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- void operator()(const FloatRect& rect)
</del><ins>+ void addRect(const FloatRect& rect)
</ins><span class="cx"> {
</span><span class="cx"> m_quads.append(m_geometryMap.absoluteRect(rect));
</span><span class="cx"> }
</span><span class="lines">@@ -805,13 +806,20 @@
</span><span class="cx">
</span><span class="cx"> class HitTestCulledInlinesGeneratorContext {
</span><span class="cx"> public:
</span><del>- HitTestCulledInlinesGeneratorContext(Region& region, const HitTestLocation& location) : m_intersected(false), m_region(region), m_location(location) { }
- void operator()(const FloatRect& rect)
</del><ins>+ HitTestCulledInlinesGeneratorContext(Region& region, const HitTestLocation& location)
+ : m_intersected(false)
+ , m_region(region)
+ , m_location(location)
+ { }
+
+ void addRect(const FloatRect& rect)
</ins><span class="cx"> {
</span><span class="cx"> m_intersected = m_intersected || m_location.intersects(rect);
</span><span class="cx"> m_region.unite(enclosingIntRect(rect));
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> bool intersected() const { return m_intersected; }
</span><ins>+
</ins><span class="cx"> private:
</span><span class="cx"> bool m_intersected;
</span><span class="cx"> Region& m_region;
</span><span class="lines">@@ -870,7 +878,8 @@
</span><span class="cx"> class LinesBoundingBoxGeneratorContext {
</span><span class="cx"> public:
</span><span class="cx"> LinesBoundingBoxGeneratorContext(FloatRect& rect) : m_rect(rect) { }
</span><del>- void operator()(const FloatRect& rect)
</del><ins>+
+ void addRect(const FloatRect& rect)
</ins><span class="cx"> {
</span><span class="cx"> m_rect.uniteIfNonZero(rect);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderInlineh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderInline.h (173742 => 173743)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderInline.h        2014-09-18 23:57:18 UTC (rev 173742)
+++ trunk/Source/WebCore/rendering/RenderInline.h        2014-09-19 01:01:39 UTC (rev 173743)
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx"> void generateCulledLineBoxRects(GeneratorContext& yield, const RenderInline* container) const;
</span><span class="cx">
</span><span class="cx"> void addChildToContinuation(RenderObject* newChild, RenderObject* beforeChild);
</span><del>- virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObject* beforeChild = 0) override final;
</del><ins>+ virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObject* beforeChild = nullptr) override final;
</ins><span class="cx">
</span><span class="cx"> void splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock, RenderBlock* middleBlock,
</span><span class="cx"> RenderObject* beforeChild, RenderBoxModelObject* oldCont);
</span></span></pre>
</div>
</div>
</body>
</html>