Changeset 122096 in webkit


Ignore:
Timestamp:
Jul 9, 2012 1:08:39 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[CSSRegions] Implement NamedFlow::firstEmptyRegionIndex attribute
https://bugs.webkit.org/show_bug.cgi?id=90608

Patch by Andrei Onea <onea@adobe.com> on 2012-07-09
Reviewed by Andreas Kling.

Source/WebCore:

Implemented NamedFlow::firstEmptyRegionIndex as per spec: http://www.w3.org/TR/css3-regions/#dom-named-flow

Test: fast/regions/webkit-named-flow-first-empty-region-index.html

  • dom/WebKitNamedFlow.cpp:

(WebCore::WebKitNamedFlow::firstEmptyRegionIndex):
(WebCore):

  • dom/WebKitNamedFlow.h:

(WebKitNamedFlow):

  • dom/WebKitNamedFlow.idl:

LayoutTests:

Added tests for NamedFlow::firstEmptyRegionIndex.

  • fast/regions/webkit-named-flow-first-empty-region-index-expected.txt: Added.
  • fast/regions/webkit-named-flow-first-empty-region-index.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r122095 r122096  
     12012-07-09  Andrei Onea  <onea@adobe.com>
     2
     3        [CSSRegions] Implement NamedFlow::firstEmptyRegionIndex attribute
     4        https://bugs.webkit.org/show_bug.cgi?id=90608
     5
     6        Reviewed by Andreas Kling.
     7
     8        Added tests for NamedFlow::firstEmptyRegionIndex.
     9
     10        * fast/regions/webkit-named-flow-first-empty-region-index-expected.txt: Added.
     11        * fast/regions/webkit-named-flow-first-empty-region-index.html: Added.
     12
    1132012-07-09  Kristóf Kosztyó  <kkristof@inf.u-szeged.hu>
    214
  • trunk/Source/WebCore/ChangeLog

    r122091 r122096  
     12012-07-09  Andrei Onea  <onea@adobe.com>
     2
     3        [CSSRegions] Implement NamedFlow::firstEmptyRegionIndex attribute
     4        https://bugs.webkit.org/show_bug.cgi?id=90608
     5
     6        Reviewed by Andreas Kling.
     7
     8        Implemented NamedFlow::firstEmptyRegionIndex as per spec: http://www.w3.org/TR/css3-regions/#dom-named-flow
     9
     10        Test: fast/regions/webkit-named-flow-first-empty-region-index.html
     11
     12        * dom/WebKitNamedFlow.cpp:
     13        (WebCore::WebKitNamedFlow::firstEmptyRegionIndex):
     14        (WebCore):
     15        * dom/WebKitNamedFlow.h:
     16        (WebKitNamedFlow):
     17        * dom/WebKitNamedFlow.idl:
     18
    1192012-07-08  Yoshifumi Inoue  <yosin@chromium.org>
    220
  • trunk/Source/WebCore/dom/WebKitNamedFlow.cpp

    r121456 r122096  
    5757}
    5858
     59int WebKitNamedFlow::firstEmptyRegionIndex() const
     60{
     61    m_parentFlowThread->document()->updateLayoutIgnorePendingStylesheets();
     62
     63    const RenderRegionList& regionList = m_parentFlowThread->renderRegionList();
     64    if (regionList.isEmpty())
     65        return -1;
     66    RenderRegionList::const_iterator iter = regionList.begin();
     67    for (int index = 0; iter != regionList.end(); ++index, ++iter) {
     68        const RenderRegion* renderRegion = *iter;
     69        if (renderRegion->regionState() == RenderRegion::RegionEmpty)
     70            return index;
     71    }
     72    return -1;
     73}
     74
    5975PassRefPtr<NodeList> WebKitNamedFlow::getRegionsByContentNode(Node* contentNode)
    6076{
  • trunk/Source/WebCore/dom/WebKitNamedFlow.h

    r121456 r122096  
    5252    String name() const;
    5353    bool overset() const;
     54    int firstEmptyRegionIndex() const;
    5455    PassRefPtr<NodeList> getRegionsByContentNode(Node*);
    5556    PassRefPtr<NodeList> getContent();
  • trunk/Source/WebCore/dom/WebKitNamedFlow.idl

    r121456 r122096  
    3434        readonly attribute DOMString name;
    3535        readonly attribute boolean overset;
     36        readonly attribute int firstEmptyRegionIndex;
    3637        NodeList getRegionsByContentNode(in Node contentNode);
    3738        NodeList getContent();
Note: See TracChangeset for help on using the changeset viewer.