Title: [161335] trunk/Source/WebCore
- Revision
- 161335
- Author
- [email protected]
- Date
- 2014-01-06 01:47:01 -0800 (Mon, 06 Jan 2014)
Log Message
RenderInline::clone() should return RenderPtr.
<https://webkit.org/b/126514>
Patch by Gurpreet Kaur <[email protected]> on 2014-01-06
Reviewed by Antti Koivisto.
* rendering/RenderInline.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::clone):
Tweaked to return RenderPtr<RenderInline>.
(WebCore::RenderInline::splitInlines):
Store cloned RenderInlines in RenderPtrs. Use leakPtr() to sink
them into ownership-taking APIs that still use raw pointers.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (161334 => 161335)
--- trunk/Source/WebCore/ChangeLog 2014-01-06 09:04:51 UTC (rev 161334)
+++ trunk/Source/WebCore/ChangeLog 2014-01-06 09:47:01 UTC (rev 161335)
@@ -1,5 +1,23 @@
2014-01-06 Gurpreet Kaur <[email protected]>
+ RenderInline::clone() should return RenderPtr.
+ <https://webkit.org/b/126514>
+
+ Reviewed by Antti Koivisto.
+
+ * rendering/RenderInline.h:
+ * rendering/RenderInline.cpp:
+ (WebCore::RenderInline::clone):
+
+ Tweaked to return RenderPtr<RenderInline>.
+
+ (WebCore::RenderInline::splitInlines):
+
+ Store cloned RenderInlines in RenderPtrs. Use leakPtr() to sink
+ them into ownership-taking APIs that still use raw pointers.
+
+2014-01-06 Andreas Kling <[email protected]>
+
<hr> appears gray instead of green because of color attribute is defined followed by noshade attribute
https://bugs.webkit.org/show_bug.cgi?id=17674
Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (161334 => 161335)
--- trunk/Source/WebCore/rendering/RenderInline.cpp 2014-01-06 09:04:51 UTC (rev 161334)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp 2014-01-06 09:47:01 UTC (rev 161335)
@@ -330,9 +330,9 @@
newChild->setNeedsLayoutAndPrefWidthsRecalc();
}
-RenderInline* RenderInline::clone() const
+RenderPtr<RenderInline> RenderInline::clone() const
{
- RenderInline* cloneInline = new RenderInline(*element(), style());
+ RenderPtr<RenderInline> cloneInline = createRenderer<RenderInline>(*element(), style());
cloneInline->initializeStyle();
cloneInline->setFlowThreadState(flowThreadState());
return cloneInline;
@@ -343,7 +343,7 @@
RenderObject* beforeChild, RenderBoxModelObject* oldCont)
{
// Create a clone of this inline.
- RenderInline* cloneInline = clone();
+ RenderPtr<RenderInline> cloneInline = clone();
cloneInline->setContinuation(oldCont);
#if ENABLE(FULLSCREEN_API)
@@ -369,7 +369,7 @@
}
// Hook |clone| up as the continuation of the middle block.
- middleBlock->setContinuation(cloneInline);
+ middleBlock->setContinuation(cloneInline.get());
// We have been reparented and are now under the fromBlock. We need
// to walk up our inline parent chain until we hit the containing block.
@@ -387,16 +387,16 @@
ASSERT(curr->isRenderInline());
if (splitDepth < cMaxSplitDepth) {
// Create a new clone.
- RenderInline* cloneChild = cloneInline;
+ RenderPtr<RenderInline> cloneChild = std::move(cloneInline);
cloneInline = toRenderInline(curr)->clone();
// Insert our child clone as the first child.
- cloneInline->addChildIgnoringContinuation(cloneChild, 0);
+ cloneInline->addChildIgnoringContinuation(cloneChild.leakPtr(), 0);
// Hook the clone up as a continuation of |curr|.
RenderInline* inlineCurr = toRenderInline(curr);
oldCont = inlineCurr->continuation();
- inlineCurr->setContinuation(cloneInline);
+ inlineCurr->setContinuation(cloneInline.get());
cloneInline->setContinuation(oldCont);
// Now we need to take all of the children starting from the first child
@@ -418,7 +418,7 @@
}
// Now we are at the block level. We need to put the clone into the toBlock.
- toBlock->insertChildInternal(cloneInline, nullptr, NotifyChildren);
+ toBlock->insertChildInternal(cloneInline.leakPtr(), nullptr, NotifyChildren);
// Now take all the children after currChild and remove them from the fromBlock
// and put them in the toBlock.
Modified: trunk/Source/WebCore/rendering/RenderInline.h (161334 => 161335)
--- trunk/Source/WebCore/rendering/RenderInline.h 2014-01-06 09:04:51 UTC (rev 161334)
+++ trunk/Source/WebCore/rendering/RenderInline.h 2014-01-06 09:47:01 UTC (rev 161335)
@@ -169,7 +169,7 @@
virtual void updateFromStyle() OVERRIDE FINAL;
- RenderInline* clone() const;
+ RenderPtr<RenderInline> clone() const;
void paintOutlineForLine(GraphicsContext*, const LayoutPoint&, const LayoutRect& prevLine, const LayoutRect& thisLine,
const LayoutRect& nextLine, const Color);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes