Changeset 130041 in webkit


Ignore:
Timestamp:
Oct 1, 2012 5:46:56 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[CSS Regions] Remove the deprecated API Document.webkitGetFlowByName
https://bugs.webkit.org/show_bug.cgi?id=97657

Patch by Andrei Bucur <abucur@adobe.com> on 2012-10-01
Reviewed by Andreas Kling.

Source/WebCore:

The Document.getFlowByName() API has been deprecated in favor of the NamedFlowCollection.namedItem(DOMString).
Link to spec: http://www.w3.org/TR/css3-regions/#the-namedflow-interface

Tests: The old tests have been adapted to use the new API.

  • dom/Document.cpp:

(WebCore):

  • dom/Document.h:

(Document):

  • dom/Document.idl:

LayoutTests:

To minimize the code change impact, I've created a new method in helper.js getFlowByName() that emulates the
behaviour of Document.webkitGetFlowByName(). All the occurrences of Document.webkitGetFlowByName in the tests/expected results
have been replaced with getFlowByName.

  • fast/regions/get-regions-by-content-horiz-bt.html:
  • fast/regions/get-regions-by-content-horiz-tb.html:
  • fast/regions/get-regions-by-content-vert-lr.html:
  • fast/regions/get-regions-by-content-vert-rl.html:
  • fast/regions/get-regions-by-content.html:
  • fast/regions/get-regions-by-content2.html:
  • fast/regions/resources/helper.js:

(getFlowByName):

  • fast/regions/webkit-named-flow-event-add-to-flow.html:
  • fast/regions/webkit-named-flow-event-no-regions.html:
  • fast/regions/webkit-named-flow-event-remove-from-dom.html:
  • fast/regions/webkit-named-flow-event-remove-from-flow.html:
  • fast/regions/webkit-named-flow-event-target-expected.txt:
  • fast/regions/webkit-named-flow-event-target.html:
  • fast/regions/webkit-named-flow-event-to-null.html:
  • fast/regions/webkit-named-flow-event.html:
  • fast/regions/webkit-named-flow-existing-flow.html:
  • fast/regions/webkit-named-flow-first-empty-region-index.html:
  • fast/regions/webkit-named-flow-flow-added.html:
  • fast/regions/webkit-named-flow-get-content-expected.txt:
  • fast/regions/webkit-named-flow-get-content.html:
  • fast/regions/webkit-named-flow-get-regions.html:
  • fast/regions/webkit-named-flow-invalid-name.html:
  • fast/regions/webkit-named-flow-modified-flow.html:
  • fast/regions/webkit-named-flow-name.html:
  • fast/regions/webkit-named-flow-non-existing-flow.html:
  • fast/regions/webkit-named-flow-overset.html:
  • fast/regions/webkit-named-flow-removed-flow.html:
  • fast/regions/webkit-named-flow-same-object.html:
Location:
trunk
Files:
33 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r130040 r130041  
     12012-10-01  Andrei Bucur  <abucur@adobe.com>
     2
     3        [CSS Regions] Remove the deprecated API Document.webkitGetFlowByName
     4        https://bugs.webkit.org/show_bug.cgi?id=97657
     5
     6        Reviewed by Andreas Kling.
     7
     8        To minimize the code change impact, I've created a new method in helper.js getFlowByName() that emulates the
     9        behaviour of Document.webkitGetFlowByName(). All the occurrences of Document.webkitGetFlowByName in the tests/expected results
     10        have been replaced with getFlowByName.
     11
     12        * fast/regions/get-regions-by-content-horiz-bt.html:
     13        * fast/regions/get-regions-by-content-horiz-tb.html:
     14        * fast/regions/get-regions-by-content-vert-lr.html:
     15        * fast/regions/get-regions-by-content-vert-rl.html:
     16        * fast/regions/get-regions-by-content.html:
     17        * fast/regions/get-regions-by-content2.html:
     18        * fast/regions/resources/helper.js:
     19        (getFlowByName):
     20        * fast/regions/webkit-named-flow-event-add-to-flow.html:
     21        * fast/regions/webkit-named-flow-event-no-regions.html:
     22        * fast/regions/webkit-named-flow-event-remove-from-dom.html:
     23        * fast/regions/webkit-named-flow-event-remove-from-flow.html:
     24        * fast/regions/webkit-named-flow-event-target-expected.txt:
     25        * fast/regions/webkit-named-flow-event-target.html:
     26        * fast/regions/webkit-named-flow-event-to-null.html:
     27        * fast/regions/webkit-named-flow-event.html:
     28        * fast/regions/webkit-named-flow-existing-flow.html:
     29        * fast/regions/webkit-named-flow-first-empty-region-index.html:
     30        * fast/regions/webkit-named-flow-flow-added.html:
     31        * fast/regions/webkit-named-flow-get-content-expected.txt:
     32        * fast/regions/webkit-named-flow-get-content.html:
     33        * fast/regions/webkit-named-flow-get-regions.html:
     34        * fast/regions/webkit-named-flow-invalid-name.html:
     35        * fast/regions/webkit-named-flow-modified-flow.html:
     36        * fast/regions/webkit-named-flow-name.html:
     37        * fast/regions/webkit-named-flow-non-existing-flow.html:
     38        * fast/regions/webkit-named-flow-overset.html:
     39        * fast/regions/webkit-named-flow-removed-flow.html:
     40        * fast/regions/webkit-named-flow-same-object.html:
     41
    1422012-10-01  Christophe Dumez  <christophe.dumez@intel.com>
    243
  • trunk/LayoutTests/fast/regions/get-regions-by-content-horiz-bt.html

    r124410 r130041  
    33    <head>
    44        <script src="../../fast/js/resources/js-test-pre.js"></script>
     5        <script src="resources/helper.js"></script>
    56        <style>
    67            html { -webkit-writing-mode: horizontal-bt; }
     
    3839                window.testRunner.dumpAsText();
    3940            description("Test for 90759: [CSSRegions] Rename NamedFlow::getRegionsByContentNode to NamedFlow::getRegionsByContent");
    40             var namedFlow = document.webkitGetFlowByName("flow");
     41            var namedFlow = getFlowByName("flow");
    4142
    4243            function hideRegions()
     
    111112            shouldBeEqualToString("regionListTextNode32.item(0).id", "region3");
    112113
    113             var namedFlow2 = document.webkitGetFlowByName("flow2");
     114            var namedFlow2 = getFlowByName("flow2");
    114115            var regionListP1 = namedFlow2.getRegionsByContent(document.getElementById("p1"));
    115116            shouldBeNonNull("regionListP1");
  • trunk/LayoutTests/fast/regions/get-regions-by-content-horiz-tb.html

    r124410 r130041  
    33    <head>
    44        <script src="../../fast/js/resources/js-test-pre.js"></script>
     5        <script src="resources/helper.js"></script>
    56        <style>
    67            body { font-family: monospace; }
     
    5152            }
    5253
    53             var namedFlow = document.webkitGetFlowByName("flow");
     54            var namedFlow = getFlowByName("flow");
    5455
    5556            var regionListArticle = namedFlow.getRegionsByContent(document.getElementById("article"));
     
    113114            shouldBeEqualToString("regionListTextNode32.item(0).id", "region3");
    114115
    115             var namedFlow2 = document.webkitGetFlowByName("flow2");
     116            var namedFlow2 = getFlowByName("flow2");
    116117            var regionListP1 = namedFlow2.getRegionsByContent(document.getElementById("p1"));
    117118            shouldBeNonNull("regionListP1");
  • trunk/LayoutTests/fast/regions/get-regions-by-content-vert-lr.html

    r124410 r130041  
    33    <head>
    44        <script src="../../fast/js/resources/js-test-pre.js"></script>
     5        <script src="resources/helper.js"></script>
    56        <style>
    67            html { -webkit-writing-mode: vertical-lr; }
     
    3940                window.testRunner.dumpAsText();
    4041            description("Test for 90759: [CSSRegions] Rename NamedFlow::getRegionsByContentNode to NamedFlow::getRegionsByContent");
    41             var namedFlow = document.webkitGetFlowByName("flow");
     42            var namedFlow = getFlowByName("flow");
    4243
    4344            function hideRegions()
     
    113114            shouldBeEqualToString("regionListTextNode32.item(0).id", "region3");
    114115
    115             var namedFlow2 = document.webkitGetFlowByName("flow2");
     116            var namedFlow2 = getFlowByName("flow2");
    116117            var regionListP1 = namedFlow2.getRegionsByContent(document.getElementById("p1"));
    117118            shouldBeNonNull("regionListP1");
  • trunk/LayoutTests/fast/regions/get-regions-by-content-vert-rl.html

    r124410 r130041  
    33    <head>
    44        <script src="../../fast/js/resources/js-test-pre.js"></script>
     5        <script src="resources/helper.js"></script>
    56        <style>
    67            html { -webkit-writing-mode: vertical-rl; }
     
    3940                window.testRunner.dumpAsText();
    4041            description("Test for 90759: [CSSRegions] Rename NamedFlow::getRegionsByContentNode to NamedFlow::getRegionsByContent");
    41             var namedFlow = document.webkitGetFlowByName("flow");
     42            var namedFlow = getFlowByName("flow");
    4243
    4344            function hideRegions()
     
    113114            shouldBeEqualToString("regionListTextNode32.item(0).id", "region3");
    114115
    115             var namedFlow2 = document.webkitGetFlowByName("flow2");
     116            var namedFlow2 = getFlowByName("flow2");
    116117            var regionListP1 = namedFlow2.getRegionsByContent(document.getElementById("p1"));
    117118            shouldBeNonNull("regionListP1");
  • trunk/LayoutTests/fast/regions/get-regions-by-content.html

    r124410 r130041  
    33    <head>
    44        <script src="../../fast/js/resources/js-test-pre.js"></script>
     5        <script src="resources/helper.js"></script>
    56        <style>
    67            body { font-family: monospace; }
     
    3132            description("Test for 90759: [CSSRegions] Rename NamedFlow::getRegionsByContentNode to NamedFlow::getRegionsByContent.");
    3233
    33             var namedFlow = document.webkitGetFlowByName("flow");
     34            var namedFlow = getFlowByName("flow");
    3435            var targetNode = document.getElementById("p1");
    3536            var regionList = namedFlow.getRegionsByContent(targetNode);
     
    3839            shouldBeEqualToString("regionList.item(0).id", "region");
    3940
    40             namedFlow = document.webkitGetFlowByName("flow2");
     41            namedFlow = getFlowByName("flow2");
    4142            // Test that the p2 element is flown into 2 regions
    4243            targetNode = document.getElementById("p2");
  • trunk/LayoutTests/fast/regions/get-regions-by-content2.html

    r124410 r130041  
    33    <head>
    44        <script src="../../fast/js/resources/js-test-pre.js"></script>
     5        <script src="resources/helper.js"></script>
    56        <style>
    67            body { font-family: monospace; }
     
    2324            description("Test for 90759: [CSSRegions] Rename NamedFlow::getRegionsByContentNode to NamedFlow::getRegionsByContent");
    2425
    25             var namedFlow = document.webkitGetFlowByName("flow");
     26            var namedFlow = getFlowByName("flow");
    2627
    2728            // Getting the regions for a non existant node should return null.
     
    7475            // Move the article to another named flow, the region list should be empty.
    7576            document.getElementById("article").className = "article2";
    76             var namedFlow2 = document.webkitGetFlowByName("flow2");
     77            var namedFlow2 = getFlowByName("flow2");
    7778            var regionList8 = namedFlow2.getRegionsByContent(pElement);
    7879            shouldBeNonNull("regionList8");
  • trunk/LayoutTests/fast/regions/resources/helper.js

    r128416 r130041  
    33    // Add #debug at the end of the url to visually debug the test case.
    44    return window.location.hash == "#debug";
     5}
     6
     7function getFlowByName(name)
     8{
     9    var namedFlows = document.webkitGetNamedFlows();
     10    return namedFlows[name] ? namedFlows[name] : null;
    511}
    612
  • trunk/LayoutTests/fast/regions/webkit-named-flow-event-add-to-flow.html

    r124410 r130041  
    22<head>
    33<script src="../../fast/js/resources/js-test-pre.js"></script>
     4<script src="resources/helper.js"></script>
    45<style>
    56#article {
     
    6162
    6263    function startTest() {
    63         var flow = document.webkitGetFlowByName("article");
     64        var flow = getFlowByName("article");
    6465        flow.addEventListener("webkitRegionLayoutUpdate", regionLayoutUpdated);
    6566       
  • trunk/LayoutTests/fast/regions/webkit-named-flow-event-no-regions.html

    r124410 r130041  
    44<meta charset="utf-8">
    55<script src="../js/resources/js-test-pre.js"></script>
     6<script src="resources/helper.js"></script>
    67<style>
    78#article {
     
    6768
    6869    function startTest() {
    69         var flow = document.webkitGetFlowByName("article");
     70        var flow = getFlowByName("article");
    7071        flow.addEventListener("webkitRegionLayoutUpdate", regionLayoutUpdated);
    7172
  • trunk/LayoutTests/fast/regions/webkit-named-flow-event-remove-from-dom.html

    r124410 r130041  
    22<head>
    33<script src="../../fast/js/resources/js-test-pre.js"></script>
     4<script src="resources/helper.js"></script>
    45<style>
    56#article {
     
    6667   
    6768    function startTest() {
    68         var flow = document.webkitGetFlowByName("article");
     69        var flow = getFlowByName("article");
    6970        flow.addEventListener("webkitRegionLayoutUpdate", regionLayoutUpdated);
    7071       
  • trunk/LayoutTests/fast/regions/webkit-named-flow-event-remove-from-flow.html

    r124410 r130041  
    22<head>
    33<script src="../../fast/js/resources/js-test-pre.js"></script>
     4<script src="resources/helper.js"></script>
    45<style>
    56#article {
     
    6465   
    6566    function startTest() {
    66         var flow = document.webkitGetFlowByName("article");
     67        var flow = getFlowByName("article");
    6768        flow.addEventListener("webkitRegionLayoutUpdate", regionLayoutUpdated);
    6869       
  • trunk/LayoutTests/fast/regions/webkit-named-flow-event-target-expected.txt

    r124350 r130041  
    77PASS event.target.name is "article"
    88PASS 2 is >= updatedCount
    9 PASS document.webkitGetFlowByName("article") is non-null.
     9PASS getFlowByName("article") is non-null.
    1010PASS recreated is false
    11 PASS document.webkitGetFlowByName("article") is null
     11PASS getFlowByName("article") is null
    1212PASS event.target.name is "article"
    1313PASS 2 is >= updatedCount
    1414PASS recreated is true
    15 PASS document.webkitGetFlowByName("article") is non-null.
     15PASS getFlowByName("article") is non-null.
    1616PASS successfullyParsed is true
    1717
  • trunk/LayoutTests/fast/regions/webkit-named-flow-event-target.html

    r124410 r130041  
    44<meta charset="utf-8">
    55<script src="../js/resources/js-test-pre.js"></script>
     6<script src="resources/helper.js"></script>
    67<style>
    78#article {
     
    4950
    5051function makeFlowNull() {
    51         shouldBeNonNull('document.webkitGetFlowByName("article")');
     52        shouldBeNonNull('getFlowByName("article")');
    5253
    5354    var el = document.getElementById("region_1");
     
    6162var recreated = false;
    6263function makeFlowCreated() {
    63         shouldBeNull('document.webkitGetFlowByName("article")');
     64        shouldBeNull('getFlowByName("article")');
    6465        gc();
    6566
     
    9798
    9899function startTest() {   
    99     var flowThread = document.webkitGetFlowByName("article");
     100    var flowThread = getFlowByName("article");
    100101    flowThread.addEventListener("webkitRegionLayoutUpdate", flowThreadUpdated);
    101102   
  • trunk/LayoutTests/fast/regions/webkit-named-flow-event-to-null.html

    r124410 r130041  
    44<meta charset="utf-8">
    55<script src="../js/resources/js-test-pre.js"></script>
     6<script src="resources/helper.js"></script>
    67<style>
    78#article {
     
    8081   
    8182    function startTest() {
    82         var flow = document.webkitGetFlowByName("article");
     83        var flow = getFlowByName("article");
    8384        flow.addEventListener("webkitRegionLayoutUpdate", regionLayoutUpdated);
    8485       
  • trunk/LayoutTests/fast/regions/webkit-named-flow-event.html

    r124410 r130041  
    22<head>
    33<script src="../../fast/js/resources/js-test-pre.js"></script>
     4<script src="resources/helper.js"></script>
    45<style>
    56#article {
     
    5556   
    5657    function startTest() {   
    57         var flowThread = document.webkitGetFlowByName("article");
     58        var flowThread = getFlowByName("article");
    5859        flowThread.addEventListener("webkitRegionLayoutUpdate", flowThreadUpdated);
    5960       
  • trunk/LayoutTests/fast/regions/webkit-named-flow-existing-flow.html

    r124410 r130041  
    77    -->
    88    <head>
     9        <script src="resources/helper.js"></script>
    910        <style>
    1011            .pass {
     
    3334                testRunner.dumpAsText();
    3435
    35             var namedFlow = document.webkitGetFlowByName("flow");
     36            var namedFlow = getFlowByName("flow");
    3637            if (namedFlow) {
    3738                document.getElementById("result").innerText = "PASS";
  • trunk/LayoutTests/fast/regions/webkit-named-flow-first-empty-region-index.html

    r124771 r130041  
    44<meta charset="utf-8">
    55<script src="../../fast/js/resources/js-test-pre.js"></script>
     6<script src="resources/helper.js"></script>
    67<style>
    78    body { font-family: monospace }
     
    2223
    2324    // Named flow does not have any regions yet
    24     var namedFlow = document.webkitGetFlowByName("flow");
     25    var namedFlow = getFlowByName("flow");
    2526
    2627    // FirstEmptyRegionIndex should be -1 for an empty named flow
  • trunk/LayoutTests/fast/regions/webkit-named-flow-flow-added.html

    r124410 r130041  
    77    -->
    88    <head>
     9        <script src="resources/helper.js"></script>
    910        <style>
    1011            .pass {
     
    3839
    3940            // Get the named flow object before adding the flow thread.
    40             var namedFlow = document.webkitGetFlowByName("flow");
     41            var namedFlow = getFlowByName("flow");
    4142            var namedFlow2;
    4243
    4344            function test()
    4445            {
    45                 namedFlow2 = document.webkitGetFlowByName("flow");
     46                namedFlow2 = getFlowByName("flow");
    4647                if (!namedFlow && namedFlow2) {
    4748                    document.getElementById("result").innerText = "PASS";
  • trunk/LayoutTests/fast/regions/webkit-named-flow-get-content-expected.txt

    r122556 r130041  
    44
    55
    6 PASS document.webkitGetFlowByName("flow") is null
     6PASS getFlowByName("flow") is null
    77PASS namedFlowContent3.length is 1
    88PASS namedFlowContent3.item(0).id is "article"
     
    2727PASS namedFlowContent12.length is 1
    2828PASS namedFlowContent12.item(0).id is "article"
    29 PASS document.webkitGetFlowByName("flow2") is null
     29PASS getFlowByName("flow2") is null
    3030PASS namedFlowContent13.length is 0
    3131PASS namedFlowContent14.length is 0
  • trunk/LayoutTests/fast/regions/webkit-named-flow-get-content.html

    r124410 r130041  
    33    <head>
    44        <script src="../../fast/js/resources/js-test-pre.js"></script>
     5        <script src="resources/helper.js"></script>
    56        <style>
    67            #region { -webkit-flow-from: flow; width: 250px; height: 150px; }
     
    2728            article.style.webkitFlowInto = "flow";
    2829
    29             shouldBeNull('document.webkitGetFlowByName("flow")');
     30            shouldBeNull('getFlowByName("flow")');
    3031
    3132            // Append the above element to the DOM. It will be collected by the flow, therefore the contentNodes should have 1 element.
    3233            document.body.appendChild(article);
    33             var namedFlowContent3 = document.webkitGetFlowByName("flow").getContent();
     34            var namedFlowContent3 = getFlowByName("flow").getContent();
    3435            shouldEvaluateTo("namedFlowContent3.length", 1);
    3536            shouldBeEqualToString("namedFlowContent3.item(0).id", "article");
     
    4041            pNode.id = "p1";
    4142            document.getElementById("article").appendChild(pNode);
    42             var namedFlowContent4 = document.webkitGetFlowByName("flow").getContent();
     43            var namedFlowContent4 = getFlowByName("flow").getContent();
    4344            shouldEvaluateTo("namedFlowContent4.length", 1);
    4445            shouldBeEqualToString("namedFlowContent4.item(0).id", "article");
     
    5152            document.body.insertBefore(article2, article);
    5253
    53             var namedFlowContent5 = document.webkitGetFlowByName("flow").getContent();
     54            var namedFlowContent5 = getFlowByName("flow").getContent();
    5455            shouldEvaluateTo("namedFlowContent5.length", 2);
    5556            shouldBeEqualToString("namedFlowContent5.item(0).id", "article2");
     
    6061            regionNode.id = "region";
    6162            document.body.appendChild(regionNode);
    62             var namedFlowContent6 = document.webkitGetFlowByName("flow").getContent();
     63            var namedFlowContent6 = getFlowByName("flow").getContent();
    6364            shouldEvaluateTo("namedFlowContent6.length", 2);
    6465
    6566            // Change display:none for the 'article2' element, the list of contentNodes should stay the same
    6667            document.getElementById("article2").style.display = "block";
    67             var namedFlowContent7 = document.webkitGetFlowByName("flow").getContent();
     68            var namedFlowContent7 = getFlowByName("flow").getContent();
    6869            shouldEvaluateTo("namedFlowContent7.length", 2);
    6970
     
    7778            document.getElementById("article2").appendChild(pNode);
    7879
    79             var namedFlowContent8 = document.webkitGetFlowByName("flow").getContent();
     80            var namedFlowContent8 = getFlowByName("flow").getContent();
    8081            shouldEvaluateTo("namedFlowContent8.length", 3);
    8182
    8283            // Change display of article node to none, the collection should still have 3 elements.
    8384            document.getElementById("article").style.display = "none";
    84             var namedFlowContent9 = document.webkitGetFlowByName("flow").getContent();
     85            var namedFlowContent9 = getFlowByName("flow").getContent();
    8586            shouldEvaluateTo("namedFlowContent9.length", 3);
    8687            shouldBeEqualToString("namedFlowContent9.item(0).id", "article2");
     
    9192            article = document.getElementById("article");
    9293            document.body.insertBefore(document.body.removeChild(article), article2);
    93             var namedFlowContent10 = document.webkitGetFlowByName("flow").getContent();
     94            var namedFlowContent10 = getFlowByName("flow").getContent();
    9495            shouldEvaluateTo("namedFlowContent10.length", 3);
    9596            shouldBeEqualToString("namedFlowContent10.item(0).id", "article");
     
    9899            var article2Clone = document.getElementById("article2").cloneNode(true);
    99100            document.body.appendChild(article2Clone);
    100             var namedFlowContent11 = document.webkitGetFlowByName("flow").getContent();
     101            var namedFlowContent11 = getFlowByName("flow").getContent();
    101102            shouldEvaluateTo("namedFlowContent11.length", 5);
    102103            // Remove article2 nodes from document, they should be removed from flow.
    103104            document.body.removeChild(article2);
    104105            document.body.removeChild(article2Clone);
    105             var namedFlowContent12 = document.webkitGetFlowByName("flow").getContent();
     106            var namedFlowContent12 = getFlowByName("flow").getContent();
    106107            shouldEvaluateTo("namedFlowContent12.length", 1);
    107108            shouldBeEqualToString("namedFlowContent12.item(0).id", "article");
     
    109110            // Move the content node 'article' from named flow 'flow' to named flow 'flow2'
    110111            document.getElementById("article").style.webkitFlowInto = "flow2";
    111             var flow2 = document.webkitGetFlowByName("flow2");
    112             var namedFlowContent11 = document.webkitGetFlowByName("flow").getContent();
    113             var namedFlowContent12 = document.webkitGetFlowByName("flow2").getContent();
     112            var flow2 = getFlowByName("flow2");
     113            var namedFlowContent11 = getFlowByName("flow").getContent();
     114            var namedFlowContent12 = getFlowByName("flow2").getContent();
    114115            shouldEvaluateTo("namedFlowContent11.length", "0");
    115116            shouldEvaluateTo("namedFlowContent12.length", "1");
     
    118119            // Remove the content node from dom, content nodes for both 'flow' and 'flow2' should be empty
    119120            document.body.removeChild(document.getElementById("article"));
    120             shouldBeNull('document.webkitGetFlowByName("flow2")');
     121            shouldBeNull('getFlowByName("flow2")');
    121122
    122             var namedFlowContent13 = document.webkitGetFlowByName("flow").getContent();
     123            var namedFlowContent13 = getFlowByName("flow").getContent();
    123124            shouldEvaluateTo("namedFlowContent13.length", "0");
    124125
  • trunk/LayoutTests/fast/regions/webkit-named-flow-get-regions.html

    r124772 r130041  
    22<head>
    33<script src="../../fast/js/resources/js-test-pre.js"></script>
     4<script src="resources/helper.js"></script>
    45<style>
    56#article {
     
    3435
    3536    function getRegionAt(index) {
    36         var flow = document.webkitGetFlowByName("article");
     37        var flow = getFlowByName("article");
    3738        var regions = flow.getRegions();
    3839        if (regions.length <= index)
  • trunk/LayoutTests/fast/regions/webkit-named-flow-invalid-name.html

    r124410 r130041  
    1919            var arrLen = arrFlowInvalidNames.length;
    2020            for (var i = 0; i < arrLen; ++i) {
    21                 var nullNamedFlow = document.webkitGetFlowByName(arrFlowInvalidNames[i]);
     21                var nullNamedFlow = getFlowByName(arrFlowInvalidNames[i]);
    2222                assert(nullNamedFlow == null, "Named flow for " + arrFlowInvalidNames[i] + " should be null");
    2323            }
    2424
    2525            // It should not be possible to get the NamedFlow object for a missing flow.
    26             var namedFlow = document.webkitGetFlowByName("flow");
     26            var namedFlow = getFlowByName("flow");
    2727            assert(namedFlow == null, "Named flow for flow should be null");
    2828        </script>
  • trunk/LayoutTests/fast/regions/webkit-named-flow-modified-flow.html

    r124410 r130041  
    99    -->
    1010    <head>
     11        <script src="resources/helper.js"></script>
    1112        <style>
    1213            .pass {
     
    4647            function test()
    4748            {
    48                 var namedFlow = document.webkitGetFlowByName("flow");
    49                 var namedFlow2 = document.webkitGetFlowByName("flow2");
     49                var namedFlow = getFlowByName("flow");
     50                var namedFlow2 = getFlowByName("flow2");
    5051                if (!namedFlow && namedFlow2) {
    5152                    document.getElementById("result").innerText = "PASS";
  • trunk/LayoutTests/fast/regions/webkit-named-flow-name.html

    r124410 r130041  
    44<meta charset="utf-8">
    55<script src="../js/resources/js-test-pre.js"></script>
     6<script src="resources/helper.js"></script>
    67<style>
    78    .flow { -webkit-flow-into: flow-name; }
     
    2122
    2223// Flow article does not have any regions yet
    23 var namedFlow = document.webkitGetFlowByName("flow-name");
     24var namedFlow = getFlowByName("flow-name");
    2425
    2526// The name should be 'flow-name' when there are no regions to flow into
  • trunk/LayoutTests/fast/regions/webkit-named-flow-non-existing-flow.html

    r124410 r130041  
    77    -->
    88    <head>
     9        <script src="resources/helper.js"></script>
    910        <style>
    1011            .pass {
     
    2930                testRunner.dumpAsText();
    3031
    31             var namedFlow = document.webkitGetFlowByName("flow");
     32            var namedFlow = getFlowByName("flow");
    3233            if (!namedFlow) {
    3334                document.getElementById("result").innerText = "PASS";
  • trunk/LayoutTests/fast/regions/webkit-named-flow-overset.html

    r124410 r130041  
    44<meta charset="utf-8">
    55<script src="../js/resources/js-test-pre.js"></script>
     6<script src="resources/helper.js"></script>
    67<style>
    78    body { font-family: monospace; }
     
    2526
    2627    // Flow article does not have any regions yet
    27     var namedFlow = document.webkitGetFlowByName("flow");
     28    var namedFlow = getFlowByName("flow");
    2829
    2930    // Overset should be false for a flow without regions
  • trunk/LayoutTests/fast/regions/webkit-named-flow-removed-flow.html

    r124410 r130041  
    77    -->
    88    <head>
     9        <script src="resources/helper.js"></script>
    910        <style>
    1011            .pass {
     
    3839
    3940            // Get the named flow object before removing the flow thread.
    40             var namedFlow = document.webkitGetFlowByName("flow");
     41            var namedFlow = getFlowByName("flow");
    4142            var namedFlow2;
    4243
    4344            function test()
    4445            {
    45                 namedFlow2 = document.webkitGetFlowByName("flow");
     46                namedFlow2 = getFlowByName("flow");
    4647                if (namedFlow && !namedFlow2) {
    4748                    document.getElementById("result").innerText = "PASS";
  • trunk/LayoutTests/fast/regions/webkit-named-flow-same-object.html

    r124410 r130041  
    77    -->
    88    <head>
     9        <script src="resources/helper.js"></script>
    910        <style>
    1011            .pass {
     
    3334                testRunner.dumpAsText();
    3435
    35             var namedFlow = document.webkitGetFlowByName("flow");
    36             var namedFlow2 = document.webkitGetFlowByName("flow");
     36            var namedFlow = getFlowByName("flow");
     37            var namedFlow2 = getFlowByName("flow");
    3738            if (namedFlow === namedFlow2) {
    3839                document.getElementById("result").innerText = "PASS";
  • trunk/Source/WebCore/ChangeLog

    r130032 r130041  
     12012-10-01  Andrei Bucur  <abucur@adobe.com>
     2
     3        [CSS Regions] Remove the deprecated API Document.webkitGetFlowByName
     4        https://bugs.webkit.org/show_bug.cgi?id=97657
     5
     6        Reviewed by Andreas Kling.
     7
     8        The Document.getFlowByName() API has been deprecated in favor of the NamedFlowCollection.namedItem(DOMString).
     9        Link to spec: http://www.w3.org/TR/css3-regions/#the-namedflow-interface
     10
     11        Tests: The old tests have been adapted to use the new API.
     12
     13        * dom/Document.cpp:
     14        (WebCore):
     15        * dom/Document.h:
     16        (Document):
     17        * dom/Document.idl:
     18
    1192012-09-27  Jocelyn Turcotte  <jocelyn.turcotte@digia.com>
    220
  • trunk/Source/WebCore/dom/Document.cpp

    r129903 r130041  
    11431143#if ENABLE(CSS_REGIONS)
    11441144
    1145 PassRefPtr<WebKitNamedFlow> Document::webkitGetFlowByName(const String& flowName)
    1146 {
    1147     if (!cssRegionsEnabled() || !renderer())
    1148         return 0;
    1149 
    1150     // It's possible to have pending styles not applied that affect the existing flows.
    1151     updateStyleIfNeeded();
    1152 
    1153     return namedFlows()->flowByName(flowName);
    1154 }
    1155 
    11561145PassRefPtr<DOMNamedFlowCollection> Document::webkitGetNamedFlows()
    11571146{
  • trunk/Source/WebCore/dom/Document.h

    r129903 r130041  
    360360    bool cssRegionsEnabled() const;
    361361#if ENABLE(CSS_REGIONS)
    362     PassRefPtr<WebKitNamedFlow> webkitGetFlowByName(const String&);
    363362    PassRefPtr<DOMNamedFlowCollection> webkitGetNamedFlows();
    364363#endif
  • trunk/Source/WebCore/dom/Document.idl

    r128374 r130041  
    269269        readonly attribute [Conditional=POINTER_LOCK, V8EnabledAtRuntime=pointerLock] Element webkitPointerLockElement;
    270270
    271         [Conditional=CSS_REGIONS] WebKitNamedFlow webkitGetFlowByName(in DOMString name);
    272271        [Conditional=CSS_REGIONS] DOMNamedFlowCollection webkitGetNamedFlows();
    273272
Note: See TracChangeset for help on using the changeset viewer.