Changeset 117815 in webkit


Ignore:
Timestamp:
May 21, 2012 2:18:32 PM (12 years ago)
Author:
leviw@chromium.org
Message:

Enable SUBPIXEL_LAYOUT feature flag on Chromium
https://bugs.webkit.org/show_bug.cgi?id=85555

Source/WTF:

Reviewed by Eric Seidel.

Enabling sub-pixel layout on Chromium port.

  • wtf/Platform.h:

LayoutTests:

Patch by Levi Weintraub <leviw@chromium.org> and Emil A Eklund <eae@chromium.org> on 2012-05-21
Reviewed by Eric Seidel.

Updating tests to handle sub-pixel layout, and updating chromium-linux expecations. Updated test
expectations for Chromium Linux and Mac are ready, but the diff is too large for Buzgilla's tiny
brain (>10MB).

  • css1/units/rounding.html:
  • fast/borders/border-radius-huge-assert.html:
  • fast/css/zoom-in-length-round-trip.html:
  • fast/dom/Document/CaretRangeFromPoint/hittest-relative-to-viewport.html:
  • fast/dom/Window/webkitConvertPoint.html:
  • fast/dom/elementFromPoint-relative-to-viewport.html:
  • fast/events/clientXY-in-zoom-and-scroll.html:
  • fast/events/document-elementFromPoint.html:
  • fast/events/offsetX-offsetY.html:
  • fast/multicol/break-properties.html:
  • fast/multicol/vertical-lr/break-properties.html:
  • fast/multicol/vertical-rl/break-properties.html:
  • fast/regions/region-style-rule-specificity.html:
  • fast/replaced/table-percent-height.html:
Location:
trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r117811 r117815  
     12012-05-21  Levi Weintraub  <leviw@chromium.org> and Emil A Eklund <eae@chromium.org>
     2
     3        Enable SUBPIXEL_LAYOUT feature flag on Chromium
     4        https://bugs.webkit.org/show_bug.cgi?id=85555
     5
     6        Reviewed by Eric Seidel.
     7
     8        Updating tests to handle sub-pixel layout, and updating chromium-linux expecations. Updated test
     9        expectations for Chromium Linux and Mac are ready, but the diff is too large for Buzgilla's tiny
     10        brain (>10MB).
     11
     12        * css1/units/rounding.html:
     13        * fast/borders/border-radius-huge-assert.html:
     14        * fast/css/zoom-in-length-round-trip.html:
     15        * fast/dom/Document/CaretRangeFromPoint/hittest-relative-to-viewport.html:
     16        * fast/dom/Window/webkitConvertPoint.html:
     17        * fast/dom/elementFromPoint-relative-to-viewport.html:
     18        * fast/events/clientXY-in-zoom-and-scroll.html:
     19        * fast/events/document-elementFromPoint.html:
     20        * fast/events/offsetX-offsetY.html:
     21        * fast/multicol/break-properties.html:
     22        * fast/multicol/vertical-lr/break-properties.html:
     23        * fast/multicol/vertical-rl/break-properties.html:
     24        * fast/regions/region-style-rule-specificity.html:
     25        * fast/replaced/table-percent-height.html:
     26
    1272012-05-21  Anna Cavender  <annacc@chromium.org>
    228
  • trunk/LayoutTests/css1/units/rounding.html

    r99258 r117815  
    3737var divtop = document.getElementById("top").getBoundingClientRect();
    3838var divbottom = document.getElementById("bottom").getBoundingClientRect();
    39 shouldBe('divtop.bottom', '31');
    40 shouldBe('divbottom.top', '31');
     39shouldBe('Math.round(divtop.bottom)', '31');
     40shouldBe('Math.round(divbottom.top)', '31');
    4141
    4242</script>
  • trunk/LayoutTests/fast/borders/border-radius-huge-assert.html

    r44235 r117815  
    1717    <div style="-webkit-border-radius: 926179103pt 10px;"></div>
    1818    <div style="-webkit-border-radius: 10px 926179103pt;"></div>
    19     <div style="-webkit-border-radius: 926179103pt;"></div>
     19    <div style="-webkit-border-radius: 9261791pt;"></div>
    2020
    2121</body>
  • trunk/LayoutTests/fast/css/zoom-in-length-round-trip.html

    r42211 r117815  
    2626    for (zoom = 100; zoom <= 200; zoom += 1) {
    2727        containerStyle.setProperty("zoom", zoom / 100);
    28         var width = target.offsetWidth;
    29         var height = target.offsetHeight;
     28        var rect = target.getBoundingClientRect();
     29        var width = Math.round(rect.right - rect.left);
     30        var height = Math.round(rect.bottom - rect.top);
    3031        if (width !== 1 || height !== 10) {
    3132            failed = true;
  • trunk/LayoutTests/fast/dom/Document/CaretRangeFromPoint/hittest-relative-to-viewport.html

    r98407 r117815  
    11<script src="../../../js/resources/js-test-pre.js"></script>
    2 <style>
     2<style>
     3    #subpixel-test {
     4        width: 4.5px;
     5    }
    36    .test {
    47        width: 100px;
     
    2124<p id="description"></p>
    2225<div id="console"></div>
     26<div id="subpixel-test"></div>
    2327
    2428<script>
     29    var r = document.getElementById('subpixel-test').getBoundingClientRect();
     30    var hasSubpixelSupport = r.right - r.left == 4.5;
     31   
    2532    if (window.layoutTestController)
    2633        layoutTestController.dumpAsText();
     
    6572
    6673        if (zoomOrNot == "zoom") {
    67             test(1, 0, 0);
    68             test(13, 0, 25);
     74            test(hasSubpixelSupport ? 0 : 1, 0, 0);
     75            test(hasSubpixelSupport ? 12 : 13, 0, 25);
    6976            test(4, 50, 0);
    7077            test(16, 50, 25);
  • trunk/LayoutTests/fast/dom/Window/webkitConvertPoint.html

    r98733 r117815  
    1414          font-size: 14pt;
    1515      }
     16      #subpixel-test {
     17          width: 4.5px;
     18       }
    1619      .layer {
    1720        position: relative;
     
    105108       
    106109        function run() {
     110            var r = document.getElementById('subpixel-test').getBoundingClientRect();
     111            var hasSubpixelSupport = r.right - r.left == 4.5;
     112
    107113            description("This test exercises the webkitConvertPointFromNodeToPage() function");
    108114           
     
    129135            debug("Test did not crash and therefore was successful");
    130136
    131             runTest("Test 1",  "test1",  8, 12, 13, 52);
    132             runTest("Test 2",  "test2",  8, 50, 13, 90);
    133             runTest("Test 3",  "test3",  8, 84, 13, 124);
    134             runTest("Test 4",  "test4",  8, 118, 13, 158);
    135             runTest("Test 5",  "test5",  28, 152, 33, 192);
    136             runTest("Test 6",  "test6",  28, 186, 33, 226);
    137             runTest("Test 7",  "test7",  8, 238, 13, 278);
    138             runTest("Test 8",  "test8",  8, 272, 13, 312);
    139             runTest("Test 9",  "test9",  28, 290, 33, 330);
    140             runTest("Test 10", "test10", 28, 308, 33, 348);
    141             runTest("Test 11", "test11", 158, 355, 174, 373);
    142             runTest("Test 12", "test12", 168, 428, 184, 446);
    143             runTest("Test 13", "test13", 28, 486, 33, 526);
     137            if (hasSubpixelSupport) {
     138                runTest("Test 1",  "test1",  8, 13, 13, 53);
     139                runTest("Test 2",  "test2",  8, 51, 13, 91);
     140                runTest("Test 3",  "test3",  8, 85, 13, 125);
     141                runTest("Test 4",  "test4",  8, 119, 13, 159);
     142                runTest("Test 5",  "test5",  28, 153, 33, 193);
     143                runTest("Test 6",  "test6",  28, 187, 33, 227);
     144                runTest("Test 7",  "test7",  8, 239, 13, 279);
     145                runTest("Test 8",  "test8",  8, 273, 13, 313);
     146                runTest("Test 9",  "test9",  28, 291, 33, 331);
     147                runTest("Test 10", "test10", 28, 309, 33, 349);
     148                runTest("Test 11", "test11", 158, 355, 174, 373);
     149                runTest("Test 12", "test12", 168, 428, 184, 446);
     150                runTest("Test 13", "test13", 28, 487, 33, 527);
     151            } else {
     152                runTest("Test 1",  "test1",  8, 12, 13, 52);
     153                runTest("Test 2",  "test2",  8, 50, 13, 90);
     154                runTest("Test 3",  "test3",  8, 84, 13, 124);
     155                runTest("Test 4",  "test4",  8, 118, 13, 158);
     156                runTest("Test 5",  "test5",  28, 152, 33, 192);
     157                runTest("Test 6",  "test6",  28, 186, 33, 226);
     158                runTest("Test 7",  "test7",  8, 238, 13, 278);
     159                runTest("Test 8",  "test8",  8, 272, 13, 312);
     160                runTest("Test 9",  "test9",  28, 290, 33, 330);
     161                runTest("Test 10", "test10", 28, 308, 33, 348);
     162                runTest("Test 11", "test11", 158, 355, 174, 373);
     163                runTest("Test 12", "test12", 168, 428, 184, 446);
     164                runTest("Test 13", "test13", 28, 486, 33, 526);
     165            }
    144166           
    145167            isSuccessfullyParsed();
     
    184206        <div id="description"></div>
    185207        <div id="console"></div>
     208        <div id="subpixel-test"></div>
    186209    </body>
    187210</html>
  • trunk/LayoutTests/fast/dom/elementFromPoint-relative-to-viewport.html

    r98407 r117815  
    1919        outline: 1px solid black;
    2020    }
     21    #subpixel-test {
     22      width: 4.5px;
     23    }
    2124</style>
    2225<div id="testArea">
     
    2629    <div id="test-offscreen" class="test"></div>
    2730    <div class="pusher">This box is here to create even more scrollbars!</div>
     31    <div id="subpixel-test"></div>
    2832</div>
    2933<p id="description"></p>
    3034<div id="console"></div>
    3135<script>
     36    var r = document.getElementById('subpixel-test').getBoundingClientRect();
     37    var hasSubpixelSupport = r.right - r.left == 4.5;
     38
    3239    window.onclick = function(e)
    3340    {
     
    4047    description('This test document.elementFromPoint is evaluated in with respect to the viewport, not the document.');
    4148
    42     function testElement(element, label, offsetX, offsetY) {
     49    function testElement(element, label, offsetX, offsetY, hasZoom) {
    4350        for (var i = 0; i < 25; ++i) {
    4451            var item = document.createElement("div");
     
    8188
    8289        shouldBe(unscrolledBox, "'0'");
    83         shouldBe(scrolledDownBox, "'5'");
     90        shouldBe(scrolledDownBox, hasSubpixelSupport && hasZoom ? "'4'" : "'5'");
    8491        shouldBe(scrolledRightBox, "'3'");
    85         shouldBe(scrolledDownAndRightBox, "'8'");
     92        shouldBe(scrolledDownAndRightBox, hasSubpixelSupport && hasZoom  ? "'7'" : "'8'");
    8693    }
    8794
     
    93100
    94101    eventSender.zoomPageOut();
    95     testElement(elementInitial, "Initial", offset.left, offset.top);
     102    testElement(elementInitial, "Initial", offset.left, offset.top, /* hasZoom */ true);
    96103
    97104    if (window.layoutTestController) {
  • trunk/LayoutTests/fast/events/clientXY-in-zoom-and-scroll.html

    r98407 r117815  
    66        outline: 1px solid black;
    77    }
     8    #subpixel-test {
     9        width: 4.5px;
     10    }
    811</style>
    912<div id="console"></div>
    1013<div id="testArea">
    1114    <div id="pusher">This box is here to create scrollbars.</div>
     15    <div id="subpixel-test"></div>
    1216</div>
    1317<script>
     18    var r = document.getElementById('subpixel-test').getBoundingClientRect();
     19    var hasSubpixelSupport = r.right - r.left == 4.5;
     20
    1421    var event;
    1522
     
    98105        event = e;
    99106        debug("\nZoomed and scrolled");
    100         shouldBe("event.clientX", "84");
    101         shouldBe("event.clientY", "84");
     107        shouldBe("event.clientX", hasSubpixelSupport ? "83" : "84");
     108        shouldBe("event.clientY", hasSubpixelSupport ? "83" : "84");
    102109        shouldBe("event.pageX", "133");
    103110        shouldBe("event.pageY", "133");
  • trunk/LayoutTests/fast/events/document-elementFromPoint.html

    r89363 r117815  
    126126    top: 670px;
    127127    color: gray;
     128}
     129
     130#subpixel-test {
     131    width: 4.5px;
    128132}
    129133</style>
     
    196200<div id="mouse-position"></div>
    197201
     202<!-- Test for subpixel support -->
     203<div id="subpixel-test"></div>
    198204<script>
    199205// Debug mode.
     
    248254document.body.addEventListener('click', clicked, false);
    249255window.addEventListener('load', function() {
     256    var r = document.getElementById('subpixel-test').getBoundingClientRect();
     257    var hasSubpixelSupport = r.right - r.left == 4.5;
     258
    250259    setTimeout(function() {
    251260        // Scroll body and inner overflow box.
     
    261270            dispatchEvent(122, 407, 'transformed', 18, 15);
    262271            dispatchEvent(573, 480, 'inside-overflow', 2, 9);
    263             dispatchEvent(707, 174, 'in-columns', 88, 13);
     272            dispatchEvent(707, 174, 'in-columns', hasSubpixelSupport ? 87 : 88, 13);
    264273            dispatchEvent(241, 67, 'fixed', 41, 17);
    265274            dispatchEvent(244, 102, 'fixed', 44, 52);
  • trunk/LayoutTests/fast/events/offsetX-offsetY.html

    r101755 r117815  
    2424    function test()
    2525    {
     26      var r = document.getElementById('subpixel-test').getBoundingClientRect();
     27      var hasSubpixelSupport = r.right - r.left == 4.5;
     28
    2629      // Scroll so that frame view offsets are non-zero
    2730      window.scrollTo(20, 100);
     
    3841      dispatchEvent(410, 30, 'fixed-box', 10, 10);
    3942      dispatchEvent(36, 272, 'with-bordertopextra', 4, 4);
    40       dispatchEvent(639, 207, 'in-columns', 35, 5);
     43      dispatchEvent(639, 207, 'in-columns', hasSubpixelSupport ? 34 : 35, 5);
    4144      dispatchEvent(563, 410, 'inside-overflow', 7, 6);
    4245      dispatchEvent(112, 369, 'transformed', 11, 16);
     
    182185/*      -webkit-transform: rotate(10deg);*/
    183186    }
     187
     188    #subpixel-test {
     189      width: 4.5px;
     190    }
    184191  </style>
    185192</head>
     
    223230<div id="results"></div>
    224231<div id="mousepos"></div>
     232<div id="subpixel-test"></div>
    225233
    226234</body>
  • trunk/LayoutTests/fast/multicol/break-properties.html

    r90573 r117815  
    2525    {
    2626        var rect = document.getElementById(id).getBoundingClientRect();
    27         if (rect.left === expectedLeft && rect.top === expectedTop)
     27        if (Math.round(rect.left) === expectedLeft && Math.round(rect.top) === expectedTop)
    2828            log("PASS: '" + id + "' is at (" + expectedLeft + ", " + expectedTop + ")");
    2929        else
    30             log("FAIL: '" + id + "' is at (" + rect.left + ", " + rect.top + ") instead of (" + expectedLeft + " ," + expectedTop + ")");
     30            log("FAIL: '" + id + "' is at (" + Math.round(rect.left) + ", " + Math.round(rect.top) + ") instead of (" + expectedLeft + " ," + expectedTop + ")");
    3131    }
    3232
    33     testBoxPosition("break-before", 218, 8);
    34     testBoxPosition("after-break", 428, 8);
    35     testBoxPosition("no-break", 533, 8);
     33    var rect = document.getElementById('break-before').getBoundingClientRect();
     34    var hasSubpixelSupport = Math.round(rect.left) != rect.left;
     35
     36    testBoxPosition("break-before", hasSubpixelSupport ? 220 : 218, 8);
     37    testBoxPosition("after-break", hasSubpixelSupport ? 431 : 428, 8);
     38    testBoxPosition("no-break", hasSubpixelSupport ? 537 : 533, 8);
    3639</script>
  • trunk/LayoutTests/fast/multicol/vertical-lr/break-properties.html

    r76726 r117815  
    2626    {
    2727        var rect = document.getElementById(id).getBoundingClientRect();
    28         if (rect.left === expectedLeft && rect.top === expectedTop)
     28        if (Math.round(rect.left) === expectedLeft && Math.round(rect.top) === expectedTop)
    2929            log("PASS: '" + id + "' is at (" + expectedLeft + ", " + expectedTop + ")");
    3030        else
    31             log("FAIL: '" + id + "' is at (" + rect.left + ", " + rect.top + ") instead of (" + expectedLeft + " ," + expectedTop + ")");
     31            log("FAIL: '" + id + "' is at (" + Math.round(rect.left) + ", " + Math.round(rect.top) + ") instead of (" + expectedLeft + " ," + expectedTop + ")");
    3232    }
    3333
    34     testBoxPosition("break-before", 8, 218);
    35     testBoxPosition("after-break", 8, 428);
     34    var rect = document.getElementById('break-before').getBoundingClientRect();
     35    var hasSubpixelSupport = Math.round(rect.top) != rect.top;
     36
     37    testBoxPosition("break-before", 8, hasSubpixelSupport ? 220 : 218);
     38    testBoxPosition("after-break", 8, hasSubpixelSupport ? 431 : 428);
    3639</script>
  • trunk/LayoutTests/fast/multicol/vertical-rl/break-properties.html

    r76726 r117815  
    2929    {
    3030        var rect = document.getElementById(id).getBoundingClientRect();
    31         if (rect.left === expectedLeft && rect.top === expectedTop)
     31        if (Math.round(rect.left) === expectedLeft && Math.round(rect.top) === expectedTop)
    3232            log("PASS: '" + id + "' is at (" + expectedLeft + ", " + expectedTop + ")");
    3333        else
    34             log("FAIL: '" + id + "' is at (" + rect.left + ", " + rect.top + ") instead of (" + expectedLeft + " ," + expectedTop + ")");
     34            log("FAIL: '" + id + "' is at (" + Math.round(rect.left) + ", " + Math.round(rect.top) + ") instead of (" + expectedLeft + " ," + expectedTop + ")");
    3535    }
    3636
    37     testBoxPosition("break-before", 748, 218);
    38     testBoxPosition("after-break", 748, 428);
     37    var rect = document.getElementById('break-before').getBoundingClientRect();
     38    var hasSubpixelSupport = Math.round(rect.top) != rect.top;
     39
     40    testBoxPosition("break-before", 748, hasSubpixelSupport ? 220 : 218);
     41    testBoxPosition("after-break", 748, hasSubpixelSupport ? 431 : 428);
    3942</script>
  • trunk/LayoutTests/fast/regions/region-style-rule-specificity.html

    r111667 r117815  
    11<!doctype html>
    22<html>
    3         <head>
    4                 <style>
    5                 body {
    6                         font-family: monospace;
    7                         font-size: 1em;
    8                 }
    9                 p {
    10                         margin: 0;
    11                         line-height: 1em;
    12                 }
    13                 .container {
    14                         background-color: lightgray;
    15                         width: 15em;
    16                         height: 5em;
    17                 }
    18                 /* selector specificity
    19                 #id => 100
    20                 .class => 10
    21                 element => 1
    22                 */
    23                 /*
    24                 selector position
    25                 in style="" attribute
    26                 in <style/> element / external file
    27                 */
     3        <head>
     4                <style>
     5                body {
     6                        font-family: monospace;
     7                        font-size: 1em;
     8                }
     9                p {
     10                        margin: 0;
     11                        line-height: 1em;
     12                }
     13                .container {
     14                        background-color: lightgray;
     15                        width: 15em;
     16                        height: 5em;
     17                }
     18                /* selector specificity
     19                #id => 100
     20                .class => 10
     21                element => 1
     22                */
     23                /*
     24                selector position
     25                in style="" attribute
     26                in <style/> element / external file
     27                */
    2828
    29                 /* Testing selector specificity is respected in @region style blocks */
    30                 #f1 {
    31                         -webkit-flow-into: flow1;
    32                 }
    33                 #r1 {
    34                         -webkit-flow-from: flow1;
    35                 }
    36                 @-webkit-region #r1 {
    37                         * {
    38                                 background-color: yellow;
    39                         }
    40                         p {
    41                                 background-color: lightgreen;
    42                         }
    43                         .cr1 {
    44                                 background-color: lime;
    45                         }
    46                         #p1 {
    47                                 background-color: green;
    48                         }
    49                 }
     29                /* Testing selector specificity is respected in @region style blocks */
     30                #f1 {
     31                        -webkit-flow-into: flow1;
     32                }
     33                #r1 {
     34                        -webkit-flow-from: flow1;
     35                }
     36                @-webkit-region #r1 {
     37                        * {
     38                                background-color: yellow;
     39                        }
     40                        p {
     41                                background-color: lightgreen;
     42                        }
     43                        .cr1 {
     44                                background-color: lime;
     45                        }
     46                        #p1 {
     47                                background-color: green;
     48                        }
     49                }
    5050
    51                 /* Testing selector position is respected in @region style blocks */
    52                 #f2 {
    53                         -webkit-flow-into: flow2;
    54                 }
    55                 #r2 {
    56                         -webkit-flow-from: flow2;
    57                 }
    58                 @-webkit-region #r2 {
    59                         p, .cr21, #p2 {
    60                                 background-color: red;
    61                         }
    62                 }
    63                 @-webkit-region #r2 {
    64                         p {
    65                                 background-color: lightgreen;
    66                         }
    67                         .cr22 {
    68                                 background-color: lime;
    69                         }
    70                         #p2 {
    71                                 background-color: green;
    72                         }
    73                 }
     51                /* Testing selector position is respected in @region style blocks */
     52                #f2 {
     53                        -webkit-flow-into: flow2;
     54                }
     55                #r2 {
     56                        -webkit-flow-from: flow2;
     57                }
     58                @-webkit-region #r2 {
     59                        p, .cr21, #p2 {
     60                                background-color: red;
     61                        }
     62                }
     63                @-webkit-region #r2 {
     64                        p {
     65                                background-color: lightgreen;
     66                        }
     67                        .cr22 {
     68                                background-color: lime;
     69                        }
     70                        #p2 {
     71                                background-color: green;
     72                        }
     73                }
    7474
    75                 /* More specific selector in flowed content than in @region style */
    76                 .c3 {
    77                         background-color: lime;
    78                 }
    79                 #p31, #p32 {
    80                         background-color: lime;
    81                 }
    82                 #f3 {
    83                         -webkit-flow-into: flow3;
    84                 }
    85                 #r3 {
    86                         -webkit-flow-from: flow3;
    87                 }
    88                 @-webkit-region #r3 {
    89                         p, .cr3 {
    90                                 background-color: red;
    91                         }
    92                 }
     75                /* More specific selector in flowed content than in @region style */
     76                .c3 {
     77                        background-color: lime;
     78                }
     79                #p31, #p32 {
     80                        background-color: lime;
     81                }
     82                #f3 {
     83                        -webkit-flow-into: flow3;
     84                }
     85                #r3 {
     86                        -webkit-flow-from: flow3;
     87                }
     88                @-webkit-region #r3 {
     89                        p, .cr3 {
     90                                background-color: red;
     91                        }
     92                }
    9393
    94                 /* Flowed content has style attribute */
    95                 #f4 {
    96                         -webkit-flow-into: flow4;
    97                 }
    98                 #r4 {
    99                         -webkit-flow-from: flow4;
    100                 }
    101                 @-webkit-region #r4 {
    102                         p, #p4, .cr4 {
    103                                 background-color: red;
    104                         }
    105                 }
    106                 </style>
    107         </head>
    108         <body>
    109                 <!-- Flowed content -->
    110                 <div id='f1'>
    111                         <p>Plain paragraph</p>
    112                         <p class='cr1'>Styled with class</p>
    113                         <p id='p1'>Styled with ID</p>
    114                 </div>
    115                 <div id='f2'>
    116                         <p>Plain paragraph</p>
    117                         <p class='cr21 cr22'>Styled with class</p>
    118                         <p id='p2'>Styled with ID</p>
    119                 </div>
    120                 <div id='f3'>
    121                         <p class='c3'>Class in content</p>
    122                         <p id='p31'>ID in content</p>
    123                         <p class='cr3' id='p32'>ID in content</p>
    124                 </div>
    125                 <div id='f4'>
    126                         <p style='background-color: lime;' >Element style in region</p>
    127                         <p style='background-color: lime;' id='p2'>ID style in region</p>
    128                         <p style='background-color: lime;' class='cr2'>Class in region</p>
    129                 </div>
     94                /* Flowed content has style attribute */
     95                #f4 {
     96                        -webkit-flow-into: flow4;
     97                }
     98                #r4 {
     99                        -webkit-flow-from: flow4;
     100                }
     101                @-webkit-region #r4 {
     102                        p, #p4, .cr4 {
     103                                background-color: red;
     104                        }
     105                }
     106                </style>
     107        </head>
     108        <body>
     109                <!-- Flowed content -->
     110                <div id='f1'>
     111                        <p>Plain paragraph</p>
     112                        <p class='cr1'>Styled with class</p>
     113                        <p id='p1'>Styled with ID</p>
     114                </div>
     115                <div id='f2'>
     116                        <p>Plain paragraph</p>
     117                        <p class='cr21 cr22'>Styled with class</p>
     118                        <p id='p2'>Styled with ID</p>
     119                </div>
     120                <div id='f3'>
     121                        <p class='c3'>Class in content</p>
     122                        <p id='p31'>ID in content</p>
     123                        <p class='cr3' id='p32'>ID in content</p>
     124                </div>
     125                <div id='f4'>
     126                        <p style='background-color: lime;' >Element style in region</p>
     127                        <p style='background-color: lime;' id='p2'>ID style in region</p>
     128                        <p style='background-color: lime;' class='cr2'>Class in region</p>
     129                </div>
    130130
    131                 <!-- Regions -->
    132                 <h1>Testing CSS selectors specificity/position is respected when using @region styling</h1>
     131                <!-- Regions -->
     132                <h1>Testing CSS selectors specificity/position is respected when using @region styling</h1>
    133133
    134                 Selector specificity in @region rule
    135                 <div class='container' id='r1'></div>
    136                 Selector position in @region rule
    137                 <div class='container' id='r2'></div>
    138                 More specific selector in flowed content
    139                 <div class='container' id='r3'></div>
    140                 Style attribute in flowed content
    141                 <div class='container' id='r4'></div>
    142         </body>
     134                Selector specificity in @region rule
     135                <div class='container' id='r1'></div>
     136                Selector position in @region rule
     137                <div class='container' id='r2'></div>
     138                More specific selector in flowed content
     139                <div class='container' id='r3'></div>
     140                Style attribute in flowed content
     141                <div class='container' id='r4'></div>
     142        </body>
    143143</html>
  • trunk/LayoutTests/fast/replaced/table-percent-height.html

    r98733 r117815  
    4242}
    4343
    44 function is75PercentOf(expression75, expression100)
     44function is75PercentOf(expression75, expression100, hasSubpixelSupport)
    4545{
    4646    var str75 = eval(expression75);
     
    5050    if (num75 < 0 || num100 < 0)
    5151        return;
    52     if (num75 == Math.floor(num100 * 75 / 100))
     52    var expectedValue = num100 * 75 / 100;
     53    if (!hasSubpixelSupport)
     54        expectedValue = Math.floor(expectedValue);
     55    if (num75 == expectedValue)
    5356        testPassed(expression75 + " is 75% of " + expression100 + ".");
    5457    else
     
    6063    description("This test checks that replaced elements with percentage heights within table cells have the correct height.<br>Note, some of the button height tests fail on the Windows ports. See bug #34071.");
    6164
    62     shouldBe("getWidth('canvas-75')", "'224px'");
    63     shouldBe("getHeight('canvas-75')", "'112px'");
     65    var hasSubpixelSupport = getWidth('canvas-75') == '225px';
     66
     67    shouldBe("getWidth('canvas-75')", hasSubpixelSupport ? "'225px'" : "'224px'");
     68    shouldBe("getHeight('canvas-75')", hasSubpixelSupport ? "'112.5px'" : "'112px'");
    6469    shouldBe("getWidth('canvas-100')", "'300px'");
    6570    shouldBe("getHeight('canvas-100')", "'150px'");
    6671
    6772    shouldBe("getWidth('embed-75')", "'300px'");
    68     shouldBe("getHeight('embed-75')", "'112px'");
     73    shouldBe("getHeight('embed-75')", hasSubpixelSupport ? "'112.5px'" : "'112px'");
    6974    shouldBe("getWidth('embed-100')", "'300px'");
    7075    shouldBe("getHeight('embed-100')", "'150px'");
     
    8186
    8287    shouldBe("getWidth('object-75')", "'300px'");
    83     shouldBe("getHeight('object-75')", "'112px'");
     88    shouldBe("getHeight('object-75')", hasSubpixelSupport ? "'112.5px'" : "'112px'");
    8489    shouldBe("getWidth('object-100')", "'300px'");
    8590    shouldBe("getHeight('object-100')", "'150px'");
     
    96101    shouldBeTrue("getHeight('input-checkbox-75') != '0px'");
    97102    // Note: This behavior doesn't match to Firefox 3.5 and Opera 10.
    98     is75PercentOf("getHeight('input-checkbox-75')", "getHeight('input-checkbox-100')");
     103    is75PercentOf("getHeight('input-checkbox-75')", "getHeight('input-checkbox-100')", hasSubpixelSupport);
    99104
    100105    shouldBe("getWidth('input-file-75')", "getWidth('input-file-100')");
    101106    shouldBeTrue("getHeight('input-file-75') != '0px'");
    102107    // Note: This behavior doesn't match to Firefox 3.5 and Opera 10.
    103     is75PercentOf("getHeight('input-file-75')", "getHeight('input-file-100')");
     108    is75PercentOf("getHeight('input-file-75')", "getHeight('input-file-100')", hasSubpixelSupport);
    104109
    105110    // Note: This behavior doesn't match to Firefox 3.5 and Opera 10.
     
    112117    shouldBeTrue("getHeight('input-radio-75') != '0px'");
    113118    // Note: This behavior doesn't match to Firefox 3.5 and Opera 10.
    114     is75PercentOf("getHeight('input-radio-75')", "getHeight('input-radio-100')");
     119    is75PercentOf("getHeight('input-radio-75')", "getHeight('input-radio-100')", hasSubpixelSupport);
    115120
    116121    shouldBe("getWidth('input-reset-75')", "getWidth('input-reset-100')");
  • trunk/Source/WTF/ChangeLog

    r117809 r117815  
     12012-05-21  Emil A Eklund <eae@chromium.org> and Levi Weintraub  <leviw@chromium.org>
     2
     3        Enable SUBPIXEL_LAYOUT feature flag on Chromium
     4        https://bugs.webkit.org/show_bug.cgi?id=85555
     5
     6        Reviewed by Eric Seidel.
     7
     8        Enabling sub-pixel layout on Chromium port.
     9
     10        * wtf/Platform.h:
     11
    1122012-05-21  Andreas Kling  <kling@webkit.org>
    213
  • trunk/Source/WTF/wtf/Platform.h

    r117115 r117815  
    822822
    823823#if !defined(ENABLE_SUBPIXEL_LAYOUT)
     824#if PLATFORM(CHROMIUM)
     825#define ENABLE_SUBPIXEL_LAYOUT 1
     826#else
    824827#define ENABLE_SUBPIXEL_LAYOUT 0
     828#endif
    825829#endif
    826830
Note: See TracChangeset for help on using the changeset viewer.