Changeset 164290 in webkit


Ignore:
Timestamp:
Feb 18, 2014 7:11:00 AM (10 years ago)
Author:
mihnea@adobe.com
Message:

[CSSRegions] Compute region ranges for inline replaced elements
https://bugs.webkit.org/show_bug.cgi?id=128800

Reviewed by Andrei Bucur.

Source/WebCore:

Tests: fast/regions/hover-content-inside-iframe-in-region.html

fast/regions/select-multiple-in-region.html

When asking for the range of regions for an inline replaced box,
use the region cached on the root inline box for the inline replaced
box as the range of regions is computed only for blocks.
A future patch will extend the computation of region ranges
for inline blocks too.

  • rendering/RenderBoxModelObject.cpp:

(WebCore::RenderBoxModelObject::mapAbsoluteToLocalPoint):
Remove the restriction set during https://bugs.webkit.org/show_bug.cgi?id=113703
and enable the code path for boxes not only for blocks.
Method RenderFlowThread::getRegionRangeForBox returns a null region when it is unable
to get the region range and we already check for null region case.

  • rendering/RenderFlowThread.cpp:

(WebCore::RenderFlowThread::getRegionRangeForBox):

LayoutTests:

  • fast/regions/hover-content-inside-iframe-in-region-expected.html: Added.
  • fast/regions/hover-content-inside-iframe-in-region.html: Added.
  • fast/regions/resources/iframe-in-region-source.html: Added.
  • fast/regions/select-multiple-in-region-expected.txt: Added.
  • fast/regions/select-multiple-in-region.html: Added.
Location:
trunk
Files:
5 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r164268 r164290  
     12014-02-18  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        [CSSRegions] Compute region ranges for inline replaced elements
     4        https://bugs.webkit.org/show_bug.cgi?id=128800
     5
     6        Reviewed by Andrei Bucur.
     7
     8        * fast/regions/hover-content-inside-iframe-in-region-expected.html: Added.
     9        * fast/regions/hover-content-inside-iframe-in-region.html: Added.
     10        * fast/regions/resources/iframe-in-region-source.html: Added.
     11        * fast/regions/select-multiple-in-region-expected.txt: Added.
     12        * fast/regions/select-multiple-in-region.html: Added.
     13
    1142014-02-17  Benjamin Poulain  <bpoulain@apple.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r164279 r164290  
     12014-02-18  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        [CSSRegions] Compute region ranges for inline replaced elements
     4        https://bugs.webkit.org/show_bug.cgi?id=128800
     5
     6        Reviewed by Andrei Bucur.
     7
     8        Tests: fast/regions/hover-content-inside-iframe-in-region.html
     9               fast/regions/select-multiple-in-region.html
     10
     11        When asking for the range of regions for an inline replaced box,
     12        use the region cached on the root inline box for the inline replaced
     13        box as the range of regions is computed only for blocks.
     14        A future patch will extend the computation of region ranges
     15        for inline blocks too.
     16
     17        * rendering/RenderBoxModelObject.cpp:
     18        (WebCore::RenderBoxModelObject::mapAbsoluteToLocalPoint):
     19        Remove the restriction set during https://bugs.webkit.org/show_bug.cgi?id=113703
     20        and enable the code path for boxes not only for blocks.
     21        Method RenderFlowThread::getRegionRangeForBox returns a null region when it is unable
     22        to get the region range and we already check for null region case.
     23        * rendering/RenderFlowThread.cpp:
     24        (WebCore::RenderFlowThread::getRegionRangeForBox):
     25
    1262014-02-18  Xabier Rodriguez Calvar  <calvaris@igalia.com>
    227
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r163928 r164290  
    27502750    // The point inside a box that's inside a region has its coordinates relative to the region,
    27512751    // not the FlowThread that is its container in the RenderObject tree.
    2752     if (o->isRenderFlowThread() && isRenderBlock()) {
    2753         // FIXME (CSSREGIONS): switch to Box instead of Block when we'll have range information
    2754         // for boxes as well, not just for blocks.
     2752    if (o->isRenderFlowThread() && isBox()) {
    27552753        RenderRegion* startRegion;
    27562754        RenderRegion* endRegion;
    2757         toRenderFlowThread(o)->getRegionRangeForBox(toRenderBlock(this), startRegion, endRegion);
     2755        toRenderFlowThread(o)->getRegionRangeForBox(toRenderBox(this), startRegion, endRegion);
    27582756        if (startRegion)
    27592757            o = startRegion;
  • trunk/Source/WebCore/rendering/RenderFlowThread.cpp

    r163957 r164290  
    3434#include "HitTestRequest.h"
    3535#include "HitTestResult.h"
     36#include "InlineElementBox.h"
    3637#include "Node.h"
    3738#include "PODIntervalTree.h"
     
    785786void RenderFlowThread::getRegionRangeForBox(const RenderBox* box, RenderRegion*& startRegion, RenderRegion*& endRegion) const
    786787{
    787     startRegion = 0;
    788     endRegion = 0;
     788    startRegion = endRegion = 0;
    789789    auto it = m_regionRangeMap.find(box);
    790     if (it == m_regionRangeMap.end())
    791         return;
    792 
    793     const RenderRegionRange& range = it->value;
    794     startRegion = range.startRegion();
    795     endRegion = range.endRegion();
    796     ASSERT(m_regionList.contains(startRegion) && m_regionList.contains(endRegion));
     790
     791    if (it != m_regionRangeMap.end()) {
     792        const RenderRegionRange& range = it->value;
     793        startRegion = range.startRegion();
     794        endRegion = range.endRegion();
     795        ASSERT(m_regionList.contains(startRegion) && m_regionList.contains(endRegion));
     796        return;
     797    }
     798
     799    InlineElementBox* boxWrapper = box->inlineBoxWrapper();
     800    if (boxWrapper) {
     801        const RootInlineBox& boxWrapperRootInlineBox =  boxWrapper->root();
     802        startRegion = endRegion = boxWrapperRootInlineBox.containingRegion();
     803        return;
     804    }
    797805}
    798806
Note: See TracChangeset for help on using the changeset viewer.