From 0ddff378a150d4d3d078faf9e5ec14ed29e8ddaf Mon Sep 17 00:00:00 2001 From: "mihnea@adobe.com" Date: Mon, 30 Jan 2012 21:11:48 +0000 Subject: [PATCH] [CSSRegions]Add support for background-color in region styling https://bugs.webkit.org/show_bug.cgi?id=71488 Reviewed by David Hyatt. Source/WebCore: Based on work by Alexandru Chiculita (achicu@adobe.com). Previous patches for region styling were touching RenderObject::style() method. After several attempts to avoid regressions (including caching of RenderObject::style() pointer in most used methods), we decided to attempt a different approach: Step1: before each region is repainted, we compute the style for each box that falls into the region Step2: before paint, we store the box original style Step3: paint the region contents using the style in region Step4: after paint is finished, we restore the box original style (and store the box style in region for future region paint) Tests for region styling are also enabled with this patch. * WebCore.exp.in: * rendering/RenderFlowThread.cpp: (WebCore::RenderFlowThread::clearRenderBoxCustomStyle): (WebCore::RenderFlowThread::setRegionRangeForBox): * rendering/RenderFlowThread.h: (): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paint): (WebCore::RenderLayer::hitTest): * rendering/RenderObject.cpp: * rendering/RenderObject.h: (WebCore::RenderObject::style): (RenderObject): * rendering/RenderObjectChildList.cpp: (WebCore::RenderObjectChildList::removeChildNode): * rendering/RenderRegion.cpp: (WebCore::RenderRegion::RenderRegion): (WebCore::RenderRegion::setRegionBoxesRegionStyle): (WebCore): (WebCore::RenderRegion::restoreRegionBoxesOriginalStyle): (WebCore::RenderRegion::paintReplaced): (WebCore::RenderRegion::setRenderBoxRegionInfo): (WebCore::RenderRegion::takeRenderBoxRegionInfo): (WebCore::RenderRegion::removeRenderBoxRegionInfo): (WebCore::RenderRegion::renderBoxRegionStyle): (WebCore::RenderRegion::computeStyleInRegion): (WebCore::RenderRegion::clearBoxStyleInRegion): * rendering/RenderRegion.h: (RenderRegion): * rendering/RenderView.cpp: (WebCore::RenderView::RenderView): * rendering/RenderView.h: (WebCore): (RenderView): LayoutTests: Enable the region styling tests again. * platform/mac-snowleopard/Skipped: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106281 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 11 +++ LayoutTests/platform/mac-snowleopard/Skipped | 8 +- Source/WebCore/ChangeLog | 52 ++++++++++ Source/WebCore/WebCore.exp.in | 1 - Source/WebCore/rendering/RenderFlowThread.cpp | 6 +- Source/WebCore/rendering/RenderFlowThread.h | 2 +- Source/WebCore/rendering/RenderLayer.cpp | 20 ---- Source/WebCore/rendering/RenderObject.cpp | 14 --- Source/WebCore/rendering/RenderObject.h | 8 +- Source/WebCore/rendering/RenderObjectChildList.cpp | 2 +- Source/WebCore/rendering/RenderRegion.cpp | 110 ++++++++++++++++----- Source/WebCore/rendering/RenderRegion.h | 22 +++-- Source/WebCore/rendering/RenderView.cpp | 1 - Source/WebCore/rendering/RenderView.h | 5 - 14 files changed, 173 insertions(+), 89 deletions(-) diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index c0cc20f..00ce1cd 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,14 @@ +2012-01-30 Mihnea Ovidenie + + [CSSRegions]Add support for background-color in region styling + https://bugs.webkit.org/show_bug.cgi?id=71488 + + Reviewed by David Hyatt. + + Enable the region styling tests again. + + * platform/mac-snowleopard/Skipped: + 2012-01-30 Joshua Bell IndexedDB: Add tests for structured clone data diff --git a/LayoutTests/platform/mac-snowleopard/Skipped b/LayoutTests/platform/mac-snowleopard/Skipped index 9ee77e0..2092087a1 100644 --- a/LayoutTests/platform/mac-snowleopard/Skipped +++ b/LayoutTests/platform/mac-snowleopard/Skipped @@ -185,10 +185,10 @@ http/tests/media/video-load-twice.html # Regression in performance # https://bugs.webkit.org/show_bug.cgi?id=74141 -fast/regions/region-style-block-background-color.html -fast/regions/region-style-block-background-color2.html -fast/regions/region-style-image-background-color.html -fast/regions/region-style-inline-background-color.html +#fast/regions/region-style-block-background-color.html +#fast/regions/region-style-block-background-color2.html +#fast/regions/region-style-image-background-color.html +#fast/regions/region-style-inline-background-color.html # HiDPI tests have lower-level platform dependencies on Mac fast/hidpi diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 008a874..4077ce5 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,55 @@ +2012-01-30 Mihnea Ovidenie + + [CSSRegions]Add support for background-color in region styling + https://bugs.webkit.org/show_bug.cgi?id=71488 + + Reviewed by David Hyatt. + + Based on work by Alexandru Chiculita (achicu@adobe.com). + Previous patches for region styling were touching RenderObject::style() method. After several attempts to avoid regressions + (including caching of RenderObject::style() pointer in most used methods), we decided to attempt a different approach: + Step1: before each region is repainted, we compute the style for each box that falls into the region + Step2: before paint, we store the box original style + Step3: paint the region contents using the style in region + Step4: after paint is finished, we restore the box original style (and store the box style in region for future region paint) + + Tests for region styling are also enabled with this patch. + + * WebCore.exp.in: + * rendering/RenderFlowThread.cpp: + (WebCore::RenderFlowThread::clearRenderBoxCustomStyle): + (WebCore::RenderFlowThread::setRegionRangeForBox): + * rendering/RenderFlowThread.h: + (): + * rendering/RenderLayer.cpp: + (WebCore::RenderLayer::paint): + (WebCore::RenderLayer::hitTest): + * rendering/RenderObject.cpp: + * rendering/RenderObject.h: + (WebCore::RenderObject::style): + (RenderObject): + * rendering/RenderObjectChildList.cpp: + (WebCore::RenderObjectChildList::removeChildNode): + * rendering/RenderRegion.cpp: + (WebCore::RenderRegion::RenderRegion): + (WebCore::RenderRegion::setRegionBoxesRegionStyle): + (WebCore): + (WebCore::RenderRegion::restoreRegionBoxesOriginalStyle): + (WebCore::RenderRegion::paintReplaced): + (WebCore::RenderRegion::setRenderBoxRegionInfo): + (WebCore::RenderRegion::takeRenderBoxRegionInfo): + (WebCore::RenderRegion::removeRenderBoxRegionInfo): + (WebCore::RenderRegion::renderBoxRegionStyle): + (WebCore::RenderRegion::computeStyleInRegion): + (WebCore::RenderRegion::clearBoxStyleInRegion): + * rendering/RenderRegion.h: + (RenderRegion): + * rendering/RenderView.cpp: + (WebCore::RenderView::RenderView): + * rendering/RenderView.h: + (WebCore): + (RenderView): + 2012-01-30 Jessie Berlin WebCore build exceeds address space on 32-bit Windows builders (again). diff --git a/Source/WebCore/WebCore.exp.in b/Source/WebCore/WebCore.exp.in index f41640d..2ecf04d 100644 --- a/Source/WebCore/WebCore.exp.in +++ b/Source/WebCore/WebCore.exp.in @@ -1192,7 +1192,6 @@ __ZNK7WebCore11ScriptValue9getStringEPN3JSC9ExecStateERN3WTF6StringE __ZNK7WebCore12IconDatabase12databasePathEv __ZNK7WebCore12IconDatabase24shouldStopThreadActivityEv __ZNK7WebCore12IconDatabase9isEnabledEv -__ZNK7WebCore12RenderObject13styleInRegionEv __ZNK7WebCore12RenderObject14enclosingLayerEv __ZNK7WebCore12RenderObject15localToAbsoluteERKNS_10FloatPointEbb __ZNK7WebCore12RenderObject23absoluteBoundingBoxRectEb diff --git a/Source/WebCore/rendering/RenderFlowThread.cpp b/Source/WebCore/rendering/RenderFlowThread.cpp index 83b4d9f..d18f9eb 100644 --- a/Source/WebCore/rendering/RenderFlowThread.cpp +++ b/Source/WebCore/rendering/RenderFlowThread.cpp @@ -742,7 +742,7 @@ RenderRegion* RenderFlowThread::lastRegion() const return 0; } -void RenderFlowThread::clearRenderObjectCustomStyle(const RenderObject* object, +void RenderFlowThread::clearRenderBoxCustomStyle(const RenderBox* box, const RenderRegion* oldStartRegion, const RenderRegion* oldEndRegion, const RenderRegion* newStartRegion, const RenderRegion* newEndRegion) { @@ -759,7 +759,7 @@ void RenderFlowThread::clearRenderObjectCustomStyle(const RenderObject* object, insideNewRegionRange = true; if (!(insideOldRegionRange && insideNewRegionRange)) - region->clearObjectStyleInRegion(object); + region->clearBoxStyleInRegion(box); if (oldEndRegion == region) insideOldRegionRange = false; @@ -798,7 +798,7 @@ void RenderFlowThread::setRegionRangeForBox(const RenderBox* box, LayoutUnit off break; } - clearRenderObjectCustomStyle(box, range.startRegion(), range.endRegion(), startRegion, endRegion); + clearRenderBoxCustomStyle(box, range.startRegion(), range.endRegion(), startRegion, endRegion); range.setRange(startRegion, endRegion); } diff --git a/Source/WebCore/rendering/RenderFlowThread.h b/Source/WebCore/rendering/RenderFlowThread.h index f596481..4b1b366 100644 --- a/Source/WebCore/rendering/RenderFlowThread.h +++ b/Source/WebCore/rendering/RenderFlowThread.h @@ -124,7 +124,7 @@ public: void setRegionRangeForBox(const RenderBox*, LayoutUnit offsetFromLogicalTopOfFirstPage); void getRegionRangeForBox(const RenderBox*, RenderRegion*& startRegion, RenderRegion*& endRegion) const; - void clearRenderObjectCustomStyle(const RenderObject*, + void clearRenderBoxCustomStyle(const RenderBox*, const RenderRegion* oldStartRegion = 0, const RenderRegion* oldEndRegion = 0, const RenderRegion* newStartRegion = 0, const RenderRegion* newEndRegion = 0); WebKitNamedFlow* ensureNamedFlow(); diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp index 455ef9d..21aa3d3 100644 --- a/Source/WebCore/rendering/RenderLayer.cpp +++ b/Source/WebCore/rendering/RenderLayer.cpp @@ -2590,27 +2590,8 @@ bool RenderLayer::scroll(ScrollDirection direction, ScrollGranularity granularit return ScrollableArea::scroll(direction, granularity, multiplier); } -class CurrentRenderRegionMaintainer { - WTF_MAKE_NONCOPYABLE(CurrentRenderRegionMaintainer); -public: - CurrentRenderRegionMaintainer(RenderView* view, RenderRegion* renderRegion) - : m_view(view) - , m_renderRegion(view->currentRenderRegion()) - { - m_view->setCurrentRenderRegion(renderRegion); - } - ~CurrentRenderRegionMaintainer() - { - m_view->setCurrentRenderRegion(m_renderRegion); - } -private: - RenderView* m_view; - RenderRegion* m_renderRegion; -}; - void RenderLayer::paint(GraphicsContext* context, const LayoutRect& damageRect, PaintBehavior paintBehavior, RenderObject* paintingRoot, RenderRegion* region, PaintLayerFlags paintFlags) { - CurrentRenderRegionMaintainer renderRegionMaintainer(renderer()->view(), region); OverlapTestRequestMap overlapTestRequests; paintLayer(this, context, damageRect, paintBehavior, paintingRoot, region, &overlapTestRequests, paintFlags); OverlapTestRequestMap::iterator end = overlapTestRequests.end(); @@ -3112,7 +3093,6 @@ static inline LayoutRect frameVisibleRect(RenderObject* renderer) bool RenderLayer::hitTest(const HitTestRequest& request, HitTestResult& result) { - CurrentRenderRegionMaintainer renderRegionMaintainer(renderer()->view(), result.region()); renderer()->document()->updateLayout(); LayoutRect hitTestArea = renderer()->view()->documentRect(); diff --git a/Source/WebCore/rendering/RenderObject.cpp b/Source/WebCore/rendering/RenderObject.cpp index f4bd2a1..73d8744 100755 --- a/Source/WebCore/rendering/RenderObject.cpp +++ b/Source/WebCore/rendering/RenderObject.cpp @@ -1713,20 +1713,6 @@ StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff, unsign return diff; } -RenderStyle* RenderObject::styleInRegion() const -{ - ASSERT(inRenderFlowThread()); - - if (!canHaveRegionStyle() - || !((view() && view()->currentRenderRegion() && view()->currentRenderRegion()->hasCustomRegionStyle()))) - return m_style.get(); - - RenderStyle* regionStyle = view()->currentRenderRegion()->renderObjectRegionStyle(this); - if (!regionStyle) - view()->currentRenderRegion()->computeStyleInRegion(this); - return view()->currentRenderRegion()->renderObjectRegionStyle(this); -} - void RenderObject::setStyle(PassRefPtr style) { if (m_style == style) { diff --git a/Source/WebCore/rendering/RenderObject.h b/Source/WebCore/rendering/RenderObject.h index 0b26ea3..1bcda46 100644 --- a/Source/WebCore/rendering/RenderObject.h +++ b/Source/WebCore/rendering/RenderObject.h @@ -674,7 +674,7 @@ public: virtual LayoutUnit minPreferredLogicalWidth() const { return 0; } virtual LayoutUnit maxPreferredLogicalWidth() const { return 0; } - RenderStyle* style() const; + RenderStyle* style() const { return m_style.get(); } RenderStyle* firstLineStyle() const { return document()->usesFirstLineRules() ? firstLineStyleSlowCase() : style(); } RenderStyle* style(bool firstLine) const { return firstLine ? firstLineStyle() : style(); } @@ -879,7 +879,6 @@ protected: virtual LayoutRect outlineBoundsForRepaint(RenderBoxModelObject* /*repaintContainer*/, LayoutPoint* /*cachedOffsetToRepaintContainer*/ = 0) const { return LayoutRect(); } private: - RenderStyle* styleInRegion() const; RenderStyle* firstLineStyleSlowCase() const; StyleDifference adjustStyleDifference(StyleDifference, unsigned contextSensitiveProperties) const; @@ -1108,11 +1107,6 @@ inline bool RenderObject::preservesNewline() const return style()->preserveNewline(); } -inline RenderStyle* RenderObject::style() const -{ - return m_style.get(); -} - inline void makeMatrixRenderable(TransformationMatrix& matrix, bool has3DRendering) { #if !ENABLE(3D_RENDERING) diff --git a/Source/WebCore/rendering/RenderObjectChildList.cpp b/Source/WebCore/rendering/RenderObjectChildList.cpp index 1f176b5..24055bb 100644 --- a/Source/WebCore/rendering/RenderObjectChildList.cpp +++ b/Source/WebCore/rendering/RenderObjectChildList.cpp @@ -117,7 +117,7 @@ RenderObject* RenderObjectChildList::removeChildNode(RenderObject* owner, Render if (oldChild->inRenderFlowThread() && oldChild->isBox()) { oldChild->enclosingRenderFlowThread()->removeRenderBoxRegionInfo(toRenderBox(oldChild)); if (oldChild->canHaveRegionStyle()) - oldChild->enclosingRenderFlowThread()->clearRenderObjectCustomStyle(oldChild); + oldChild->enclosingRenderFlowThread()->clearRenderBoxCustomStyle(toRenderBox(oldChild)); } if (RenderFlowThread* containerFlowThread = renderFlowThreadContainer(owner)) diff --git a/Source/WebCore/rendering/RenderRegion.cpp b/Source/WebCore/rendering/RenderRegion.cpp index 63fec0a..4af8850 100644 --- a/Source/WebCore/rendering/RenderRegion.cpp +++ b/Source/WebCore/rendering/RenderRegion.cpp @@ -47,6 +47,9 @@ RenderRegion::RenderRegion(Node* node, RenderFlowThread* flowThread) , m_parentFlowThread(0) , m_isValid(false) , m_hasCustomRegionStyle(false) +#ifndef NDEBUG + , m_insideRegionPaint(false) +#endif { } @@ -93,12 +96,55 @@ bool RenderRegion::isLastRegion() const return m_flowThread->lastRegion() == this; } +void RenderRegion::setRegionBoxesRegionStyle() +{ + for (RenderBoxRegionInfoMap::iterator iter = m_renderBoxRegionInfo.begin(), end = m_renderBoxRegionInfo.end(); iter != end; ++iter) { + const RenderBox* box = iter->first; + if (!box->canHaveRegionStyle()) + continue; + + // Save original box style to be restored later, after paint. + RefPtr boxOriginalStyle = box->style(); + + // Set the style to be used for box as the style computed in region. + (const_cast(box))->setStyleInternal(renderBoxRegionStyle(box)); + + m_renderBoxRegionStyle.set(box, boxOriginalStyle); + } +} + +void RenderRegion::restoreRegionBoxesOriginalStyle() +{ + for (RenderBoxRegionInfoMap::iterator iter = m_renderBoxRegionInfo.begin(), end = m_renderBoxRegionInfo.end(); iter != end; ++iter) { + const RenderBox* box = iter->first; + RenderBoxRegionStyleMap::iterator it = m_renderBoxRegionStyle.find(box); + if (it == m_renderBoxRegionStyle.end()) + continue; + + // Restore the box style to the original style and store the box style in region for later use. + RefPtr boxRegionStyle = box->style(); + (const_cast(box))->setStyleInternal(it->second); + m_renderBoxRegionStyle.set(box, boxRegionStyle); + } +} + void RenderRegion::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOffset) { // Delegate painting of content in region to RenderFlowThread. if (!m_flowThread || !isValid()) return; + +#ifndef NDEBUG + m_insideRegionPaint = true; +#endif + + setRegionBoxesRegionStyle(); m_flowThread->paintIntoRegion(paintInfo, this, LayoutPoint(paintOffset.x() + borderLeft() + paddingLeft(), paintOffset.y() + borderTop() + paddingTop())); + restoreRegionBoxesOriginalStyle(); + +#ifndef NDEBUG + m_insideRegionPaint = false; +#endif } // Hit Testing @@ -201,6 +247,10 @@ RenderBoxRegionInfo* RenderRegion::setRenderBoxRegionInfo(const RenderBox* box, if (!m_isValid || !m_flowThread) return 0; +#ifndef NDEBUG + ASSERT(!m_insideRegionPaint && "RenderBoxRegionInfo should not be modified inside region paint."); +#endif + OwnPtr& boxInfo = m_renderBoxRegionInfo.add(box, nullptr).first->second; if (boxInfo) *boxInfo = RenderBoxRegionInfo(logicalLeftInset, logicalRightInset, containingBlockChainIsInset); @@ -212,11 +262,19 @@ RenderBoxRegionInfo* RenderRegion::setRenderBoxRegionInfo(const RenderBox* box, PassOwnPtr RenderRegion::takeRenderBoxRegionInfo(const RenderBox* box) { +#ifndef NDEBUG + ASSERT(!m_insideRegionPaint && "RenderBoxRegionInfo should not be modified inside region paint."); +#endif + return m_renderBoxRegionInfo.take(box); } void RenderRegion::removeRenderBoxRegionInfo(const RenderBox* box) { +#ifndef NDEBUG + ASSERT(!m_insideRegionPaint && "RenderBoxRegionInfo should not be modified inside region paint."); +#endif + m_renderBoxRegionInfo.remove(box); } @@ -234,38 +292,42 @@ LayoutUnit RenderRegion::offsetFromLogicalTopOfFirstPage() const return regionRect().x(); } -RenderStyle* RenderRegion::renderObjectRegionStyle(const RenderObject* renderObject) const +PassRefPtr RenderRegion::renderBoxRegionStyle(const RenderBox* renderBox) { - RenderObjectRegionStyleMap::const_iterator it = m_renderObjectRegionStyle.find(renderObject); - return (it != m_renderObjectRegionStyle.end()) ? it->second.get() : 0; + // The box for which we are asking for style in region should have its info present + // in the region box info map. + ASSERT(m_renderBoxRegionInfo.find(renderBox) != m_renderBoxRegionInfo.end()); + + RenderBoxRegionStyleMap::iterator it = m_renderBoxRegionStyle.find(renderBox); + if (it != m_renderBoxRegionStyle.end()) + return it->second; + return computeStyleInRegion(renderBox); } -void RenderRegion::computeStyleInRegion(const RenderObject* object) +PassRefPtr RenderRegion::computeStyleInRegion(const RenderBox* box) { - ASSERT(object); - ASSERT(object->view()); - ASSERT(object->view()->document()); - ASSERT(!object->isAnonymous()); - ASSERT(object->node() && object->node()->isElementNode()); - - Element* element = toElement(object->node()); - RefPtr renderObjectStyle = object->view()->document()->styleSelector()->styleForElement(element, 0, false, false, this); - m_renderObjectRegionStyle.set(object, renderObjectStyle); - - if (!object->hasBoxDecorations()) { - RenderBox* box = const_cast(toRenderBox(object)); - RenderStyle* styleInRegion = renderObjectRegionStyle(object); - ASSERT(styleInRegion); - - bool hasBoxDecorations = object->isTableCell() || styleInRegion->hasBackground() || styleInRegion->hasBorder() || styleInRegion->hasAppearance() || styleInRegion->boxShadow(); - box->setHasBoxDecorations(hasBoxDecorations); + ASSERT(box); + ASSERT(box->view()); + ASSERT(box->view()->document()); + ASSERT(!box->isAnonymous()); + ASSERT(box->node() && box->node()->isElementNode()); + + Element* element = toElement(box->node()); + RefPtr renderBoxRegionStyle = box->view()->document()->styleSelector()->styleForElement(element, 0, false, false, this); + m_renderBoxRegionStyle.add(box, renderBoxRegionStyle); + + if (!box->hasBoxDecorations()) { + bool hasBoxDecorations = box->isTableCell() || renderBoxRegionStyle->hasBackground() || renderBoxRegionStyle->hasBorder() || renderBoxRegionStyle->hasAppearance() || renderBoxRegionStyle->boxShadow(); + (const_cast(box))->setHasBoxDecorations(hasBoxDecorations); } + + return renderBoxRegionStyle.release(); } -void RenderRegion::clearObjectStyleInRegion(const RenderObject* object) +void RenderRegion::clearBoxStyleInRegion(const RenderBox* box) { - ASSERT(object); - m_renderObjectRegionStyle.remove(object); + ASSERT(box); + m_renderBoxRegionStyle.remove(box); } } // namespace WebCore diff --git a/Source/WebCore/rendering/RenderRegion.h b/Source/WebCore/rendering/RenderRegion.h index b6483f1..913c42e 100644 --- a/Source/WebCore/rendering/RenderRegion.h +++ b/Source/WebCore/rendering/RenderRegion.h @@ -80,12 +80,15 @@ public: bool isFirstRegion() const; bool isLastRegion() const; - RenderStyle* renderObjectRegionStyle(const RenderObject*) const; - void computeStyleInRegion(const RenderObject*); - void clearObjectStyleInRegion(const RenderObject*); + void clearBoxStyleInRegion(const RenderBox*); private: virtual const char* renderName() const { return "RenderRegion"; } + PassRefPtr renderBoxRegionStyle(const RenderBox*); + PassRefPtr computeStyleInRegion(const RenderBox*); + void setRegionBoxesRegionStyle(); + void restoreRegionBoxesOriginalStyle(); + RenderFlowThread* m_flowThread; // If this RenderRegion is displayed as part of another flow, @@ -98,15 +101,18 @@ private: // A RenderBoxRegionInfo* tells us about any layout information for a RenderBox that // is unique to the region. For now it just holds logical width information for RenderBlocks, but eventually // it will also hold a custom style for any box (for region styling). - HashMap > m_renderBoxRegionInfo; + typedef HashMap > RenderBoxRegionInfoMap; + RenderBoxRegionInfoMap m_renderBoxRegionInfo; - // This map holds information about the region style associated with the render objects that - // are displayed into this region. - typedef HashMap > RenderObjectRegionStyleMap; - RenderObjectRegionStyleMap m_renderObjectRegionStyle; + typedef HashMap > RenderBoxRegionStyleMap; + RenderBoxRegionStyleMap m_renderBoxRegionStyle; bool m_isValid; bool m_hasCustomRegionStyle; + +#ifndef NDEBUG + bool m_insideRegionPaint; +#endif }; inline RenderRegion* toRenderRegion(RenderObject* object) diff --git a/Source/WebCore/rendering/RenderView.cpp b/Source/WebCore/rendering/RenderView.cpp index c8858c6..e6190ff 100644 --- a/Source/WebCore/rendering/RenderView.cpp +++ b/Source/WebCore/rendering/RenderView.cpp @@ -58,7 +58,6 @@ RenderView::RenderView(Node* node, FrameView* view) , m_layoutState(0) , m_layoutStateDisableCount(0) , m_currentRenderFlowThread(0) - , m_currentRenderRegion(0) { // Clear our anonymous bit, set because RenderObject assumes // any renderer with document as the node is anonymous. diff --git a/Source/WebCore/rendering/RenderView.h b/Source/WebCore/rendering/RenderView.h index 8807434..1eb91ec 100644 --- a/Source/WebCore/rendering/RenderView.h +++ b/Source/WebCore/rendering/RenderView.h @@ -32,7 +32,6 @@ namespace WebCore { class RenderFlowThread; -class RenderRegion; class RenderWidget; #if USE(ACCELERATED_COMPOSITING) @@ -188,9 +187,6 @@ public: RenderFlowThread* currentRenderFlowThread() const { return m_currentRenderFlowThread; } void setCurrentRenderFlowThread(RenderFlowThread* flowThread) { m_currentRenderFlowThread = flowThread; } - RenderRegion* currentRenderRegion() const { return m_currentRenderRegion; } - void setCurrentRenderRegion(RenderRegion* region) { m_currentRenderRegion = region; } - void styleDidChange(StyleDifference, const RenderStyle* oldStyle); IntervalArena* intervalArena(); @@ -281,7 +277,6 @@ private: #endif OwnPtr m_renderFlowThreadList; RenderFlowThread* m_currentRenderFlowThread; - RenderRegion* m_currentRenderRegion; RefPtr m_intervalArena; }; -- 2.7.4