Changeset 201677 in webkit


Ignore:
Timestamp:
Jun 3, 2016 7:04:58 PM (8 years ago)
Author:
mmaxfield@apple.com
Message:

Bopomofo ruby in Dictionary.app is written horizontally (when it should be written vertically)
https://bugs.webkit.org/show_bug.cgi?id=158245
<rdar://problem/25675318>

Reviewed by Darin Adler.

Source/WebCore:

With orthogonal flows, the inner element gets a logical width that is computed from two values:

  • The containing block's available logical height
  • The FrameView's visibleHeight

In Dictionary.app, the FrameView's height changes, but this element doesn't get relaid out.
This is because of our optimization where normal-flow elements don't get relaid out if their
parent's width doesn't change (which is the case here).

Therefore, this orthogonal writing mode element should be relaid out when the FrameView changes
size. Luckily, we already have machinery for doing this: percentage heights. In quirks mode, a
div with a percentage height may walk arbitrarily far up the DOM tree in order to determine which
element the percentage should be resolved against. Therefore, we have a map of percentage-sizing-
ancestors to percentage-sizing-descendants which speeds up this search. If a percentage-sizing-
ancestor gets relaid out, all the relevant percentage-sizing-descendants get relaid out too.

Therefore, we can simply mark the FrameView as a percentage-sizing-ancestor and the orthogonal
flow element as a percentage-sizing-descendant. The lifetime of this relationship is already
managed correctly - it gets reset when style changes and when the renderer is destroyed, and
is created during layout.

Unfortunately, this same treatment should also be done to the element which dictates the
containing block's logical height (which caused https://bugs.webkit.org/show_bug.cgi?id=158286).
Implementing this would require giving RenderBox::availableLogicalHeight() a second result
of the necessary element which dictates the return. In an effort to keep this patch small and
focused, I'll do this secondary (much larger) work in a patch on that bug. This patch,
therefore, is kept small and focused.

Test: fast/text/orthogonal-writing-mode-containing-block-frameView-resize-relayout.html

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::perpendicularContainingBlockLogicalHeight):

LayoutTests:

Rebaselined fast/table/border-collapsing/004-vertical.html to show a progression.

  • fast/text/orthogonal-writing-mode-containing-block-frameView-resize-relayout-expected.html: Added.
  • fast/text/orthogonal-writing-mode-containing-block-frameView-resize-relayout.html: Added.
  • platform/mac/fast/table/border-collapsing/004-vertical-expected.png: Rebased
  • platform/mac/fast/table/border-collapsing/004-vertical-expected.txt: Rebased
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r201676 r201677  
     12016-06-03  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Bopomofo ruby in Dictionary.app is written horizontally (when it should be written vertically)
     4        https://bugs.webkit.org/show_bug.cgi?id=158245
     5        <rdar://problem/25675318>
     6
     7        Reviewed by Darin Adler.
     8
     9        Rebaselined fast/table/border-collapsing/004-vertical.html to show a progression.
     10
     11        * fast/text/orthogonal-writing-mode-containing-block-frameView-resize-relayout-expected.html: Added.
     12        * fast/text/orthogonal-writing-mode-containing-block-frameView-resize-relayout.html: Added.
     13        * platform/mac/fast/table/border-collapsing/004-vertical-expected.png: Rebased
     14        * platform/mac/fast/table/border-collapsing/004-vertical-expected.txt: Rebased
     15
    1162016-06-03  Myles C. Maxfield  <mmaxfield@apple.com>
    217
  • trunk/LayoutTests/platform/mac/fast/table/border-collapsing/004-vertical-expected.txt

    r195740 r201677  
    1 layer at (0,0) size 1532x899
     1layer at (0,0) size 1550x884
    22  RenderView at (0,0) size 785x585
    3 layer at (0,0) size 785x899
    4   RenderBlock {HTML} at (0,0) size 785x899
    5     RenderBody {BODY} at (8,21) size 769x870
     3layer at (0,0) size 785x884
     4  RenderBlock {HTML} at (0,0) size 785x884
     5    RenderBody {BODY} at (8,21) size 769x855
    66      RenderBlock {H1} at (0,0) size 769x37
    77        RenderText {#text} at (0,0) size 289x37
     
    3030          text run at (0,150) width 671: "TABLE.five TR, TABLE.five COL, TABLE.five COLGROUP, TABLE.five TBODY, TABLE.five THEAD"
    3131          text run at (0,165) width 258: "    { border: medium solid red; }"
    32       RenderBlock {DIV} at (0,285) size 1524x585
    33         RenderTable {TABLE} at (16,16) size 238x552 [border: (1px solid #0000FF)]
    34           RenderTableSection {TBODY} at (1,1) size 235x549
    35             RenderTableRow {TR} at (0,0) size 31x549
    36               RenderTableCell {TH} at (0,0) size 31x184 [border: (2px solid #800080)] [r=0 c=0 rs=1 cs=1]
    37                 RenderText {#text} at (6,51) size 18x83
    38                   text run at (6,51) width 83: "Header One"
    39               RenderTableCell {TH} at (0,183) size 31x175 [border: (2px solid #800080)] [r=0 c=1 rs=1 cs=1]
    40                 RenderText {#text} at (6,45) size 18x85
    41                   text run at (6,45) width 84: "Header Two"
    42               RenderTableCell {TH} at (0,357) size 31x193 [border: (2px solid #800080)] [r=0 c=2 rs=1 cs=1]
    43                 RenderText {#text} at (6,48) size 18x96
    44                   text run at (6,48) width 95: "Header Three"
    45             RenderTableRow {TR} at (0,31) size 102x549
    46               RenderTableCell {TD} at (31,27) size 102x130 [border: (2px solid #008000)] [r=1 c=0 rs=1 cs=1]
     32      RenderBlock {DIV} at (0,285) size 1542x570
     33        RenderTable {TABLE} at (16,16) size 238x537 [border: (1px solid #0000FF)]
     34          RenderTableSection {TBODY} at (1,1) size 235x534
     35            RenderTableRow {TR} at (0,0) size 31x534
     36              RenderTableCell {TH} at (0,0) size 31x179 [border: (2px solid #800080)] [r=0 c=0 rs=1 cs=1]
     37                RenderText {#text} at (6,48) size 18x84
     38                  text run at (6,48) width 83: "Header One"
     39              RenderTableCell {TH} at (0,178) size 31x170 [border: (2px solid #800080)] [r=0 c=1 rs=1 cs=1]
     40                RenderText {#text} at (6,43) size 18x84
     41                  text run at (6,43) width 84: "Header Two"
     42              RenderTableCell {TH} at (0,347) size 31x188 [border: (2px solid #800080)] [r=0 c=2 rs=1 cs=1]
     43                RenderText {#text} at (6,46) size 18x96
     44                  text run at (6,46) width 95: "Header Three"
     45            RenderTableRow {TR} at (0,31) size 102x534
     46              RenderTableCell {TD} at (31,27) size 102x125 [border: (2px solid #008000)] [r=1 c=0 rs=1 cs=1]
    4747                RenderText {#text} at (33,-20) size 36x161
    4848                  text run at (33,-20) width 119: "This table uses the"
    4949                  text run at (51,-20) width 161: "collapsed borders model."
    50               RenderTableCell {TD} at (31,201) size 102x139 [border: (1px solid #008000)] [r=1 c=1 rs=1 cs=1]
    51                 RenderText {#text} at (24,-12) size 54x163
    52                   text run at (24,-12) width 163: "This means that elements"
    53                   text run at (42,-12) width 146: "within the cell have no"
    54                   text run at (60,-12) width 100: "border-spacing."
    55               RenderTableCell {TD} at (31,357) size 102x193 [border: (1px solid #008000)] [r=1 c=2 rs=1 cs=1]
     50              RenderTableCell {TD} at (31,196) size 102x134 [border: (1px solid #008000)] [r=1 c=1 rs=1 cs=1]
     51                RenderText {#text} at (24,-12) size 54x154
     52                  text run at (24,-12) width 102: "This means that"
     53                  text run at (42,-12) width 153: "elements within the cell"
     54                  text run at (60,-12) width 154: "have no border-spacing."
     55              RenderTableCell {TD} at (31,347) size 102x188 [border: (1px solid #008000)] [r=1 c=2 rs=1 cs=1]
    5656                RenderText {#text} at (6,6) size 90x172
    5757                  text run at (6,6) width 139: "Since it has collapsed"
     
    6161                  text run at (60,6) width 154: "should be medium solid"
    6262                  text run at (78,6) width 45: "purple."
    63             RenderTableRow {TR} at (0,133) size 102x549
    64               RenderTableCell {TD} at (133,0) size 102x184 [border: (2px solid #008000)] [r=2 c=0 rs=1 cs=1]
     63            RenderTableRow {TR} at (0,133) size 102x534
     64              RenderTableCell {TD} at (133,0) size 102x179 [border: (2px solid #008000)] [r=2 c=0 rs=1 cs=1]
    6565                RenderText {#text} at (5,7) size 90x157
    6666                  text run at (5,7) width 147: "The border of the table"
     
    7070                  text run at (59,7) width 157: "header cells override the"
    7171                  text run at (77,7) width 45: "border."
    72               RenderTableCell {TD} at (133,183) size 102x175 [border: (1px solid #008000)] [r=2 c=1 rs=1 cs=1]
     72              RenderTableCell {TD} at (133,178) size 102x170 [border: (1px solid #008000)] [r=2 c=1 rs=1 cs=1]
    7373                RenderText {#text} at (5,6) size 90x154
    7474                  text run at (5,6) width 115: "The borders that I"
     
    7878                  text run at (59,58) width 101: "ones) should be"
    7979                  text run at (77,6) width 104: "thin solid green."
    80               RenderTableCell {TD} at (133,357) size 102x193 [border: (1px solid #008000)] [r=2 c=2 rs=1 cs=1]
     80              RenderTableCell {TD} at (133,347) size 102x188 [border: (1px solid #008000)] [r=2 c=2 rs=1 cs=1]
    8181                RenderText {#text} at (5,6) size 72x156
    8282                  text run at (5,6) width 156: "This table should have a"
     
    9191                RenderText {#text} at (77,6) size 18x82
    9292                  text run at (77,6) width 82: "of its border."
    93         RenderTable {TABLE} at (270,16) size 290x552 [border: (3px solid #0000FF)]
    94           RenderTableSection {TBODY} at (3,3) size 284x546
    95             RenderTableRow {TR} at (0,16) size 34x546
    96               RenderTableCell {TH} at (16,16) size 34x119 [border: (3px solid #800080)] [r=0 c=0 rs=1 cs=1]
    97                 RenderText {#text} at (8,17) size 18x84
    98                   text run at (8,17) width 83: "Header One"
    99               RenderTableCell {TH} at (16,150) size 34x140 [border: (3px solid #800080)] [r=0 c=1 rs=1 cs=1]
    100                 RenderText {#text} at (8,27) size 18x85
    101                   text run at (8,27) width 84: "Header Two"
    102               RenderTableCell {TH} at (16,305) size 34x226 [border: (3px solid #800080)] [r=0 c=2 rs=1 cs=1]
    103                 RenderText {#text} at (8,64) size 18x96
    104                   text run at (8,64) width 95: "Header Three"
    105             RenderTableRow {TR} at (0,66) size 84x546
    106               RenderTableCell {TD} at (66,25) size 84x101 [border: (1px solid #008000)] [r=1 c=0 rs=1 cs=1]
    107                 RenderText {#text} at (15,-3) size 54x96
    108                   text run at (15,-3) width 96: "This table uses"
    109                   text run at (33,-3) width 84: "the separated"
    110                   text run at (51,-3) width 96: "borders model."
    111               RenderTableCell {TD} at (66,150) size 84x140 [border: (1px solid #008000)] [r=1 c=1 rs=1 cs=1]
    112                 RenderText {#text} at (6,6) size 72x126
     93        RenderTable {TABLE} at (270,16) size 308x537 [border: (3px solid #0000FF)]
     94          RenderTableSection {TBODY} at (3,3) size 302x531
     95            RenderTableRow {TR} at (0,16) size 34x531
     96              RenderTableCell {TH} at (16,16) size 34x115 [border: (3px solid #800080)] [r=0 c=0 rs=1 cs=1]
     97                RenderText {#text} at (8,15) size 18x84
     98                  text run at (8,15) width 83: "Header One"
     99              RenderTableCell {TH} at (16,146) size 34x136 [border: (3px solid #800080)] [r=0 c=1 rs=1 cs=1]
     100                RenderText {#text} at (8,25) size 18x85
     101                  text run at (8,25) width 84: "Header Two"
     102              RenderTableCell {TH} at (16,297) size 34x219 [border: (3px solid #800080)] [r=0 c=2 rs=1 cs=1]
     103                RenderText {#text} at (8,61) size 18x96
     104                  text run at (8,61) width 95: "Header Three"
     105            RenderTableRow {TR} at (0,66) size 102x531
     106              RenderTableCell {TD} at (66,34) size 102x79 [border: (1px solid #008000)] [r=1 c=0 rs=1 cs=1]
     107                RenderText {#text} at (24,-12) size 54x96
     108                  text run at (24,-12) width 96: "This table uses"
     109                  text run at (42,-12) width 84: "the separated"
     110                  text run at (60,-12) width 96: "borders model."
     111              RenderTableCell {TD} at (66,146) size 102x136 [border: (1px solid #008000)] [r=1 c=1 rs=1 cs=1]
     112                RenderText {#text} at (6,6) size 90x113
    113113                  text run at (6,6) width 102: "This means that"
    114                   text run at (24,6) width 126: "elements within the"
    115                   text run at (42,6) width 109: "cell have border-"
    116                   text run at (60,6) width 102: "spacing of 1em."
    117               RenderTableCell {TD} at (66,314) size 84x208 [border: (1px solid #008000)] [r=1 c=2 rs=1 cs=1]
    118                 RenderText {#text} at (15,-3) size 54x205
    119                   text run at (15,-3) width 205: "The borders on the header cells,"
    120                   text run at (33,-3) width 199: "on all sides, should be medium"
    121                   text run at (51,-3) width 80: "solid purple."
    122             RenderTableRow {TR} at (0,166) size 102x546
    123               RenderTableCell {TD} at (166,16) size 102x119 [border: (1px solid #008000)] [r=2 c=0 rs=1 cs=1]
     114                  text run at (24,6) width 102: "elements within"
     115                  text run at (42,6) width 81: "the cell have"
     116                  text run at (60,6) width 113: "border-spacing of"
     117                  text run at (78,6) width 32: "1em."
     118              RenderTableCell {TD} at (66,315) size 102x183 [border: (1px solid #008000)] [r=1 c=2 rs=1 cs=1]
     119                RenderText {#text} at (24,-12) size 54x205
     120                  text run at (24,-12) width 205: "The borders on the header cells,"
     121                  text run at (42,-12) width 199: "on all sides, should be medium"
     122                  text run at (60,-12) width 80: "solid purple."
     123            RenderTableRow {TR} at (0,184) size 102x531
     124              RenderTableCell {TD} at (184,16) size 102x115 [border: (1px solid #008000)] [r=2 c=0 rs=1 cs=1]
    124125                RenderText {#text} at (6,6) size 90x91
    125126                  text run at (6,6) width 88: "The border of"
     
    128129                  text run at (60,6) width 88: "medium solid"
    129130                  text run at (78,6) width 32: "blue."
    130               RenderTableCell {TD} at (166,168) size 102x104 [border: (1px solid #008000)] [r=2 c=1 rs=1 cs=1]
     131              RenderTableCell {TD} at (184,164) size 102x100 [border: (1px solid #008000)] [r=2 c=1 rs=1 cs=1]
    131132                RenderText {#text} at (24,-12) size 54x123
    132133                  text run at (24,-12) width 95: "The borders of"
    133134                  text run at (42,-12) width 113: "other cells should"
    134135                  text run at (60,-12) width 123: "be thin solid green."
    135               RenderTableCell {TD} at (166,314) size 102x208 [border: (1px solid #008000)] [r=2 c=2 rs=1 cs=1]
     136              RenderTableCell {TD} at (184,306) size 102x201 [border: (1px solid #008000)] [r=2 c=2 rs=1 cs=1]
    136137                RenderText {#text} at (15,-3) size 54x191
    137138                  text run at (15,-3) width 188: "This table should have a 1em"
     
    145146                RenderText {#text} at (69,64) size 18x87
    146147                  text run at (69,64) width 86: " of its border."
    147         RenderTable {TABLE} at (576,16) size 348x552 [border: (3px solid #0000FF)]
    148           RenderTableSection {TBODY} at (3,3) size 342x546
    149             RenderTableRow {TR} at (0,8) size 34x546
    150               RenderTableCell {TH} at (8,0) size 34x142 [border: (3px solid #800080)] [r=0 c=0 rs=1 cs=1]
    151                 RenderText {#text} at (8,29) size 18x84
    152                   text run at (8,29) width 83: "Header One"
    153               RenderTableCell {TH} at (8,141) size 34x200 [border: (3px solid #800080)] [r=0 c=1 rs=1 cs=1]
    154                 RenderText {#text} at (8,57) size 18x85
    155                   text run at (8,57) width 84: "Header Two"
    156               RenderTableCell {TH} at (8,340) size 34x207 [border: (3px solid #800080)] [r=0 c=2 rs=1 cs=1]
    157                 RenderText {#text} at (8,55) size 18x96
    158                   text run at (8,55) width 95: "Header Three"
    159             RenderTableRow {TR} at (0,50) size 138x546
    160               RenderTableCell {TD} at (50,36) size 138x70 [border: (1px solid #008000)] [r=1 c=0 rs=1 cs=1]
     148        RenderTable {TABLE} at (594,16) size 348x537 [border: (3px solid #0000FF)]
     149          RenderTableSection {TBODY} at (3,3) size 342x531
     150            RenderTableRow {TR} at (0,8) size 34x531
     151              RenderTableCell {TH} at (8,0) size 34x138 [border: (3px solid #800080)] [r=0 c=0 rs=1 cs=1]
     152                RenderText {#text} at (8,27) size 18x84
     153                  text run at (8,27) width 83: "Header One"
     154              RenderTableCell {TH} at (8,137) size 34x195 [border: (3px solid #800080)] [r=0 c=1 rs=1 cs=1]
     155                RenderText {#text} at (8,55) size 18x84
     156                  text run at (8,55) width 84: "Header Two"
     157              RenderTableCell {TH} at (8,331) size 34x201 [border: (3px solid #800080)] [r=0 c=2 rs=1 cs=1]
     158                RenderText {#text} at (8,52) size 18x96
     159                  text run at (8,52) width 95: "Header Three"
     160            RenderTableRow {TR} at (0,50) size 138x531
     161              RenderTableCell {TD} at (50,36) size 138x66 [border: (1px solid #008000)] [r=1 c=0 rs=1 cs=1]
    161162                RenderText {#text} at (42,-30) size 54x119
    162163                  text run at (42,-30) width 119: "This table uses the"
    163164                  text run at (60,-30) width 113: "separated borders"
    164165                  text run at (78,-30) width 44: "model."
    165               RenderTableCell {TD} at (50,141) size 138x200 [border: (1px solid #008000)] [r=1 c=1 rs=1 cs=1]
    166                 RenderText {#text} at (6,6) size 126x184
     166              RenderTableCell {TD} at (50,137) size 138x195 [border: (1px solid #008000)] [r=1 c=1 rs=1 cs=1]
     167                RenderText {#text} at (6,6) size 126x181
    167168                  text run at (6,6) width 156: "Elements within the cell"
    168169                  text run at (24,6) width 150: "have horizontal border-"
     
    171172                  text run at (78,6) width 52: "vertical "
    172173                  text run at (78,57) width 129: "border-spacing (i.e.,"
    173                   text run at (96,6) width 184: "height of horizontal lines) of"
    174                   text run at (114,6) width 44: "0.5em."
    175               RenderTableCell {TD} at (50,376) size 138x135 [border: (1px solid #008000)] [r=1 c=2 rs=1 cs=1]
     174                  text run at (96,6) width 166: "height of horizontal lines)"
     175                  text run at (114,6) width 61: "of 0.5em."
     176              RenderTableCell {TD} at (50,367) size 138x129 [border: (1px solid #008000)] [r=1 c=2 rs=1 cs=1]
    176177                RenderText {#text} at (42,-30) size 54x180
    177178                  text run at (42,-30) width 168: "The borders on the header"
     
    179180                  text run at (60,7) width 142: "on all sides, should be"
    180181                  text run at (78,-30) width 137: "medium solid purple."
    181             RenderTableRow {TR} at (0,196) size 138x546
    182               RenderTableCell {TD} at (196,0) size 138x142 [border: (1px solid #008000)] [r=2 c=0 rs=1 cs=1]
    183                 RenderText {#text} at (6,6) size 126x126
     182            RenderTableRow {TR} at (0,196) size 138x531
     183              RenderTableCell {TD} at (196,0) size 138x138 [border: (1px solid #008000)] [r=2 c=0 rs=1 cs=1]
     184                RenderText {#text} at (6,6) size 126x114
    184185                  text run at (6,6) width 112: "The border of the"
    185186                  text run at (24,6) width 114: "table itself should"
     
    188189                  text run at (60,41) width 77: "The borders"
    189190                  text run at (78,6) width 84: "of other cells"
    190                   text run at (96,6) width 126: "should be thin solid"
    191                   text run at (114,6) width 40: "green."
    192               RenderTableCell {TD} at (196,159) size 138x164 [border: (1px solid #008000)] [r=2 c=1 rs=1 cs=1]
    193                 RenderText {#text} at (24,-12) size 72x188
    194                   text run at (24,-12) width 188: "This table should have a 1em"
    195                   text run at (42,-12) width 158: "margin around all edges."
    196                   text run at (60,-12) width 82: "This margin "
    197                   text run at (60,69) width 76: "is measured"
    198                   text run at (78,-12) width 59: "from the "
    199                 RenderInline {EM} at (0,0) size 18x69
    200                   RenderText {#text} at (78,46) size 18x69
    201                     text run at (78,46) width 68: "outer edge"
    202                 RenderText {#text} at (78,114) size 36x164
    203                   text run at (78,114) width 37: " of its"
    204                   text run at (96,-12) width 45: "border."
    205               RenderTableCell {TD} at (196,349) size 138x189 [border: (1px solid #008000)] [r=2 c=2 rs=1 cs=1]
    206                 RenderText {#text} at (15,-3) size 108x192
    207                   text run at (15,-3) width 191: "The table should not be wider"
    208                   text run at (33,-3) width 187: "than the room available for it"
    209                   text run at (51,-3) width 44: "unless "
    210                   text run at (51,41) width 111: "that space is very"
    211                   text run at (69,-3) width 43: "small. "
    212                   text run at (69,39) width 150: "Because of its margins,"
    213                   text run at (87,-3) width 105: "the width of the "
    214                   text run at (87,101) width 78: "table should"
    215                   text run at (105,-3) width 120: "be less than 100%."
    216         RenderTable {TABLE} at (940,16) size 280x552 [border: (3px solid #0000FF)]
    217           RenderTableSection {TBODY} at (3,3) size 274x546
    218             RenderTableRow {TR} at (0,0) size 34x546
    219               RenderTableCell {TH} at (0,8) size 34x149 [border: (3px solid #800080)] [r=0 c=0 rs=1 cs=1]
    220                 RenderText {#text} at (8,32) size 18x84
    221                   text run at (8,32) width 83: "Header One"
    222               RenderTableCell {TH} at (0,164) size 34x151 [border: (3px solid #800080)] [r=0 c=1 rs=1 cs=1]
    223                 RenderText {#text} at (8,33) size 18x84
    224                   text run at (8,33) width 84: "Header Two"
    225               RenderTableCell {TH} at (0,322) size 34x217 [border: (3px solid #800080)] [r=0 c=2 rs=1 cs=1]
    226                 RenderText {#text} at (8,60) size 18x96
    227                   text run at (8,60) width 95: "Header Three"
    228             RenderTableRow {TR} at (0,34) size 102x546
    229               RenderTableCell {TD} at (34,26) size 102x113 [border: (1px solid #008000)] [r=1 c=0 rs=1 cs=1]
     191                  text run at (96,6) width 91: "should be thin"
     192                  text run at (114,6) width 75: "solid green."
     193              RenderTableCell {TD} at (196,155) size 138x159 [border: (1px solid #008000)] [r=2 c=1 rs=1 cs=1]
     194                RenderText {#text} at (24,-12) size 72x156
     195                  text run at (24,-12) width 156: "This table should have a"
     196                  text run at (42,-12) width 146: "1em margin around all"
     197                  text run at (60,-12) width 45: "edges. "
     198                  text run at (60,32) width 82: "This margin "
     199                  text run at (60,113) width 11: "is"
     200                  text run at (78,-12) width 124: "measured from the "
     201                RenderInline {EM} at (0,0) size 36x158
     202                  RenderText {#text} at (78,111) size 36x158
     203                    text run at (78,111) width 34: "outer"
     204                    text run at (96,-12) width 31: "edge"
     205                RenderText {#text} at (96,18) size 18x86
     206                  text run at (96,18) width 86: " of its border."
     207              RenderTableCell {TD} at (196,331) size 138x201 [border: (1px solid #008000)] [r=2 c=2 rs=1 cs=1]
     208                RenderText {#text} at (6,6) size 126x183
     209                  text run at (6,6) width 151: "The table should not be"
     210                  text run at (24,6) width 130: "wider than the room"
     211                  text run at (42,6) width 142: "available for it unless "
     212                  text run at (42,147) width 24: "that"
     213                  text run at (60,6) width 130: "space is very small. "
     214                  text run at (60,135) width 54: "Because"
     215                  text run at (78,6) width 174: "of its margins, the width of"
     216                  text run at (96,6) width 24: "the "
     217                  text run at (96,29) width 157: "table should be less than"
     218                  text run at (114,6) width 42: "100%."
     219        RenderTable {TABLE} at (958,16) size 280x537 [border: (3px solid #0000FF)]
     220          RenderTableSection {TBODY} at (3,3) size 274x531
     221            RenderTableRow {TR} at (0,0) size 34x531
     222              RenderTableCell {TH} at (0,8) size 34x145 [border: (3px solid #800080)] [r=0 c=0 rs=1 cs=1]
     223                RenderText {#text} at (8,30) size 18x84
     224                  text run at (8,30) width 83: "Header One"
     225              RenderTableCell {TH} at (0,160) size 34x147 [border: (3px solid #800080)] [r=0 c=1 rs=1 cs=1]
     226                RenderText {#text} at (8,31) size 18x84
     227                  text run at (8,31) width 84: "Header Two"
     228              RenderTableCell {TH} at (0,314) size 34x210 [border: (3px solid #800080)] [r=0 c=2 rs=1 cs=1]
     229                RenderText {#text} at (8,57) size 18x95
     230                  text run at (8,57) width 95: "Header Three"
     231            RenderTableRow {TR} at (0,34) size 102x531
     232              RenderTableCell {TD} at (34,26) size 102x109 [border: (1px solid #008000)] [r=1 c=0 rs=1 cs=1]
    230233                RenderText {#text} at (24,-12) size 54x119
    231234                  text run at (24,-12) width 119: "This table uses the"
    232235                  text run at (42,-12) width 113: "separated borders"
    233236                  text run at (60,-12) width 44: "model."
    234               RenderTableCell {TD} at (34,164) size 102x151 [border: (1px solid #008000)] [r=1 c=1 rs=1 cs=1]
     237              RenderTableCell {TD} at (34,160) size 102x147 [border: (1px solid #008000)] [r=1 c=1 rs=1 cs=1]
    235238                RenderText {#text} at (6,6) size 90x129
    236239                  text run at (6,6) width 128: "Elements within the"
     
    239242                  text run at (60,6) width 119: "0.5em and vertical"
    240243                  text run at (78,6) width 129: "border-spacing of 0."
    241               RenderTableCell {TD} at (34,340) size 102x181 [border: (1px solid #008000)] [r=1 c=2 rs=1 cs=1]
     244              RenderTableCell {TD} at (34,332) size 102x174 [border: (1px solid #008000)] [r=1 c=2 rs=1 cs=1]
    242245                RenderText {#text} at (24,-12) size 54x180
    243246                  text run at (24,-12) width 168: "The borders on the header"
     
    245248                  text run at (42,25) width 142: "on all sides, should be"
    246249                  text run at (60,-12) width 137: "medium solid purple."
    247             RenderTableRow {TR} at (0,136) size 138x546
    248               RenderTableCell {TD} at (136,17) size 138x131 [border: (1px solid #008000)] [r=2 c=0 rs=1 cs=1]
    249                 RenderText {#text} at (15,-3) size 108x133
     250            RenderTableRow {TR} at (0,136) size 138x531
     251              RenderTableCell {TD} at (136,17) size 138x127 [border: (1px solid #008000)] [r=2 c=0 rs=1 cs=1]
     252                RenderText {#text} at (15,-3) size 108x132
    250253                  text run at (15,-3) width 112: "The border of the"
    251                   text run at (33,-3) width 133: "table itself should be"
    252                   text run at (51,-3) width 124: "medium solid blue."
    253                   text run at (69,-3) width 132: "The borders of other"
    254                   text run at (87,-3) width 124: "cells should be thin"
    255                   text run at (105,-3) width 75: "solid green."
    256               RenderTableCell {TD} at (136,164) size 138x151 [border: (1px solid #008000)] [r=2 c=1 rs=1 cs=1]
     254                  text run at (33,-3) width 114: "table itself should"
     255                  text run at (51,-3) width 107: "be medium solid"
     256                  text run at (69,-3) width 36: "blue. "
     257                  text run at (69,32) width 95: "The borders of"
     258                  text run at (87,-3) width 132: "other cells should be"
     259                  text run at (105,-3) width 104: "thin solid green."
     260              RenderTableCell {TD} at (136,160) size 138x147 [border: (1px solid #008000)] [r=2 c=1 rs=1 cs=1]
    257261                RenderText {#text} at (6,6) size 90x122
    258262                  text run at (6,6) width 111: "This table should"
     
    268272                  text run at (96,73) width 37: " of its"
    269273                  text run at (114,6) width 45: "border."
    270               RenderTableCell {TD} at (136,331) size 138x199 [border: (1px solid #008000)] [r=2 c=2 rs=1 cs=1]
    271                 RenderText {#text} at (15,-3) size 108x198
     274              RenderTableCell {TD} at (136,323) size 138x192 [border: (1px solid #008000)] [r=2 c=2 rs=1 cs=1]
     275                RenderText {#text} at (15,-3) size 108x192
    272276                  text run at (15,-3) width 191: "The table should not be wider"
    273277                  text run at (33,-3) width 187: "than the room available for it"
    274278                  text run at (51,-3) width 44: "unless "
    275                   text run at (51,41) width 154: "that space is very small."
    276                   text run at (69,-3) width 173: "Because of its margins, the"
    277                   text run at (87,-3) width 82: "width of the "
    278                   text run at (87,78) width 97: "table should be"
    279                   text run at (105,-3) width 101: "less than 100%."
    280         RenderTable {TABLE} at (1236,16) size 272x552
    281           RenderBlock {CAPTION} at (0,0) size 18x552
    282             RenderText {#text} at (0,215) size 18x122
    283               text run at (0,215) width 122: "This is the caption."
     279                  text run at (51,41) width 111: "that space is very"
     280                  text run at (69,-3) width 43: "small. "
     281                  text run at (69,39) width 150: "Because of its margins,"
     282                  text run at (87,-3) width 105: "the width of the "
     283                  text run at (87,101) width 78: "table should"
     284                  text run at (105,-3) width 120: "be less than 100%."
     285        RenderTable {TABLE} at (1254,16) size 272x537
     286          RenderBlock {CAPTION} at (0,0) size 18x537
     287            RenderText {#text} at (0,207) size 18x123
     288              text run at (0,207) width 122: "This is the caption."
    284289          RenderTableCol {COLGROUP} at (0,0) size 0x0 [border: (3px solid #FF0000)]
    285290            RenderTableCol {COL} at (0,0) size 0x0 [border: (3px solid #FF0000)]
     
    287292            RenderTableCol {COL} at (0,0) size 0x0 [border: (3px solid #FF0000)]
    288293            RenderTableCol {COL} at (0,0) size 0x0 [border: (3px solid #FF0000)]
    289           RenderTableSection {THEAD} at (18,0) size 50x552 [border: (3px solid #FF0000)]
    290             RenderTableRow {TR} at (0,2) size 46x552 [border: (3px solid #FF0000)]
    291               RenderTableCell {TH} at (2,2) size 46x90 [r=0 c=0 rs=1 cs=1]
    292                 RenderText {#text} at (5,19) size 36x52
    293                   text run at (5,19) width 51: "Header"
    294                   text run at (23,30) width 29: "One"
    295               RenderTableCell {TH} at (2,102) size 46x223 [r=0 c=1 rs=1 cs=1]
    296                 RenderText {#text} at (14,68) size 18x85
    297                   text run at (14,68) width 84: "Header Two"
    298               RenderTableCell {TH} at (2,344) size 46x198 [r=0 c=2 rs=1 cs=1]
    299                 RenderText {#text} at (14,50) size 18x96
    300                   text run at (14,50) width 95: "Header Three"
    301           RenderTableSection {TBODY} at (68,0) size 204x552 [border: (3px solid #FF0000)]
    302             RenderTableRow {TR} at (0,0) size 100x552 [border: (3px solid #FF0000)]
    303               RenderTableCell {TD} at (0,2) size 100x90 [r=0 c=0 rs=1 cs=1]
     294          RenderTableSection {THEAD} at (18,0) size 50x537 [border: (3px solid #FF0000)]
     295            RenderTableRow {TR} at (0,2) size 46x537 [border: (3px solid #FF0000)]
     296              RenderTableCell {TH} at (2,2) size 46x88 [r=0 c=0 rs=1 cs=1]
     297                RenderText {#text} at (5,18) size 36x52
     298                  text run at (5,18) width 51: "Header"
     299                  text run at (23,29) width 29: "One"
     300              RenderTableCell {TH} at (2,100) size 46x216 [r=0 c=1 rs=1 cs=1]
     301                RenderText {#text} at (14,65) size 18x85
     302                  text run at (14,65) width 84: "Header Two"
     303              RenderTableCell {TH} at (2,335) size 46x192 [r=0 c=2 rs=1 cs=1]
     304                RenderText {#text} at (14,47) size 18x96
     305                  text run at (14,47) width 95: "Header Three"
     306          RenderTableSection {TBODY} at (68,0) size 204x537 [border: (3px solid #FF0000)]
     307            RenderTableRow {TR} at (0,0) size 100x537 [border: (3px solid #FF0000)]
     308              RenderTableCell {TD} at (0,2) size 100x88 [r=0 c=0 rs=1 cs=1]
    304309                RenderText {#text} at (5,5) size 90x64
    305310                  text run at (5,5) width 64: "This table"
     
    308313                  text run at (59,5) width 48: "borders"
    309314                  text run at (77,5) width 44: "model."
    310               RenderTableCell {TD} at (0,111) size 100x205 [r=0 c=1 rs=1 cs=1]
     315              RenderTableCell {TD} at (0,109) size 100x198 [r=0 c=1 rs=1 cs=1]
    311316                RenderText {#text} at (23,-13) size 54x217
    312317                  text run at (23,-13) width 177: "This means that borders are"
     
    314319                  text run at (59,-13) width 36: "table "
    315320                  text run at (59,22) width 88: "cell elements."
    316               RenderTableCell {TD} at (0,344) size 100x198 [r=0 c=2 rs=1 cs=1]
     321              RenderTableCell {TD} at (0,335) size 100x192 [r=0 c=2 rs=1 cs=1]
    317322                RenderText {#text} at (14,-4) size 72x187
    318323                  text run at (14,-4) width 156: "They are not allowed on"
     
    320325                  text run at (50,-4) width 158: "row-groups, columns, or"
    321326                  text run at (68,-4) width 101: "column-groups."
    322             RenderTableRow {TR} at (0,102) size 100x552 [border: (3px solid #FF0000)]
    323               RenderTableCell {TD} at (102,2) size 100x90 [r=1 c=0 rs=1 cs=1]
    324                 RenderText {#text} at (5,5) size 90x79
     327            RenderTableRow {TR} at (0,102) size 100x537 [border: (3px solid #FF0000)]
     328              RenderTableCell {TD} at (102,2) size 100x88 [r=1 c=0 rs=1 cs=1]
     329                RenderText {#text} at (5,5) size 90x68
    325330                  text run at (5,5) width 38: "There"
    326331                  text run at (23,5) width 62: "should be"
    327332                  text run at (41,5) width 68: "no borders"
    328                   text run at (59,5) width 79: "at all on this"
    329                   text run at (77,5) width 37: "table!"
    330               RenderTableCell {TD} at (102,102) size 100x223 [r=1 c=1 rs=1 cs=1]
    331                 RenderText {#text} at (14,-4) size 72x224
    332                   text run at (14,-4) width 224: "If there are any borders shown that"
    333                   text run at (32,-4) width 200: "are not medium solid red, then "
    334                   text run at (32,195) width 20: "the"
    335                   text run at (50,-4) width 208: "problem is something other than"
    336                   text run at (68,-4) width 150: "what this test is testing."
    337               RenderTableCell {TD} at (102,344) size 100x198 [r=1 c=2 rs=1 cs=1]
     333                  text run at (59,5) width 52: "at all on"
     334                  text run at (77,5) width 64: "this table!"
     335              RenderTableCell {TD} at (102,100) size 100x216 [r=1 c=1 rs=1 cs=1]
     336                RenderText {#text} at (14,-4) size 72x219
     337                  text run at (14,-4) width 196: "If there are any borders shown"
     338                  text run at (32,-4) width 192: "that are not medium solid red,"
     339                  text run at (50,-4) width 32: "then "
     340                  text run at (50,27) width 163: "the problem is something"
     341                  text run at (68,-4) width 219: "other than what this test is testing."
     342              RenderTableCell {TD} at (102,335) size 100x192 [r=1 c=2 rs=1 cs=1]
    338343                RenderText {#text} at (14,-4) size 54x191
    339344                  text run at (14,-4) width 188: "This table should have a 1em"
  • trunk/Source/WebCore/ChangeLog

    r201676 r201677  
     12016-06-03  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Bopomofo ruby in Dictionary.app is written horizontally (when it should be written vertically)
     4        https://bugs.webkit.org/show_bug.cgi?id=158245
     5        <rdar://problem/25675318>
     6
     7        Reviewed by Darin Adler.
     8
     9        With orthogonal flows, the inner element gets a logical width that is computed from two values:
     10        - The containing block's available logical height
     11        - The FrameView's visibleHeight
     12
     13        In Dictionary.app, the FrameView's height changes, but this element doesn't get relaid out.
     14        This is because of our optimization where normal-flow elements don't get relaid out if their
     15        parent's width doesn't change (which is the case here).
     16
     17        Therefore, this orthogonal writing mode element should be relaid out when the FrameView changes
     18        size. Luckily, we already have machinery for doing this: percentage heights. In quirks mode, a
     19        div with a percentage height may walk arbitrarily far up the DOM tree in order to determine which
     20        element the percentage should be resolved against. Therefore, we have a map of percentage-sizing-
     21        ancestors to percentage-sizing-descendants which speeds up this search. If a percentage-sizing-
     22        ancestor gets relaid out, all the relevant percentage-sizing-descendants get relaid out too.
     23
     24        Therefore, we can simply mark the FrameView as a percentage-sizing-ancestor and the orthogonal
     25        flow element as a percentage-sizing-descendant. The lifetime of this relationship is already
     26        managed correctly - it gets reset when style changes and when the renderer is destroyed, and
     27        is created during layout.
     28
     29        Unfortunately, this same treatment should also be done to the element which dictates the
     30        containing block's logical height (which caused https://bugs.webkit.org/show_bug.cgi?id=158286).
     31        Implementing this would require giving RenderBox::availableLogicalHeight() a second result
     32        of the necessary element which dictates the return. In an effort to keep this patch small and
     33        focused, I'll do this secondary (much larger) work in a patch on that bug. This patch,
     34        therefore, is kept small and focused.
     35
     36        Test: fast/text/orthogonal-writing-mode-containing-block-frameView-resize-relayout.html
     37
     38        * rendering/RenderBox.cpp:
     39        (WebCore::RenderBox::perpendicularContainingBlockLogicalHeight):
     40
    1412016-06-03  Myles C. Maxfield  <mmaxfield@apple.com>
    242
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r201635 r201677  
    19881988        LayoutUnit fillFallbackExtent = containingBlockStyle.isHorizontalWritingMode() ? view().frameView().visibleHeight() : view().frameView().visibleWidth();
    19891989        LayoutUnit fillAvailableExtent = containingBlock()->availableLogicalHeight(ExcludeMarginBorderPadding);
     1990        view().addPercentHeightDescendant(const_cast<RenderBox&>(*this));
     1991        // FIXME: https://bugs.webkit.org/show_bug.cgi?id=158286 We also need to perform the same percentHeightDescendant treatment to the element which dictates the return value for containingBlock()->availableLogicalHeight() above.
    19901992        return std::min(fillAvailableExtent, fillFallbackExtent);
    19911993    }
Note: See TracChangeset for help on using the changeset viewer.