Changeset 96408 in webkit


Ignore:
Timestamp:
Sep 30, 2011 11:18:15 AM (13 years ago)
Author:
hyatt@apple.com
Message:

https://bugs.webkit.org/show_bug.cgi?id=69043

[CSS3 Regions] Blocks split across regions with variable width need to size
differently in each region.

This patch adds the capability for blocks to have variable width and positioning
when split across regions. It is very rudimentary and so far only operates on basic
normal flow RenderBlocks. Future patches will expand the support to cover other layout
constructs like flexible boxes and tables.

Reviewed by Sam Weinig.

Added new tests in fast/regions and updated existing results.

Source/WebCore:

  • WebCore.xcodeproj/project.pbxproj:
  • rendering/HitTestResult.cpp:

(WebCore::HitTestResult::HitTestResult):
(WebCore::HitTestResult::operator=):

  • rendering/HitTestResult.h:

(WebCore::HitTestResult::region):
(WebCore::HitTestResult::setRegion):
The hit test result now holds the active RenderRegion so that hit testing can adjust
block widths and positions when hit testing their border boxes.

  • rendering/PaintInfo.h:

(WebCore::PaintInfo::PaintInfo):
The paint info struct now holds the active RenderRegion so that painting can adjust
block widths and positions when painting borders and backgrounds and shadows.

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::layoutBlock):
If our width ever changes, we invalidate all of our cached RenderBoxRegionInfo in all
regions that we span.

(WebCore::RenderBlock::clearRenderBoxRegionInfo):
Called to clear out our cached region-specific information in all regions that we span.

(WebCore::RenderBlock::borderBoxRectInRegionAtPosition):
Returns the borderBoxRect for the region at the specified vertical offset. This rect
can be both shifted horizontally and have a different width from our original border rect.

(WebCore::RenderBlock::logicalLeftOffsetForContent):
(WebCore::RenderBlock::logicalRightOffsetForContent):
Modified to call borderBoxRectInRegionAtPosition so that lines will fit inside
the content rect of the border box rect for the specific region.

  • rendering/RenderBlock.h:

(WebCore::RenderBlock::logicalRightOffsetForContent):
Modified to call logicalLeftOffsetForContent since it's cleaner.

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::borderBoxRectInRegion):
Called to compute the border box rect in a specific region. The result is cached in a HashMap
in the region itself so that subsequent lookups are fast.

(WebCore::RenderBox::nodeAtPoint):
Modified to use the border box rect in the active region when hit testing the backgrounds of boxes.

(WebCore::RenderBox::paintBoxDecorations):
Modified to use the border box rect in the active region when painting the backgrounds of boxes.

(WebCore::RenderBox::containingBlockLogicalWidthForContent):
(WebCore::RenderBox::containingBlockLogicalWidthForContentInRegion):
(WebCore::RenderBox::computeLogicalWidth):
(WebCore::RenderBox::computeLogicalWidthInRegion):
Helpers for computing logical widths and margins in a specific region. The result is then cached
in a HashMap in the region.

(WebCore::RenderBox::renderBoxRegionInfo):
The function for obtaining the region-specific information for a given box.

  • rendering/RenderBox.h:

(WebCore::RenderBox::borderBoxRectInRegion):
New function for returning the border box rect in a given region.

  • rendering/RenderBoxModelObject.cpp:

(WebCore::RenderBoxModelObject::paintFillLayerExtended):
Make sure mask painting honors the active region.

  • rendering/RenderBoxRegionInfo.h: Added.

(WebCore::RenderBoxRegionInfo::RenderBoxRegionInfo):
(WebCore::RenderBoxRegionInfo::logicalLeft):
(WebCore::RenderBoxRegionInfo::logicalWidth):
(WebCore::RenderBoxRegionInfo::containingBlockChainIsShifted):
New class held by RenderRegions that caches box-specific info for a given region. This will eventually
expand to include custom styles as well, but for now it is limited to a new logical left and a new
logical width, along with a bit for optimizing accumulated shifting when painting/hit testing to avoid
too much groveling up the containing block chain.

  • rendering/RenderFlowThread.cpp:

(WebCore::RenderFlowThread::RenderFlowThread):
Removed the region fitting optimization, since eventually everyone is going to care, and there's no reason
to limit it with the results now being cached.

(WebCore::RenderFlowThread::layout):
All box-specific region information is always cleared whenever the regions are invalidated.

(WebCore::RenderFlowThread::computeLogicalWidth):
Modified to set up RenderBoxRegionInfo for the flow thread in all regions.

(WebCore::RenderFlowThread::paintIntoRegion):
(WebCore::RenderFlowThread::hitTestRegion):
Modified to take the region instead of the region's rectangle so that painting and hit testing of the flow
thread layer tree can properly receive the active region.

(WebCore::RenderFlowThread::removeRenderBoxRegionInfo):
Helper for removing a box's information from all regions. For now it grovels through every region, so eventually
we may want to have a cache of the start/end regions for a given box somewhere.

  • rendering/RenderFlowThread.h:

Removal of the region fitting stuff.

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::paint):
(WebCore::RenderLayer::paintOverlayScrollbars):
(WebCore::RenderLayer::paintLayer):
(WebCore::RenderLayer::paintList):
(WebCore::RenderLayer::paintPaginatedChildLayer):
(WebCore::RenderLayer::paintChildLayerIntoColumns):

  • rendering/RenderLayer.h:
  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::paintIntoLayer):
Modified to pass the current region down through painting functions so that it is known at paint time.

  • rendering/RenderObject.cpp:

(WebCore::RenderObject::RenderObject):
Added a new bit to RenderObjects, inRenderFlowThread(), so that it is quick to determine whether or not an
object needs flow thread special casing.

(WebCore::RenderObject::enclosingRenderFlowThread):
Modified enclosingRenderFlowThread to be able to quickly return 0 if the object is not in a flow thread.

(WebCore::RenderObject::containerForRepaint):
Same.

  • rendering/RenderObject.h:

(WebCore::RenderObject::setParent):
setParent now updates inRenderFlowThread() state.

(WebCore::RenderObject::inRenderFlowThread):
(WebCore::RenderObject::setInRenderFlowThread):
Adding the new bit.

  • rendering/RenderObjectChildList.cpp:

(WebCore::RenderObjectChildList::removeChildNode):
Make sure when an object is removed from a RenderFlowThread that it deletes its box-specific information
in all regions.

  • rendering/RenderRegion.cpp:

(WebCore::RenderRegion::~RenderRegion):
(WebCore::RenderRegion::paintReplaced):
(WebCore::RenderRegion::nodeAtPoint):
(WebCore::RenderRegion::renderBoxRegionInfo):
(WebCore::RenderRegion::setRenderBoxRegionInfo):
(WebCore::RenderRegion::removeRenderBoxRegionInfo):
(WebCore::RenderRegion::deleteAllRenderBoxRegionInfo):
(WebCore::RenderRegion::matchesRenderFlowThreadLogicalWidth):

  • rendering/RenderRegion.h:

Added the new HashMap for holding box-specific region information. Also added an additional optimization to
check if a specific region matches the overall width of the RenderFlowThread. If it does, we don't need to
cache box-specific information for that region.

  • rendering/RenderReplica.cpp:

(WebCore::RenderReplica::paint):

  • rendering/RenderScrollbarPart.cpp:

(WebCore::RenderScrollbarPart::paintIntoRect):

  • rendering/svg/SVGImageBufferTools.cpp:

(WebCore::SVGImageBufferTools::renderSubtreeToImageBuffer):
Modified the PaintInfo construction to include the region argument. It's not optional so that callers will
have to consider it (since masks illustrated this is necessary).

LayoutTests:

  • fast/regions/percentage-margins-variable-width-regions.html: Added.
  • platform/mac/fast/regions/percentage-margins-variable-width-regions-expected.png: Added.
  • platform/mac/fast/regions/percentage-margins-variable-width-regions-expected.txt: Added.
  • platform/mac/fast/regions/webkit-flow-double-pagination-float-push-expected.png:
  • platform/mac/fast/regions/webkit-flow-float-pushed-to-last-region-expected.png:
  • platform/mac/fast/regions/webkit-flow-float-unable-to-push-expected.png:
  • platform/mac/fast/regions/webkit-flow-floats-inside-regions-bounds-expected.png:
  • platform/mac/fast/regions/webkit-flow-inlines-dynamic-expected.png:
  • platform/mac/fast/regions/webkit-flow-inlines-inside-regions-bounds-expected.png:
  • platform/mac/fast/regions/webkit-flow-inlines-inside-regions-bounds-vertical-expected.png:
  • platform/mac/fast/regions/webkit-flow-inlines-inside-regions-bounds-vertical-rl-expected.png:
Location:
trunk
Files:
4 added
32 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r96405 r96408  
     12011-09-29  David Hyatt  <hyatt@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=69043
     4       
     5        [CSS3 Regions] Blocks split across regions with variable width need to size
     6        differently in each region.
     7       
     8        This patch adds the capability for blocks to have variable width and positioning
     9        when split across regions. It is very rudimentary and so far only operates on basic
     10        normal flow RenderBlocks. Future patches will expand the support to cover other layout
     11        constructs like flexible boxes and tables.
     12
     13        Reviewed by Sam Weinig.
     14
     15        Added new tests in fast/regions and updated existing results.
     16
     17        * fast/regions/percentage-margins-variable-width-regions.html: Added.
     18        * platform/mac/fast/regions/percentage-margins-variable-width-regions-expected.png: Added.
     19        * platform/mac/fast/regions/percentage-margins-variable-width-regions-expected.txt: Added.
     20        * platform/mac/fast/regions/webkit-flow-double-pagination-float-push-expected.png:
     21        * platform/mac/fast/regions/webkit-flow-float-pushed-to-last-region-expected.png:
     22        * platform/mac/fast/regions/webkit-flow-float-unable-to-push-expected.png:
     23        * platform/mac/fast/regions/webkit-flow-floats-inside-regions-bounds-expected.png:
     24        * platform/mac/fast/regions/webkit-flow-inlines-dynamic-expected.png:
     25        * platform/mac/fast/regions/webkit-flow-inlines-inside-regions-bounds-expected.png:
     26        * platform/mac/fast/regions/webkit-flow-inlines-inside-regions-bounds-vertical-expected.png:
     27        * platform/mac/fast/regions/webkit-flow-inlines-inside-regions-bounds-vertical-rl-expected.png:
     28
    1292011-09-30  Qi Zhang  <qi.2.zhang@nokia.com>
    230
  • trunk/Source/WebCore/ChangeLog

    r96407 r96408  
     12011-09-29  David Hyatt  <hyatt@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=69043
     4       
     5        [CSS3 Regions] Blocks split across regions with variable width need to size
     6        differently in each region.
     7       
     8        This patch adds the capability for blocks to have variable width and positioning
     9        when split across regions. It is very rudimentary and so far only operates on basic
     10        normal flow RenderBlocks. Future patches will expand the support to cover other layout
     11        constructs like flexible boxes and tables.
     12
     13        Reviewed by Sam Weinig.
     14
     15        Added new tests in fast/regions and updated existing results.
     16
     17        * WebCore.xcodeproj/project.pbxproj:
     18        * rendering/HitTestResult.cpp:
     19        (WebCore::HitTestResult::HitTestResult):
     20        (WebCore::HitTestResult::operator=):
     21        * rendering/HitTestResult.h:
     22        (WebCore::HitTestResult::region):
     23        (WebCore::HitTestResult::setRegion):
     24        The hit test result now holds the active RenderRegion so that hit testing can adjust
     25        block widths and positions when hit testing their border boxes.
     26
     27        * rendering/PaintInfo.h:
     28        (WebCore::PaintInfo::PaintInfo):
     29        The paint info struct now holds the active RenderRegion so that painting can adjust
     30        block widths and positions when painting borders and backgrounds and shadows.
     31
     32        * rendering/RenderBlock.cpp:
     33        (WebCore::RenderBlock::layoutBlock):
     34        If our width ever changes, we invalidate all of our cached RenderBoxRegionInfo in all
     35        regions that we span.
     36
     37        (WebCore::RenderBlock::clearRenderBoxRegionInfo):
     38        Called to clear out our cached region-specific information in all regions that we span.
     39
     40        (WebCore::RenderBlock::borderBoxRectInRegionAtPosition):
     41        Returns the borderBoxRect for the region at the specified vertical offset. This rect
     42        can be both shifted horizontally and have a different width from our original border rect.
     43
     44        (WebCore::RenderBlock::logicalLeftOffsetForContent):
     45        (WebCore::RenderBlock::logicalRightOffsetForContent):
     46        Modified to call borderBoxRectInRegionAtPosition so that lines will fit inside
     47        the content rect of the border box rect for the specific region.
     48
     49        * rendering/RenderBlock.h:
     50        (WebCore::RenderBlock::logicalRightOffsetForContent):
     51        Modified to call logicalLeftOffsetForContent since it's cleaner.
     52
     53        * rendering/RenderBox.cpp:
     54        (WebCore::RenderBox::borderBoxRectInRegion):
     55        Called to compute the border box rect in a specific region. The result is cached in a HashMap
     56        in the region itself so that subsequent lookups are fast.
     57
     58        (WebCore::RenderBox::nodeAtPoint):
     59        Modified to use the border box rect in the active region when hit testing the backgrounds of boxes.
     60
     61        (WebCore::RenderBox::paintBoxDecorations):
     62        Modified to use the border box rect in the active region when painting the backgrounds of boxes.
     63
     64        (WebCore::RenderBox::containingBlockLogicalWidthForContent):
     65        (WebCore::RenderBox::containingBlockLogicalWidthForContentInRegion):
     66        (WebCore::RenderBox::computeLogicalWidth):
     67        (WebCore::RenderBox::computeLogicalWidthInRegion):
     68        Helpers for computing logical widths and margins in a specific region. The result is then cached
     69        in a HashMap in the region.
     70
     71        (WebCore::RenderBox::renderBoxRegionInfo):
     72        The function for obtaining the region-specific information for a given box.
     73
     74        * rendering/RenderBox.h:
     75        (WebCore::RenderBox::borderBoxRectInRegion):
     76        New function for returning the border box rect in a given region.
     77
     78        * rendering/RenderBoxModelObject.cpp:
     79        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
     80        Make sure mask painting honors the active region.
     81
     82        * rendering/RenderBoxRegionInfo.h: Added.
     83        (WebCore::RenderBoxRegionInfo::RenderBoxRegionInfo):
     84        (WebCore::RenderBoxRegionInfo::logicalLeft):
     85        (WebCore::RenderBoxRegionInfo::logicalWidth):
     86        (WebCore::RenderBoxRegionInfo::containingBlockChainIsShifted):
     87        New class held by RenderRegions that caches box-specific info for a given region. This will eventually
     88        expand to include custom styles as well, but for now it is limited to a new logical left and a new
     89        logical width, along with a bit for optimizing accumulated shifting when painting/hit testing to avoid
     90        too much groveling up the containing block chain.
     91
     92        * rendering/RenderFlowThread.cpp:
     93        (WebCore::RenderFlowThread::RenderFlowThread):
     94        Removed the region fitting optimization, since eventually everyone is going to care, and there's no reason
     95        to limit it with the results now being cached.
     96
     97        (WebCore::RenderFlowThread::layout):
     98        All box-specific region information is always cleared whenever the regions are invalidated.
     99
     100        (WebCore::RenderFlowThread::computeLogicalWidth):
     101        Modified to set up RenderBoxRegionInfo for the flow thread in all regions.
     102       
     103        (WebCore::RenderFlowThread::paintIntoRegion):
     104        (WebCore::RenderFlowThread::hitTestRegion):
     105        Modified to take the region instead of the region's rectangle so that painting and hit testing of the flow
     106        thread layer tree can properly receive the active region.
     107
     108        (WebCore::RenderFlowThread::removeRenderBoxRegionInfo):
     109        Helper for removing a box's information from all regions. For now it grovels through every region, so eventually
     110        we may want to have a cache of the start/end regions for a given box somewhere.
     111
     112        * rendering/RenderFlowThread.h:
     113        Removal of the region fitting stuff.
     114
     115        * rendering/RenderLayer.cpp:
     116        (WebCore::RenderLayer::paint):
     117        (WebCore::RenderLayer::paintOverlayScrollbars):
     118        (WebCore::RenderLayer::paintLayer):
     119        (WebCore::RenderLayer::paintList):
     120        (WebCore::RenderLayer::paintPaginatedChildLayer):
     121        (WebCore::RenderLayer::paintChildLayerIntoColumns):
     122        * rendering/RenderLayer.h:
     123        * rendering/RenderLayerBacking.cpp:
     124        (WebCore::RenderLayerBacking::paintIntoLayer):
     125        Modified to pass the current region down through painting functions so that it is known at paint time.
     126
     127        * rendering/RenderObject.cpp:
     128        (WebCore::RenderObject::RenderObject):
     129        Added a new bit to RenderObjects, inRenderFlowThread(), so that it is quick to determine whether or not an
     130        object needs flow thread special casing.
     131
     132        (WebCore::RenderObject::enclosingRenderFlowThread):
     133        Modified enclosingRenderFlowThread to be able to quickly return 0 if the object is not in a flow thread.
     134
     135        (WebCore::RenderObject::containerForRepaint):
     136        Same.
     137
     138        * rendering/RenderObject.h:
     139        (WebCore::RenderObject::setParent):
     140        setParent now updates inRenderFlowThread() state.
     141
     142        (WebCore::RenderObject::inRenderFlowThread):
     143        (WebCore::RenderObject::setInRenderFlowThread):
     144        Adding the new bit.
     145
     146        * rendering/RenderObjectChildList.cpp:
     147        (WebCore::RenderObjectChildList::removeChildNode):
     148        Make sure when an object is removed from a RenderFlowThread that it deletes its box-specific information
     149        in all regions.
     150
     151        * rendering/RenderRegion.cpp:
     152        (WebCore::RenderRegion::~RenderRegion):
     153        (WebCore::RenderRegion::paintReplaced):
     154        (WebCore::RenderRegion::nodeAtPoint):
     155        (WebCore::RenderRegion::renderBoxRegionInfo):
     156        (WebCore::RenderRegion::setRenderBoxRegionInfo):
     157        (WebCore::RenderRegion::removeRenderBoxRegionInfo):
     158        (WebCore::RenderRegion::deleteAllRenderBoxRegionInfo):
     159        (WebCore::RenderRegion::matchesRenderFlowThreadLogicalWidth):
     160        * rendering/RenderRegion.h:
     161        Added the new HashMap for holding box-specific region information. Also added an additional optimization to
     162        check if a specific region matches the overall width of the RenderFlowThread. If it does, we don't need to
     163        cache box-specific information for that region.
     164
     165        * rendering/RenderReplica.cpp:
     166        (WebCore::RenderReplica::paint):
     167        * rendering/RenderScrollbarPart.cpp:
     168        (WebCore::RenderScrollbarPart::paintIntoRect):
     169        * rendering/svg/SVGImageBufferTools.cpp:
     170        (WebCore::SVGImageBufferTools::renderSubtreeToImageBuffer):
     171        Modified the PaintInfo construction to include the region argument. It's not optional so that callers will
     172        have to consider it (since masks illustrated this is necessary).
     173
    11742011-09-30  Tim Horton  <timothy_horton@apple.com>
    2175
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r96215 r96408  
    53305330                BCEA488D097D93020094C9E4 /* RenderTextFragment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA484E097D93020094C9E4 /* RenderTextFragment.cpp */; };
    53315331                BCEA488E097D93020094C9E4 /* RenderTextFragment.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA484F097D93020094C9E4 /* RenderTextFragment.h */; };
     5332                BCEB179C143379F50052EAE9 /* RenderBoxRegionInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEB179B143379F50052EAE9 /* RenderBoxRegionInfo.h */; };
    53325333                BCEC01BD0C274DAC009F4EC9 /* Screen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEC01BA0C274DAC009F4EC9 /* Screen.cpp */; };
    53335334                BCEC01BE0C274DAC009F4EC9 /* Screen.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEC01BB0C274DAC009F4EC9 /* Screen.h */; };
     
    1209112092                BCEA484E097D93020094C9E4 /* RenderTextFragment.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTextFragment.cpp; sourceTree = "<group>"; };
    1209212093                BCEA484F097D93020094C9E4 /* RenderTextFragment.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderTextFragment.h; sourceTree = "<group>"; };
     12094                BCEB179B143379F50052EAE9 /* RenderBoxRegionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderBoxRegionInfo.h; sourceTree = "<group>"; };
    1209312095                BCEC01BA0C274DAC009F4EC9 /* Screen.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Screen.cpp; sourceTree = "<group>"; };
    1209412096                BCEC01BB0C274DAC009F4EC9 /* Screen.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Screen.h; sourceTree = "<group>"; };
     
    1970719709                                BC96DB450F3A882200573CB3 /* RenderBoxModelObject.cpp */,
    1970819710                                BC96DB420F3A880E00573CB3 /* RenderBoxModelObject.h */,
     19711                                BCEB179B143379F50052EAE9 /* RenderBoxRegionInfo.h */,
    1970919712                                BCEA4824097D93020094C9E4 /* RenderBR.cpp */,
    1971019713                                BCEA4825097D93020094C9E4 /* RenderBR.h */,
     
    2354423547                                CECCFC3B141973D5002A0AC1 /* DecodeEscapeSequences.h in Headers */,
    2354523548                                0FE71406142170B800DB33BA /* ScrollbarThemeMock.h in Headers */,
     23549                                BCEB179C143379F50052EAE9 /* RenderBoxRegionInfo.h in Headers */,
    2354623550                                59102FBC14327D3B003C9D04 /* ContentSearchUtils.h in Headers */,
    2354723551                        );
  • trunk/Source/WebCore/rendering/HitTestResult.cpp

    r94427 r96408  
    5454    , m_bottomPadding(0)
    5555    , m_leftPadding(0)
     56    , m_region(0)
    5657{
    5758}
     
    6566    , m_bottomPadding(0)
    6667    , m_leftPadding(0)
     68    , m_region(0)
    6769{
    6870}
     
    7577    , m_bottomPadding(bottomPadding)
    7678    , m_leftPadding(leftPadding)
     79    , m_region(0)
    7780{
    7881    // If all padding values passed in are zero then it is not a rect based hit test.
     
    9295    , m_scrollbar(other.scrollbar())
    9396    , m_isOverWidget(other.isOverWidget())
     97    , m_region(other.region())
    9498{
    9599    // Only copy the padding and NodeSet in case of rect hit test.
     
    130134
    131135    m_rectBasedTestResult = adoptPtr(other.m_rectBasedTestResult ? new NodeSet(*other.m_rectBasedTestResult) : 0);
     136   
     137    m_region = other.m_region;
     138
    132139    return *this;
    133140}
  • trunk/Source/WebCore/rendering/HitTestResult.h

    r93014 r96408  
    3939class KURL;
    4040class Node;
     41class RenderRegion;
    4142class Scrollbar;
    4243
     
    6061    Scrollbar* scrollbar() const { return m_scrollbar.get(); }
    6162    bool isOverWidget() const { return m_isOverWidget; }
     63
     64    RenderRegion* region() const { return m_region; }
     65    void setRegion(RenderRegion* region) { m_region = region; }
    6266
    6367    void setToNonShadowAncestor();
     
    140144    int m_bottomPadding;
    141145    int m_leftPadding;
     146   
     147    RenderRegion* m_region; // The region we're inside.
     148
    142149    mutable OwnPtr<NodeSet> m_rectBasedTestResult;
    143150};
  • trunk/Source/WebCore/rendering/PaintInfo.h

    r95901 r96408  
    4242class RenderInline;
    4343class RenderObject;
     44class RenderRegion;
    4445
    4546typedef HashMap<OverlapTestRequestClient*, IntRect> OverlapTestRequestMap;
     
    5152struct PaintInfo {
    5253    PaintInfo(GraphicsContext* newContext, const IntRect& newRect, PaintPhase newPhase, bool newForceBlackText,
    53               RenderObject* newPaintingRoot, ListHashSet<RenderInline*>* newOutlineObjects,
     54              RenderObject* newPaintingRoot, RenderRegion* region, ListHashSet<RenderInline*>* newOutlineObjects,
    5455              OverlapTestRequestMap* overlapTestRequests = 0)
    5556        : context(newContext)
     
    5859        , forceBlackText(newForceBlackText)
    5960        , paintingRoot(newPaintingRoot)
     61        , renderRegion(region)
    6062        , outlineObjects(newOutlineObjects)
    6163        , overlapTestRequests(overlapTestRequests)
     
    103105    bool forceBlackText;
    104106    RenderObject* paintingRoot; // used to draw just one element and its visual kids
     107    RenderRegion* renderRegion;
    105108    ListHashSet<RenderInline*>* outlineObjects; // used to list outlines that should be painted by a block with inline children
    106109    OverlapTestRequestMap* overlapTestRequests;
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r96294 r96408  
    4141#include "Page.h"
    4242#include "PaintInfo.h"
     43#include "RenderBoxRegionInfo.h"
    4344#include "RenderCombineText.h"
    4445#include "RenderDeprecatedFlexibleBox.h"
     
    4849#include "RenderLayer.h"
    4950#include "RenderMarquee.h"
     51#include "RenderRegion.h"
    5052#include "RenderReplica.h"
    5153#include "RenderTableCell.h"
     
    11801182    m_overflow.clear();
    11811183
    1182     if (oldWidth != logicalWidth() || oldColumnWidth != desiredColumnWidth())
     1184    if (oldWidth != logicalWidth() || oldColumnWidth != desiredColumnWidth()) {
    11831185        relayoutChildren = true;
     1186        clearRenderBoxRegionInfo(); // Clear out any cached values we have in all regions.
     1187    }
    11841188
    11851189    // If nothing changed about our floating positioned objects, let's go ahead and try to place them as
     
    12181222    RenderView* renderView = view();
    12191223    LayoutStateMaintainer statePusher(renderView, this, locationOffset(), hasColumns() || hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode(), pageLogicalHeight, pageLogicalHeightChanged, colInfo);
    1220 
    1221     bool disableRegionFitting = renderView->hasRenderFlowThread() && (renderView->currentRenderFlowThread()->regionsHaveUniformLogicalWidth()
    1222         || hasColumns() || (isPositioned() && !isRenderFlowThread()) || isFloating());
    1223     RegionFittingDisabler regionFittingDisabler(renderView->currentRenderFlowThread(), disableRegionFitting);
    12241224
    12251225    // We use four values, maxTopPos, maxTopNeg, maxBottomPos, and maxBottomNeg, to track
     
    35293529}
    35303530
    3531 void RenderBlock::adjustForRegionFittingIfNeeded(LayoutUnit logicalTop, LayoutUnit& rightOffset) const
     3531void RenderBlock::clearRenderBoxRegionInfo()
    35323532{
    35333533    RenderView* renderView = view();
    3534     if (!renderView->hasRenderFlowThread())
     3534    if (!renderView->hasRenderFlowThread() || isRenderFlowThread())
    35353535        return;
    3536    
     3536
    35373537    RenderFlowThread* flowThread = renderView->currentRenderFlowThread();
    3538     if (!flowThread->isRegionFittingEnabled() || !flowThread->hasValidRegions())
     3538    if (!flowThread->hasValidRegions() || flowThread->regionsHaveUniformLogicalWidth())
    35393539        return;
    35403540
    3541     LayoutUnit regionWidth = flowThread->regionLogicalWidthForLine(logicalPageOffset() + logicalTop);
    3542     rightOffset -= flowThread->logicalWidth() - regionWidth;
    3543 }
    3544 
    3545 LayoutUnit RenderBlock::logicalLeftOffsetForContent(LayoutUnit) const
    3546 {
    3547     // FIXME: For now we don't adjust this at all. Eventually when we have RTL blocks or centered blocks, where the left offset
    3548     // can shift, then we will have to make an adjustment.
    3549     return logicalLeftOffsetForContent();
     3541    flowThread->removeRenderBoxRegionInfo(this);
     3542}
     3543
     3544LayoutRect RenderBlock::borderBoxRectInRegionAtPosition(LayoutUnit logicalTop) const
     3545{
     3546    ASSERT(inRenderFlowThread());
     3547
     3548    // FIXME: It's a limitation that we're dependent on layout state in order to give back
     3549    // the right answer. For example, selection operates outside of layout and is not doing
     3550    // the right thing here.
     3551    RenderFlowThread* flowThread = view()->currentRenderFlowThread();
     3552    if (!flowThread || !flowThread->hasValidRegions() || flowThread->regionsHaveUniformLogicalWidth())
     3553        return borderBoxRect();
     3554
     3555    RenderRegion* region = flowThread->renderRegionForLine(logicalPageOffset() + logicalTop, true);
     3556    if (!region || region->matchesRenderFlowThreadLogicalWidth())
     3557        return borderBoxRect();
     3558   
     3559    return borderBoxRectInRegion(region);
     3560}
     3561
     3562LayoutUnit RenderBlock::logicalLeftOffsetForContent(LayoutUnit position) const
     3563{
     3564    LayoutUnit logicalLeftOffset = logicalLeftOffsetForContent();
     3565    if (!inRenderFlowThread())
     3566        return logicalLeftOffset;
     3567    LayoutRect boxRect = borderBoxRectInRegionAtPosition(position);
     3568    return logicalLeftOffset + (isHorizontalWritingMode() ? boxRect.x() : boxRect.y());
    35503569}
    35513570
     
    35533572{
    35543573    LayoutUnit logicalRightOffset = logicalRightOffsetForContent();
    3555     adjustForRegionFittingIfNeeded(position, logicalRightOffset);
    3556     return logicalRightOffset;
     3574    if (!inRenderFlowThread())
     3575        return logicalRightOffset;
     3576    LayoutRect boxRect = borderBoxRectInRegionAtPosition(position);
     3577    return logicalLeftOffsetForContent(position) + availableLogicalWidth() - (logicalWidth() - (isHorizontalWritingMode() ? boxRect.width() : boxRect.height()));
    35573578}
    35583579
  • trunk/Source/WebCore/rendering/RenderBlock.h

    r96149 r96408  
    258258    virtual void scrollbarsChanged(bool /*horizontalScrollbarChanged*/, bool /*verticalScrollbarChanged*/) { };
    259259
    260     LayoutUnit logicalRightOffsetForContent() const { return isHorizontalWritingMode() ? borderLeft() + paddingLeft() + availableLogicalWidth() : borderTop() + paddingTop() + availableLogicalWidth(); }
     260    LayoutUnit logicalRightOffsetForContent() const { return logicalLeftOffsetForContent() + availableLogicalWidth(); }
    261261    LayoutUnit logicalLeftOffsetForContent() const { return isHorizontalWritingMode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); }
    262262
     
    320320    virtual void paintObject(PaintInfo&, const LayoutPoint&);
    321321
    322     void adjustForRegionFittingIfNeeded(LayoutUnit logicalTop, LayoutUnit& rightOffset) const;
    323 
     322    LayoutRect borderBoxRectInRegionAtPosition(LayoutUnit logicalTop) const;
     323    void clearRenderBoxRegionInfo();
     324   
    324325    LayoutUnit logicalRightOffsetForLine(LayoutUnit position, LayoutUnit fixedOffset, bool applyTextIndent = true, LayoutUnit* logicalHeightRemaining = 0) const;
    325326    LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, LayoutUnit fixedOffset, bool applyTextIndent = true, LayoutUnit* logicalHeightRemaining = 0) const;
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r96157 r96408  
    4242#include "PaintInfo.h"
    4343#include "RenderArena.h"
     44#include "RenderBoxRegionInfo.h"
    4445#include "RenderFlowThread.h"
    4546#include "RenderInline.h"
     
    195196        break;
    196197    }
     198}
     199
     200LayoutRect RenderBox::borderBoxRectInRegion(RenderRegion* region) const
     201{
     202    if (!region || region->matchesRenderFlowThreadLogicalWidth())
     203        return borderBoxRect();
     204   
     205    // Compute the logical width and placement in this region.
     206    RenderBoxRegionInfo* boxInfo = renderBoxRegionInfo(region);
     207    if (!boxInfo)
     208        return borderBoxRect();
     209
     210    // We have cached insets.
     211    LayoutUnit logicalWidth = boxInfo->logicalWidth();
     212    LayoutUnit logicalLeft = boxInfo->logicalLeft();
     213       
     214    // Now apply the parent left inset since it is cumulative whenever anything in the containing block chain shifts.
     215    const RenderBox* currentBox = this;
     216    while (boxInfo->containingBlockChainIsShifted()) {
     217        currentBox = currentBox->containingBlock();
     218        boxInfo = currentBox->renderBoxRegionInfo(region);
     219        if (!boxInfo)
     220            break;
     221        logicalLeft += boxInfo->logicalLeft();
     222    }
     223   
     224    if (isHorizontalWritingMode())
     225        return LayoutRect(logicalLeft, 0, logicalWidth, height());
     226    return LayoutRect(0, logicalLeft, width(), logicalWidth);
    197227}
    198228
     
    781811    // Check our bounds next. For this purpose always assume that we can only be hit in the
    782812    // foreground phase (which is true for replaced elements like images).
    783     LayoutRect boundsRect(adjustedLocation, size());
     813    LayoutRect boundsRect = borderBoxRectInRegion(result.region());
     814    boundsRect.moveBy(adjustedLocation);
    784815    if (visibleToHitTesting() && action == HitTestForeground && boundsRect.intersects(result.rectForPoint(pointInContainer))) {
    785816        updateHitTestResult(result, pointInContainer - toLayoutSize(adjustedLocation));
     
    853884    if (!paintInfo.shouldPaintWithinRoot(this))
    854885        return;
    855     LayoutRect paintRect(paintOffset, size());
     886
     887    LayoutRect paintRect = borderBoxRectInRegion(paintInfo.renderRegion);
     888    paintRect.moveBy(paintOffset);
    856889
    857890    // border-fit can adjust where we paint our border and background.  If set, we snugly fit our line box descendants.  (The iChat
     
    12211254    RenderBlock* cb = containingBlock();
    12221255    if (shrinkToAvoidFloats())
    1223         return cb->availableLogicalWidthForLine(y(), false);
     1256        return cb->availableLogicalWidthForLine(logicalTop(), false);
    12241257    return cb->availableLogicalWidth();
     1258}
     1259
     1260LayoutUnit RenderBox::containingBlockLogicalWidthForContentInRegion(RenderRegion* region) const
     1261{
     1262    LayoutUnit result = containingBlockLogicalWidthForContent();
     1263    RenderBlock* cb = containingBlock();
     1264    RenderBoxRegionInfo* boxInfo = cb->renderBoxRegionInfo(region);
     1265    if (!boxInfo)
     1266        return result;
     1267    return max(0, result - (cb->logicalWidth() - boxInfo->logicalWidth()));
    12251268}
    12261269
     
    16051648    }
    16061649
     1650    computeLogicalWidthInRegion(0);
     1651}
     1652
     1653void RenderBox::computeLogicalWidthInRegion(RenderRegion* region)
     1654{
    16071655    // FIXME: Account for block-flow in flexible boxes.
    16081656    // https://bugs.webkit.org/show_bug.cgi?id=46418
     
    16141662
    16151663    RenderBlock* cb = containingBlock();
    1616     LayoutUnit containerLogicalWidth = max<LayoutUnit>(0, containingBlockLogicalWidthForContent());
     1664    LayoutUnit containerLogicalWidth = max<LayoutUnit>(0, containingBlockLogicalWidthForContentInRegion(region));
    16171665    bool hasPerpendicularContainingBlock = cb->isHorizontalWritingMode() != isHorizontalWritingMode();
    16181666    LayoutUnit containerWidthInInlineDirection = containerLogicalWidth;
     
    17821830    containingBlock->setMarginStartForChild(this, marginStartLength.calcMinValue(containerWidth));
    17831831    containingBlock->setMarginEndForChild(this, marginEndLength.calcMinValue(containerWidth));
     1832}
     1833
     1834RenderBoxRegionInfo* RenderBox::renderBoxRegionInfo(RenderRegion* region) const
     1835{
     1836    // Make sure nobody is trying to call this with a null region.
     1837    if (!region)
     1838        return 0;
     1839
     1840    // If we have computed our width in this region already, it will be cached, and we can
     1841    // just return it.
     1842    RenderBoxRegionInfo* boxInfo = region->renderBoxRegionInfo(this);
     1843    if (boxInfo)
     1844        return boxInfo;
     1845
     1846    // No cached value was found, so we have to compute our insets in this region.
     1847    // FIXME: For now we limit this computation to normal RenderBlocks. Future patches will expand
     1848    // support to cover all boxes.
     1849    if (!inRenderFlowThread() || (isPositioned() && !isRenderFlowThread()) || isReplaced() || isInline() || hasColumns()
     1850        || isTableCell() || !isBlockFlow())
     1851        return 0;
     1852
     1853    // FIXME: It's gross to cast away the const, but it would be a huge refactoring to
     1854    // change all width computation to avoid updating any member variables, and it would be pretty lame to
     1855    // make all the variables mutable as well.
     1856    // FIXME: Perpendicular writing modes aren't going to work right here.
     1857    LayoutUnit oldLogicalWidth = logicalWidth();
     1858    LayoutUnit oldMarginStart = marginStart();
     1859    LayoutUnit oldMarginEnd = marginEnd();
     1860
     1861    RenderBox* mutableBox = const_cast<RenderBox*>(this);
     1862    mutableBox->computeLogicalWidthInRegion(region);
     1863
     1864    // Now determine the insets based off where this object is supposed to be positioned.
     1865    LayoutUnit startMarginDelta = marginStart() - oldMarginStart;
     1866    LayoutUnit widthDelta = logicalWidth() - oldLogicalWidth;
     1867    LayoutUnit logicalWidthInRegion = logicalWidth();
     1868
     1869    LayoutUnit logicalLeftOffset = 0;
     1870    RenderBlock* cb = containingBlock();
     1871    if (cb->style()->isLeftToRightDirection())
     1872        logicalLeftOffset += startMarginDelta;
     1873    else
     1874        logicalLeftOffset += widthDelta - startMarginDelta;
     1875   
     1876    // Set our values back.
     1877    mutableBox->setLogicalWidth(oldLogicalWidth);
     1878    mutableBox->setMarginStart(oldMarginStart);
     1879    mutableBox->setMarginEnd(oldMarginEnd);
     1880
     1881    RenderBoxRegionInfo* containingBlockInfo = cb->renderBoxRegionInfo(region);
     1882    bool containingBlockChainIsShifted = containingBlockInfo && (containingBlockInfo->containingBlockChainIsShifted()
     1883        || containingBlockInfo->logicalLeft());
     1884       
     1885    // FIXME: Although it's unlikely, these boxes can go outside our bounds, and so we will need to incorporate them into overflow.
     1886    return region->setRenderBoxRegionInfo(this, logicalLeftOffset, logicalWidthInRegion, containingBlockChainIsShifted);
    17841887}
    17851888
  • trunk/Source/WebCore/rendering/RenderBox.h

    r96157 r96408  
    3030namespace WebCore {
    3131
     32class RenderBoxRegionInfo;
     33class RenderRegion;
    3234struct PaintInfo;
    3335
     
    272274    void computeBlockDirectionMargins(RenderBlock* containingBlock);
    273275
     276    LayoutRect borderBoxRectInRegion(RenderRegion*) const;
     277
    274278    void positionLineBox(InlineBox*);
    275279
     
    290294
    291295    virtual LayoutUnit containingBlockLogicalWidthForContent() const;
     296    LayoutUnit containingBlockLogicalWidthForContentInRegion(RenderRegion*) const;
    292297    LayoutUnit perpendicularContainingBlockLogicalHeight() const;
    293298   
    294299    virtual void computeLogicalWidth();
    295300    virtual void computeLogicalHeight();
     301
     302    RenderBoxRegionInfo* renderBoxRegionInfo(RenderRegion*) const;
     303    void computeLogicalWidthInRegion(RenderRegion*);
    296304
    297305    bool stretchesToViewport() const
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r96152 r96408  
    715715        // Now add the text to the clip.  We do this by painting using a special paint phase that signals to
    716716        // InlineTextBoxes that they should just add their contents to the clip.
    717         PaintInfo info(maskImageContext, maskRect, PaintPhaseTextClip, true, 0, 0);
     717        PaintInfo info(maskImageContext, maskRect, PaintPhaseTextClip, true, 0, paintInfo.renderRegion, 0);
    718718        if (box) {
    719719            RootInlineBox* root = box->root();
  • trunk/Source/WebCore/rendering/RenderFlowThread.cpp

    r95901 r96408  
    5050    , m_regionsHaveUniformLogicalWidth(true)
    5151    , m_regionsHaveUniformLogicalHeight(true)
    52     , m_regionFittingDisableCount(0)
    5352{
    5453    setIsAnonymous(false);
     54    setInRenderFlowThread();
    5555}
    5656
     
    321321                ASSERT(!region->needsLayout());
    322322               
     323                region->deleteAllRenderBoxRegionInfo();
     324
    323325                LayoutUnit regionLogicalWidth;
    324326                LayoutUnit regionLogicalHeight;
     
    361363void RenderFlowThread::computeLogicalWidth()
    362364{
    363     int logicalWidth = 0;
    364 
     365    LayoutUnit oldLogicalWidth = logicalWidth();
     366
     367    LayoutUnit logicalWidth = 0;
    365368    for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
    366369        RenderRegion* region = *iter;
     
    370373        logicalWidth = max(isHorizontalWritingMode() ? region->contentWidth() : region->contentHeight(), logicalWidth);
    371374    }
    372 
    373375    setLogicalWidth(logicalWidth);
    374 }
    375 
    376 void RenderFlowThread::computeLogicalHeight()
    377 {
    378     int logicalHeight = 0;
    379 
     376   
     377    if (regionsHaveUniformLogicalWidth() || oldLogicalWidth == logicalWidth)
     378        return;
     379   
     380    // If the regions have non-uniform logical widths, then insert inset information for the RenderFlowThread.
    380381    for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
    381382        RenderRegion* region = *iter;
    382383        if (!region->isValid())
    383384            continue;
     385       
     386        LayoutUnit regionLogicalWidth = isHorizontalWritingMode() ? region->contentWidth() : region->contentHeight();
     387        if (regionLogicalWidth != logicalWidth) {
     388            LayoutUnit logicalLeft = style()->direction() == LTR ? 0 : logicalWidth - regionLogicalWidth;
     389            region->setRenderBoxRegionInfo(this, logicalLeft, regionLogicalWidth, false);
     390        }
     391    }
     392}
     393
     394void RenderFlowThread::computeLogicalHeight()
     395{
     396    int logicalHeight = 0;
     397
     398    for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
     399        RenderRegion* region = *iter;
     400        if (!region->isValid())
     401            continue;
    384402        ASSERT(!region->needsLayout());
    385403        logicalHeight += isHorizontalWritingMode() ? region->contentHeight() : region->contentWidth();
     
    389407}
    390408
    391 void RenderFlowThread::paintIntoRegion(PaintInfo& paintInfo, const LayoutRect& regionRect, const LayoutPoint& paintOffset)
     409void RenderFlowThread::paintIntoRegion(PaintInfo& paintInfo, RenderRegion* region, const LayoutPoint& paintOffset)
    392410{
    393411    GraphicsContext* context = paintInfo.context;
     
    398416    // paintOffset contains the offset where the painting should occur
    399417    // adjusted with the region padding and border.
     418    LayoutRect regionRect(region->regionRect());
    400419    LayoutRect regionClippingRect(paintOffset, regionRect.size());
    401420
     
    422441        info.rect.moveBy(-renderFlowThreadOffset);
    423442       
    424         layer()->paint(context, info.rect);
     443        layer()->paint(context, info.rect, 0, 0, region);
    425444
    426445        context->restore();
     
    428447}
    429448
    430 bool RenderFlowThread::hitTestRegion(const LayoutRect& regionRect, const HitTestRequest& request, HitTestResult& result, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset)
    431 {
     449bool RenderFlowThread::hitTestRegion(RenderRegion* region, const HitTestRequest& request, HitTestResult& result, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset)
     450{
     451    LayoutRect regionRect = region->regionRect();
    432452    LayoutRect regionClippingRect(accumulatedOffset, regionRect.size());
    433453    if (!regionClippingRect.contains(pointInContainer))
     
    447467    HitTestRequest newRequest(request.type() & HitTestRequest::IgnoreClipping);
    448468
     469    RenderRegion* oldRegion = result.region();
     470    result.setRegion(region);
    449471    LayoutPoint oldPoint = result.point();
    450472    result.setPoint(transformedPoint);
    451473    bool isPointInsideFlowThread = layer()->hitTest(newRequest, result);
    452474    result.setPoint(oldPoint);
    453    
     475    result.setRegion(oldRegion);
     476
    454477    // FIXME: Should we set result.m_localPoint back to the RenderRegion's coordinate space or leave it in the RenderFlowThread's coordinate
    455478    // space? Right now it's staying in the RenderFlowThread's coordinate space, which may end up being ok. We will know more when we get around to
     
    587610}
    588611
     612void RenderFlowThread::removeRenderBoxRegionInfo(RenderBox* box)
     613{
     614    // FIXME: Would be nice if we also cached the box's start and end regions so that we didn't have to
     615    // walk every single region.
     616    if (!hasRegions() || regionsHaveUniformLogicalWidth())
     617        return;
     618
     619    for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
     620        RenderRegion* region = *iter;
     621       
     622        if (!region->isValid() || region->matchesRenderFlowThreadLogicalWidth())
     623            continue;
     624
     625        ASSERT(!region->needsLayout());
     626
     627        region->removeRenderBoxRegionInfo(box);
     628    }
     629}
     630
    589631} // namespace WebCore
  • trunk/Source/WebCore/rendering/RenderFlowThread.h

    r95901 r96408  
    8282    void computeLogicalHeight();
    8383
    84     void paintIntoRegion(PaintInfo&, const LayoutRect& regionRect, const LayoutPoint& paintOffset);
    85     bool hitTestRegion(const LayoutRect& regionRect, const HitTestRequest&, HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset);
     84    void paintIntoRegion(PaintInfo&, RenderRegion*, const LayoutPoint& paintOffset);
     85    bool hitTestRegion(RenderRegion*, const HitTestRequest&, HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset);
    8686
    8787    bool hasRegions() const { return m_regionList.size(); }
     
    101101    LayoutUnit regionLogicalHeightForLine(LayoutUnit position) const;
    102102    LayoutUnit regionRemainingLogicalHeightForLine(LayoutUnit position, bool includeBoundaryPoint = true) const;
    103 
    104     bool isRegionFittingEnabled() const { return !m_regionFittingDisableCount; }
    105     void disableRegionFitting() { m_regionFittingDisableCount++; }
    106     void enableRegionFitting() { ASSERT(m_regionFittingDisableCount > 0); m_regionFittingDisableCount--; }
     103    RenderRegion* renderRegionForLine(LayoutUnit position, bool extendLastRegion = false) const;
    107104
    108105    bool regionsHaveUniformLogicalWidth() const { return m_regionsHaveUniformLogicalWidth; }
     
    111108    RenderRegion* mapFromFlowToRegion(TransformState&) const;
    112109
     110    void removeRenderBoxRegionInfo(RenderBox*);
     111
    113112private:
    114113    virtual const char* renderName() const { return "RenderFlowThread"; }
    115 
    116     RenderRegion* renderRegionForLine(LayoutUnit position, bool extendLastRegion = false) const;
    117114
    118115    bool dependsOn(RenderFlowThread* otherRenderFlowThread) const;
     
    143140    bool m_regionsHaveUniformLogicalWidth;
    144141    bool m_regionsHaveUniformLogicalHeight;
    145     unsigned m_regionFittingDisableCount;
    146142};
    147143
     
    161157void toRenderFlowThread(const RenderFlowThread*);
    162158
    163 class RegionFittingDisabler {
    164     WTF_MAKE_NONCOPYABLE(RegionFittingDisabler);
    165 public:
    166     RegionFittingDisabler(RenderFlowThread* flowThread, bool disable)
    167     {
    168         if (flowThread && disable) {
    169             m_flowThread = flowThread;
    170             m_flowThread->disableRegionFitting();
    171         } else
    172             m_flowThread = 0;
    173     }
    174 
    175     ~RegionFittingDisabler()
    176     {
    177         if (m_flowThread)
    178             m_flowThread->enableRegionFitting();
    179     }
    180 private:
    181     RenderFlowThread* m_flowThread;
    182 };
    183 
    184 
    185159} // namespace WebCore
    186160
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r96154 r96408  
    25372537}
    25382538
    2539 void RenderLayer::paint(GraphicsContext* p, const LayoutRect& damageRect, PaintBehavior paintBehavior, RenderObject *paintingRoot)
     2539void RenderLayer::paint(GraphicsContext* p, const LayoutRect& damageRect, PaintBehavior paintBehavior, RenderObject *paintingRoot, RenderRegion* region)
    25402540{
    25412541    OverlapTestRequestMap overlapTestRequests;
    2542     paintLayer(this, p, damageRect, paintBehavior, paintingRoot, &overlapTestRequests);
     2542    paintLayer(this, p, damageRect, paintBehavior, paintingRoot, region, &overlapTestRequests);
    25432543    OverlapTestRequestMap::iterator end = overlapTestRequests.end();
    25442544    for (OverlapTestRequestMap::iterator it = overlapTestRequests.begin(); it != end; ++it)
     
    25502550    if (!m_containsDirtyOverlayScrollbars)
    25512551        return;
    2552     paintLayer(this, p, damageRect, paintBehavior, paintingRoot, 0, PaintLayerHaveTransparency | PaintLayerTemporaryClipRects
     2552    paintLayer(this, p, damageRect, paintBehavior, paintingRoot, 0, 0, PaintLayerHaveTransparency | PaintLayerTemporaryClipRects
    25532553               | PaintLayerPaintingOverlayScrollbars);
    25542554    m_containsDirtyOverlayScrollbars = false;
     
    26272627void RenderLayer::paintLayer(RenderLayer* rootLayer, GraphicsContext* p,
    26282628                        const LayoutRect& paintDirtyRect, PaintBehavior paintBehavior,
    2629                         RenderObject* paintingRoot, OverlapTestRequestMap* overlapTestRequests,
     2629                        RenderObject* paintingRoot, RenderRegion* region, OverlapTestRequestMap* overlapTestRequests,
    26302630                        PaintLayerFlags paintFlags)
    26312631{
     
    26952695
    26962696            // Now do a paint with the root layer shifted to be us.
    2697             paintLayer(this, p, transform.inverse().mapRect(paintDirtyRect), paintBehavior, paintingRoot, overlapTestRequests, paintFlags | PaintLayerAppliedTransform);
     2697            paintLayer(this, p, transform.inverse().mapRect(paintDirtyRect), paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags | PaintLayerAppliedTransform);
    26982698        }       
    26992699
     
    27122712        // Mark that we are now inside replica painting.
    27132713        m_paintingInsideReflection = true;
    2714         reflectionLayer()->paintLayer(rootLayer, p, paintDirtyRect, paintBehavior, paintingRoot, overlapTestRequests, localPaintFlags | PaintLayerPaintingReflection);
     2714        reflectionLayer()->paintLayer(rootLayer, p, paintDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, localPaintFlags | PaintLayerPaintingReflection);
    27152715        m_paintingInsideReflection = false;
    27162716    }
     
    27532753
    27542754        // Paint the background.
    2755         PaintInfo paintInfo(p, damageRect.rect(), PaintPhaseBlockBackground, false, paintingRootForRenderer, 0);
     2755        PaintInfo paintInfo(p, damageRect.rect(), PaintPhaseBlockBackground, false, paintingRootForRenderer, region, 0);
    27562756        renderer()->paint(paintInfo, paintOffset);
    27572757
     
    27612761
    27622762    // Now walk the sorted list of children with negative z-indices.
    2763     paintList(m_negZOrderList, rootLayer, p, paintDirtyRect, paintBehavior, paintingRoot, overlapTestRequests, localPaintFlags);
     2763    paintList(m_negZOrderList, rootLayer, p, paintDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, localPaintFlags);
    27642764
    27652765    // Now establish the appropriate clip and paint our child RenderObjects.
     
    27732773        PaintInfo paintInfo(p, clipRectToApply.rect(),
    27742774                            selectionOnly ? PaintPhaseSelection : PaintPhaseChildBlockBackgrounds,
    2775                             forceBlackText, paintingRootForRenderer, 0);
     2775                            forceBlackText, paintingRootForRenderer, region, 0);
    27762776        renderer()->paint(paintInfo, paintOffset);
    27772777        if (!selectionOnly) {
     
    27912791    if (!outlineRect.isEmpty() && isSelfPaintingLayer() && !paintingOverlayScrollbars) {
    27922792        // Paint our own outline
    2793         PaintInfo paintInfo(p, outlineRect.rect(), PaintPhaseSelfOutline, false, paintingRootForRenderer, 0);
     2793        PaintInfo paintInfo(p, outlineRect.rect(), PaintPhaseSelfOutline, false, paintingRootForRenderer, region, 0);
    27942794        clipToRect(rootLayer, p, paintDirtyRect, outlineRect, DoNotIncludeSelfForBorderRadius);
    27952795        renderer()->paint(paintInfo, paintOffset);
     
    27982798   
    27992799    // Paint any child layers that have overflow.
    2800     paintList(m_normalFlowList, rootLayer, p, paintDirtyRect, paintBehavior, paintingRoot, overlapTestRequests, localPaintFlags);
     2800    paintList(m_normalFlowList, rootLayer, p, paintDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, localPaintFlags);
    28012801   
    28022802    // Now walk the sorted list of children with positive z-indices.
    2803     paintList(m_posZOrderList, rootLayer, p, paintDirtyRect, paintBehavior, paintingRoot, overlapTestRequests, localPaintFlags);
     2803    paintList(m_posZOrderList, rootLayer, p, paintDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, localPaintFlags);
    28042804       
    28052805    if (renderer()->hasMask() && shouldPaint && !selectionOnly && !damageRect.isEmpty() && !paintingOverlayScrollbars) {
     
    28072807
    28082808        // Paint the mask.
    2809         PaintInfo paintInfo(p, damageRect.rect(), PaintPhaseMask, false, paintingRootForRenderer, 0);
     2809        PaintInfo paintInfo(p, damageRect.rect(), PaintPhaseMask, false, paintingRootForRenderer, region, 0);
    28102810        renderer()->paint(paintInfo, paintOffset);
    28112811       
     
    28302830void RenderLayer::paintList(Vector<RenderLayer*>* list, RenderLayer* rootLayer, GraphicsContext* p,
    28312831                            const LayoutRect& paintDirtyRect, PaintBehavior paintBehavior,
    2832                             RenderObject* paintingRoot, OverlapTestRequestMap* overlapTestRequests,
     2832                            RenderObject* paintingRoot, RenderRegion* region, OverlapTestRequestMap* overlapTestRequests,
    28332833                            PaintLayerFlags paintFlags)
    28342834{
     
    28392839        RenderLayer* childLayer = list->at(i);
    28402840        if (!childLayer->isPaginated())
    2841             childLayer->paintLayer(rootLayer, p, paintDirtyRect, paintBehavior, paintingRoot, overlapTestRequests, paintFlags);
     2841            childLayer->paintLayer(rootLayer, p, paintDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags);
    28422842        else
    2843             paintPaginatedChildLayer(childLayer, rootLayer, p, paintDirtyRect, paintBehavior, paintingRoot, overlapTestRequests, paintFlags);
     2843            paintPaginatedChildLayer(childLayer, rootLayer, p, paintDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags);
    28442844    }
    28452845}
     
    28472847void RenderLayer::paintPaginatedChildLayer(RenderLayer* childLayer, RenderLayer* rootLayer, GraphicsContext* context,
    28482848                                           const LayoutRect& paintDirtyRect, PaintBehavior paintBehavior,
    2849                                            RenderObject* paintingRoot, OverlapTestRequestMap* overlapTestRequests,
     2849                                           RenderObject* paintingRoot, RenderRegion* region, OverlapTestRequestMap* overlapTestRequests,
    28502850                                           PaintLayerFlags paintFlags)
    28512851{
     
    28662866        return;
    28672867
    2868     paintChildLayerIntoColumns(childLayer, rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, overlapTestRequests, paintFlags, columnLayers, columnLayers.size() - 1);
     2868    paintChildLayerIntoColumns(childLayer, rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags, columnLayers, columnLayers.size() - 1);
    28692869}
    28702870
    28712871void RenderLayer::paintChildLayerIntoColumns(RenderLayer* childLayer, RenderLayer* rootLayer, GraphicsContext* context,
    28722872                                             const LayoutRect& paintDirtyRect, PaintBehavior paintBehavior,
    2873                                              RenderObject* paintingRoot, OverlapTestRequestMap* overlapTestRequests,
     2873                                             RenderObject* paintingRoot, RenderRegion* region, OverlapTestRequestMap* overlapTestRequests,
    28742874                                             PaintLayerFlags paintFlags, const Vector<RenderLayer*>& columnLayers, size_t colIndex)
    28752875{
     
    29192919               
    29202920                childLayer->m_transform = adoptPtr(new TransformationMatrix(newTransform));
    2921                 childLayer->paintLayer(rootLayer, context, localDirtyRect, paintBehavior, paintingRoot, overlapTestRequests, paintFlags);
     2921                childLayer->paintLayer(rootLayer, context, localDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags);
    29222922                if (oldHasTransform)
    29232923                    childLayer->m_transform = adoptPtr(new TransformationMatrix(oldTransform));
     
    29372937                // Now do a paint with the root layer shifted to be the next multicol block.
    29382938                paintChildLayerIntoColumns(childLayer, columnLayers[colIndex - 1], context, transform.inverse().mapRect(localDirtyRect), paintBehavior,
    2939                                            paintingRoot, overlapTestRequests, paintFlags,
     2939                                           paintingRoot, region, overlapTestRequests, paintFlags,
    29402940                                           columnLayers, colIndex - 1);
    29412941            }
  • trunk/Source/WebCore/rendering/RenderLayer.h

    r95239 r96408  
    418418    // front.  The hitTest method looks for mouse events by walking
    419419    // layers that intersect the point from front to back.
    420     void paint(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior = PaintBehaviorNormal, RenderObject* paintingRoot = 0);
     420    void paint(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior = PaintBehaviorNormal, RenderObject* paintingRoot = 0, RenderRegion* = 0);
    421421    bool hitTest(const HitTestRequest&, HitTestResult&);
    422422    void paintOverlayScrollbars(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior, RenderObject* paintingRoot);
     
    549549
    550550    void paintLayer(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect& paintDirtyRect,
    551                     PaintBehavior, RenderObject* paintingRoot, OverlapTestRequestMap* = 0,
     551                    PaintBehavior, RenderObject* paintingRoot, RenderRegion* = 0, OverlapTestRequestMap* = 0,
    552552                    PaintLayerFlags = 0);
    553553    void paintList(Vector<RenderLayer*>*, RenderLayer* rootLayer, GraphicsContext* p,
    554554                   const LayoutRect& paintDirtyRect, PaintBehavior,
    555                    RenderObject* paintingRoot, OverlapTestRequestMap*,
     555                   RenderObject* paintingRoot, RenderRegion*, OverlapTestRequestMap*,
    556556                   PaintLayerFlags);
    557557    void paintPaginatedChildLayer(RenderLayer* childLayer, RenderLayer* rootLayer, GraphicsContext*,
    558558                                  const LayoutRect& paintDirtyRect, PaintBehavior,
    559                                   RenderObject* paintingRoot, OverlapTestRequestMap*,
     559                                  RenderObject* paintingRoot, RenderRegion*, OverlapTestRequestMap*,
    560560                                  PaintLayerFlags);
    561561    void paintChildLayerIntoColumns(RenderLayer* childLayer, RenderLayer* rootLayer, GraphicsContext*,
    562562                                    const LayoutRect& paintDirtyRect, PaintBehavior,
    563                                     RenderObject* paintingRoot, OverlapTestRequestMap*,
     563                                    RenderObject* paintingRoot, RenderRegion*, OverlapTestRequestMap*,
    564564                                    PaintLayerFlags, const Vector<RenderLayer*>& columnLayers, size_t columnIndex);
    565565
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r96069 r96408  
    11101110        m_owningLayer->clipToRect(rootLayer, context, paintDirtyRect, damageRect, DoNotIncludeSelfForBorderRadius);
    11111111       
    1112         PaintInfo info(context, damageRect.rect(), PaintPhaseBlockBackground, false, paintingRootForRenderer, 0);
     1112        PaintInfo info(context, damageRect.rect(), PaintPhaseBlockBackground, false, paintingRootForRenderer, 0, 0);
    11131113        renderer()->paint(info, paintOffset);
    11141114
     
    11171117
    11181118        // Now walk the sorted list of children with negative z-indices. Only RenderLayers without compositing layers will paint.
    1119         m_owningLayer->paintList(m_owningLayer->negZOrderList(), rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, 0, 0);
     1119        m_owningLayer->paintList(m_owningLayer->negZOrderList(), rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, 0, 0, 0);
    11201120    }
    11211121               
     
    11281128        PaintInfo paintInfo(context, clipRectToApply.rect(),
    11291129                            selectionOnly ? PaintPhaseSelection : PaintPhaseChildBlockBackgrounds,
    1130                             forceBlackText, paintingRootForRenderer, 0);
     1130                            forceBlackText, paintingRootForRenderer, 0, 0);
    11311131        renderer()->paint(paintInfo, paintOffset);
    11321132
     
    11471147        if (!outlineRect.isEmpty()) {
    11481148            // Paint our own outline
    1149             PaintInfo paintInfo(context, outlineRect.rect(), PaintPhaseSelfOutline, false, paintingRootForRenderer, 0);
     1149            PaintInfo paintInfo(context, outlineRect.rect(), PaintPhaseSelfOutline, false, paintingRootForRenderer, 0, 0);
    11501150            m_owningLayer->clipToRect(rootLayer, context, paintDirtyRect, outlineRect, DoNotIncludeSelfForBorderRadius);
    11511151            renderer()->paint(paintInfo, paintOffset);
     
    11541154
    11551155        // Paint any child layers that have overflow.
    1156         m_owningLayer->paintList(m_owningLayer->normalFlowList(), rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, 0, 0);
     1156        m_owningLayer->paintList(m_owningLayer->normalFlowList(), rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, 0, 0, 0);
    11571157
    11581158        // Now walk the sorted list of children with positive z-indices.
    1159         m_owningLayer->paintList(m_owningLayer->posZOrderList(), rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, 0, 0);
     1159        m_owningLayer->paintList(m_owningLayer->posZOrderList(), rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, 0, 0, 0);
    11601160    }
    11611161   
     
    11651165
    11661166            // Paint the mask.
    1167             PaintInfo paintInfo(context, damageRect.rect(), PaintPhaseMask, false, paintingRootForRenderer, 0);
     1167            PaintInfo paintInfo(context, damageRect.rect(), PaintPhaseMask, false, paintingRootForRenderer, 0, 0);
    11681168            renderer()->paint(paintInfo, paintOffset);
    11691169           
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r96343 r96408  
    218218    , m_selectionState(SelectionNone)
    219219    , m_hasColumns(false)
     220    , m_inRenderFlowThread(false)
    220221{
    221222#ifndef NDEBUG
     
    579580
    580581RenderFlowThread* RenderObject::enclosingRenderFlowThread() const
    581 {
     582{   
     583    if (!inRenderFlowThread())
     584        return 0;
    582585    RenderObject* curr = const_cast<RenderObject*>(this);
    583586    while (curr) {
     
    12451248    // FIXME: Composited layers inside a flow thread will bypass this mechanism and will malfunction. It's not
    12461249    // clear how to address this problem for composited descendants of a RenderFlowThread.
    1247     if (!repaintContainer && v->hasRenderFlowThreads())
     1250    if (!repaintContainer && inRenderFlowThread())
    12481251        repaintContainer = enclosingRenderFlowThread();
    12491252    return repaintContainer;
  • trunk/Source/WebCore/rendering/RenderObject.h

    r96187 r96408  
    223223    void setPreviousSibling(RenderObject* previous) { m_previous = previous; }
    224224    void setNextSibling(RenderObject* next) { m_next = next; }
    225     void setParent(RenderObject* parent) { m_parent = parent; }
     225    void setParent(RenderObject* parent)
     226    {
     227        m_parent = parent;
     228        if (parent && parent->inRenderFlowThread())
     229            setInRenderFlowThread(true);
     230        else if (!parent && inRenderFlowThread())
     231            setInRenderFlowThread(false);
     232    }
    226233    //////////////////////////////////////////
    227234private:
     
    364371    bool hasColumns() const { return m_hasColumns; }
    365372    void setHasColumns(bool b = true) { m_hasColumns = b; }
     373
     374    bool inRenderFlowThread() const { return m_inRenderFlowThread; }
     375    void setInRenderFlowThread(bool b = true) { m_inRenderFlowThread = b; }
    366376
    367377    virtual bool requiresForcedStyleRecalcPropagation() const { return false; }
     
    906916    unsigned m_selectionState : 3; // SelectionState
    907917    bool m_hasColumns : 1;
     918    bool m_inRenderFlowThread : 1;
    908919
    909920private:
  • trunk/Source/WebCore/rendering/RenderObjectChildList.cpp

    r95901 r96408  
    114114        if (oldChild->isRenderRegion())
    115115            toRenderRegion(oldChild)->detachRegion();
     116
     117        if (oldChild->inRenderFlowThread() && oldChild->isBox())
     118            oldChild->enclosingRenderFlowThread()->removeRenderBoxRegionInfo(toRenderBox(oldChild));
    116119
    117120        if (RenderFlowThread* containerFlowThread = renderFlowThreadContainer(owner))
  • trunk/Source/WebCore/rendering/RenderRegion.cpp

    r95901 r96408  
    3535#include "IntRect.h"
    3636#include "PaintInfo.h"
     37#include "RenderBoxRegionInfo.h"
    3738#include "RenderFlowThread.h"
    3839#include "RenderView.h"
     
    5051RenderRegion::~RenderRegion()
    5152{
     53    deleteAllRenderBoxRegionInfo();
    5254}
    5355
     
    5759    if (!m_flowThread || !isValid())
    5860        return;
    59     m_flowThread->paintIntoRegion(paintInfo, regionRect(), LayoutPoint(paintOffset.x() + borderLeft() + paddingLeft(), paintOffset.y() + borderTop() + paddingTop()));
     61    m_flowThread->paintIntoRegion(paintInfo, this, LayoutPoint(paintOffset.x() + borderLeft() + paddingLeft(), paintOffset.y() + borderTop() + paddingTop()));
    6062}
    6163
     
    7375    if (visibleToHitTesting() && action == HitTestForeground && boundsRect.intersects(result.rectForPoint(pointInContainer))) {
    7476        // Check the contents of the RenderFlowThread.
    75         if (m_flowThread && m_flowThread->hitTestRegion(regionRect(), request, result, pointInContainer, LayoutPoint(adjustedLocation.x() + borderLeft() + paddingLeft(), adjustedLocation.y() + borderTop() + paddingTop())))
     77        if (m_flowThread && m_flowThread->hitTestRegion(this, request, result, pointInContainer, LayoutPoint(adjustedLocation.x() + borderLeft() + paddingLeft(), adjustedLocation.y() + borderTop() + paddingTop())))
    7678            return true;
    7779        updateHitTestResult(result, pointInContainer - toLayoutSize(adjustedLocation));
     
    124126}
    125127
     128RenderBoxRegionInfo* RenderRegion::renderBoxRegionInfo(const RenderBox* box) const
     129{
     130    if (!m_isValid || !m_flowThread || matchesRenderFlowThreadLogicalWidth())
     131        return 0;
     132    return m_renderBoxRegionInfo.get(box);
     133}
     134
     135RenderBoxRegionInfo* RenderRegion::setRenderBoxRegionInfo(const RenderBox* box, LayoutUnit logicalLeftInset, LayoutUnit logicalRightInset,
     136    bool containingBlockChainIsInset)
     137{
     138    ASSERT(m_isValid && m_flowThread && !matchesRenderFlowThreadLogicalWidth());
     139    if (!m_isValid || !m_flowThread || matchesRenderFlowThreadLogicalWidth())
     140        return 0;
     141
     142    RenderBoxRegionInfo* existingBoxInfo = m_renderBoxRegionInfo.get(box);
     143    if (existingBoxInfo) {
     144        *existingBoxInfo = RenderBoxRegionInfo(logicalLeftInset, logicalRightInset, containingBlockChainIsInset);
     145        return existingBoxInfo;
     146    }
     147   
     148    RenderBoxRegionInfo* newBoxInfo = new RenderBoxRegionInfo(logicalLeftInset, logicalRightInset, containingBlockChainIsInset);
     149    m_renderBoxRegionInfo.set(box, newBoxInfo);
     150    return newBoxInfo;
     151}
     152
     153void RenderRegion::removeRenderBoxRegionInfo(const RenderBox* box)
     154{
     155    ASSERT(m_isValid && m_flowThread && !matchesRenderFlowThreadLogicalWidth());
     156    if (!m_isValid || !m_flowThread || matchesRenderFlowThreadLogicalWidth())
     157        return;
     158    RenderBoxRegionInfo* info = m_renderBoxRegionInfo.take(box);
     159    delete info;
     160}
     161
     162void RenderRegion::deleteAllRenderBoxRegionInfo()
     163{
     164    deleteAllValues(m_renderBoxRegionInfo);
     165    m_renderBoxRegionInfo.clear();
     166}
     167
     168bool RenderRegion::matchesRenderFlowThreadLogicalWidth() const
     169{
     170    if (!m_isValid || !m_flowThread)
     171        return true;
     172    if (m_flowThread->isHorizontalWritingMode())
     173        return m_flowThread->logicalWidth() == regionRect().width();
     174    return m_flowThread->logicalWidth() == regionRect().height();
     175}
     176
    126177} // namespace WebCore
  • trunk/Source/WebCore/rendering/RenderRegion.h

    r95901 r96408  
    3535namespace WebCore {
    3636
     37class RenderBox;
     38class RenderBoxRegionInfo;
    3739class RenderFlowThread;
    3840
     
    6163    virtual void layout();
    6264
     65    RenderBoxRegionInfo* renderBoxRegionInfo(const RenderBox*) const;
     66    RenderBoxRegionInfo* setRenderBoxRegionInfo(const RenderBox*, LayoutUnit logicalLeftInset, LayoutUnit logicalRightInset,
     67        bool containingBlockChainIsInset);
     68    void removeRenderBoxRegionInfo(const RenderBox*);
     69    void deleteAllRenderBoxRegionInfo();
     70
     71    bool matchesRenderFlowThreadLogicalWidth() const;
     72
    6373private:
    6474    virtual const char* renderName() const { return "RenderRegion"; }
     
    7181    RenderFlowThread* m_parentFlowThread;
    7282    IntRect m_regionRect;
     83
     84    // This map holds unique information about a block that is split across regions.
     85    // A RenderBoxRegionInfo* tells us about any layout information for a RenderBox that
     86    // is unique to the region. For now it just holds logical width information for RenderBlocks, but eventually
     87    // it will also hold a custom style for any box (for region styling).
     88    HashMap<const RenderBox*, RenderBoxRegionInfo*> m_renderBoxRegionInfo;
    7389
    7490    bool m_isValid;
  • trunk/Source/WebCore/rendering/RenderReplica.cpp

    r95901 r96408  
    7373        layer()->parent()->paintLayer(layer()->transform() ? layer()->parent() : layer()->enclosingTransformedAncestor(),
    7474                                      paintInfo.context, paintInfo.rect,
    75                                       PaintBehaviorNormal, 0, 0,
     75                                      PaintBehaviorNormal, 0, paintInfo.renderRegion, 0,
    7676                                      RenderLayer::PaintLayerHaveTransparency | RenderLayer::PaintLayerAppliedTransform | RenderLayer::PaintLayerTemporaryClipRects | RenderLayer::PaintLayerPaintingReflection);
    7777    else if (paintInfo.phase == PaintPhaseMask)
  • trunk/Source/WebCore/rendering/RenderScrollbarPart.cpp

    r96138 r96408  
    171171
    172172    // Now do the paint.
    173     PaintInfo paintInfo(graphicsContext, rect, PaintPhaseBlockBackground, false, 0, 0);
     173    PaintInfo paintInfo(graphicsContext, rect, PaintPhaseBlockBackground, false, 0, 0, 0);
    174174    paint(paintInfo, paintOffset);
    175175    paintInfo.phase = PaintPhaseChildBlockBackgrounds;
  • trunk/Source/WebCore/rendering/svg/SVGImageBufferTools.cpp

    r96155 r96408  
    8282    ASSERT(image->context());
    8383
    84     PaintInfo info(image->context(), PaintInfo::infiniteRect(), PaintPhaseForeground, 0, 0, 0);
     84    PaintInfo info(image->context(), PaintInfo::infiniteRect(), PaintPhaseForeground, 0, 0, 0, 0);
    8585
    8686    AffineTransform& contentTransformation = currentContentTransformation();
Note: See TracChangeset for help on using the changeset viewer.