[CSSRegions]Expose WebKitNamedFlowCollection interface through document.getNamedFlows()
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Aug 2012 21:46:24 +0000 (21:46 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Aug 2012 21:46:24 +0000 (21:46 +0000)
commitdcc84a02ded9b80f97f6011953080728d906815f
tree6fba3d45a49094ae57c8aef0a460f71df57b2d90
parenta188a3a0c273f3513342bec754c455b1df02ba27
[CSSRegions]Expose WebKitNamedFlowCollection interface through document.getNamedFlows()
https://bugs.webkit.org/show_bug.cgi?id=93368

Patch by Andrei Onea <onea@adobe.com> on 2012-08-24
Reviewed by Ryosuke Niwa.

Source/WebCore:

The WebKitNamedFlowCollection already implemented was being used by Document to store all
the named flows - regardless of state - so we need to use another class to expose to JS.
WebKitNamedFlowCollection was renamed to NamedFlowCollection since it is used only internally,
and the C++ class used to expose to JS is DOMNamedFlowCollection (with the interface name
WebKitNamedFlowCollection). DOMNamedFlowCollection is exposed via Document::webKitGetFlows(),
and it itself exposes the length property, the indexed getter, and the named getter.
http://dev.w3.org/csswg/css3-regions/#document-getnamedflows

Test: fast/regions/webkit-named-flow-collection.html

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/gobject/GNUmakefile.am:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
We need to use same trick as with HTMLPropertiesCollection, to make NamedGetter generate required code.
* dom/DOMAllInOne.cpp:
* dom/DOMNamedFlowCollection.cpp:
(WebCore):
(WebCore::DOMNamedFlowCollection::DOMNamedFlowCollection):
(WebCore::DOMNamedFlowCollection::length):
(WebCore::DOMNamedFlowCollection::item):
(WebCore::DOMNamedFlowCollection::namedItem):
(WebCore::DOMNamedFlowCollection::hasNamedItem):
* dom/DOMNamedFlowCollection.h:
(WebCore):
(DOMNamedFlowCollection):
(WebCore::DOMNamedFlowCollection::create):
* dom/DOMNamedFlowCollection.idl:
* dom/Document.cpp:
(WebCore):
(WebCore::Document::webkitGetNamedFlows):
(WebCore::Document::namedFlows):
* dom/Document.h:
(WebCore):
(Document):
* dom/Document.idl:
* dom/NamedFlowCollection.cpp:
Renamed from Source/WebCore/dom/WebKitNamedFlowCollection.cpp.
(WebCore):
(WebCore::NamedFlowCollection::NamedFlowCollection):
(WebCore::NamedFlowCollection::namedFlows):
(WebCore::NamedFlowCollection::flowByName):
(WebCore::NamedFlowCollection::ensureFlowWithName):
(WebCore::NamedFlowCollection::discardNamedFlow):
(WebCore::NamedFlowCollection::documentDestroyed):
(WebCore::NamedFlowCollection::createCSSOMSnapshot):
Used to create a snapshot of current named flows in CREATED state.
* dom/NamedFlowCollection.h:
Renamed from Source/WebCore/dom/WebKitNamedFlowCollection.h.
(WebCore):
(NamedFlowCollection):
(WebCore::NamedFlowCollection::create):
(WebCore::NamedFlowCollection::document):
(WebCore::NamedFlowCollection::~NamedFlowCollection):
(WebCore::NamedFlowCollection::NamedFlowHashFunctions::hash):
(WebCore::NamedFlowCollection::NamedFlowHashFunctions::equal):
(NamedFlowCollection::NamedFlowHashFunctions):
(WebCore::NamedFlowCollection::NamedFlowHashTranslator::hash):
(WebCore::NamedFlowCollection::NamedFlowHashTranslator::equal):
Moved NamedFlowHashFunctions and NamedFlowHashTranslator definitions to .h
and made them public, so they can be used in DOMNamedFlow as well.
* dom/WebKitNamedFlow.cpp:
(WebCore::WebKitNamedFlow::WebKitNamedFlow):
(WebCore::WebKitNamedFlow::create):
* dom/WebKitNamedFlow.h:
(WebCore):
(WebKitNamedFlow):
* inspector/InspectorCSSAgent.cpp:
* rendering/FlowThreadController.cpp:
(WebCore::FlowThreadController::ensureRenderFlowThreadWithName):

LayoutTests:

Added test for WebKitNamedFlowCollection interface.

* fast/regions/webkit-named-flow-collection-expected.txt: Added.
* fast/regions/webkit-named-flow-collection.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@126627 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/regions/webkit-named-flow-collection-expected.txt [new file with mode: 0644]
LayoutTests/fast/regions/webkit-named-flow-collection.html [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.cpp
Source/WebCore/DerivedSources.make
Source/WebCore/DerivedSources.pri
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/gobject/GNUmakefile.am
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/dom/DOMAllInOne.cpp
Source/WebCore/dom/DOMNamedFlowCollection.cpp [new file with mode: 0644]
Source/WebCore/dom/DOMNamedFlowCollection.h [moved from Source/WebCore/dom/WebKitNamedFlowCollection.h with 61% similarity]
Source/WebCore/dom/DOMNamedFlowCollection.idl [new file with mode: 0644]
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/Document.idl
Source/WebCore/dom/NamedFlowCollection.cpp [moved from Source/WebCore/dom/WebKitNamedFlowCollection.cpp with 69% similarity]
Source/WebCore/dom/NamedFlowCollection.h [new file with mode: 0644]
Source/WebCore/dom/WebKitNamedFlow.cpp
Source/WebCore/dom/WebKitNamedFlow.h
Source/WebCore/inspector/InspectorCSSAgent.cpp
Source/WebCore/rendering/FlowThreadController.cpp