⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 278931 in webkit


Ignore:
Timestamp:
Jun 16, 2021, 6:44:23 AM (5 years ago)
Author:
Alan Bujtas
Message:

Content moves up when hovering over a link on Hacker News
https://bugs.webkit.org/show_bug.cgi?id=226852
<rdar://78537231>

Reviewed by Antti Koivisto.

Source/WebCore:

Legacy line layout integral-rounds the root inline box's vertical position and this integral position
gets propagated down to the descendant inline boxes when descendantsHaveSameLineHeightAndBaseline() is true.
See LegacyInlineFlowBox::addToLine and LegacyInlineFlowBox::placeBoxesInBlockDirection for more details.
This patch attempts to mirror this behavior in IFC.

Test: fast/inline/hidpi-legacy-integral-rounding-on-inline-boxes.html

  • layout/integration/LayoutIntegrationInlineContentBuilder.cpp:

(WebCore::LayoutIntegration::InlineContentBuilder::computeLineLevelVisualAdjustmentsForRuns const):

LayoutTests:

  • fast/inline/hidpi-legacy-integral-rounding-on-inline-boxes-expected.html: Added.
  • fast/inline/hidpi-legacy-integral-rounding-on-inline-boxes.html: Added.
Location:
trunk
Files:
4 added
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r278930 r278931  
     12021-06-16  Alan Bujtas  <zalan@apple.com>
     2
     3        Content moves up when hovering over a link on Hacker News
     4        https://bugs.webkit.org/show_bug.cgi?id=226852
     5        <rdar://78537231>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        * fast/inline/hidpi-legacy-integral-rounding-on-inline-boxes-expected.html: Added.
     10        * fast/inline/hidpi-legacy-integral-rounding-on-inline-boxes.html: Added.
     11
    1122021-06-16  Frederic Wang  <fwang@igalia.com>
    213
  • trunk/LayoutTests/platform/ios/tables/mozilla/bugs/bug106795-expected.txt

    r272100 r278931  
    88          RenderTableRow {TR} at (0,0) size 781x38
    99            RenderTableCell {TD} at (0,7) size 781x23 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
    10               RenderBR {BR} at (1,1) size 0x20
     10              RenderBR {BR} at (1,0) size 0x21
    1111          RenderTableRow {TR} at (0,37) size 781x6
    1212            RenderTableCell {TD} at (0,37) size 781x6 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1]
     
    1414          RenderTableRow {TR} at (0,42) size 781x38
    1515            RenderTableCell {TD} at (0,50) size 781x23 [bgcolor=#CC0000] [border: (1px inset #808080)] [r=2 c=0 rs=1 cs=1]
    16               RenderBR {BR} at (1,1) size 0x20
     16              RenderBR {BR} at (1,0) size 0x21
  • trunk/LayoutTests/platform/ios/tables/mozilla/bugs/bug126742-expected.txt

    r275515 r278931  
    2424                RenderInline {A} at (0,0) size 104x20 [color=#0000EE]
    2525                  RenderInline {FONT} at (0,0) size 104x16
    26                     RenderText {#text} at (340,-1) size 104x16
     26                    RenderText {#text} at (340,-1) size 104x17
    2727                      text run at (340,0) width 104: "Course Information"
    2828            RenderTableRow {TR} at (0,118) size 784x34
     
    3030                RenderInline {A} at (0,0) size 40x20 [color=#0000EE]
    3131                  RenderInline {FONT} at (0,0) size 40x16
    32                     RenderText {#text} at (372,-1) size 40x16
     32                    RenderText {#text} at (372,-1) size 40x17
    3333                      text run at (372,0) width 40: "Lecture"
    3434            RenderTableRow {TR} at (0,151) size 784x34
     
    3838                RenderInline {A} at (0,0) size 60x20 [color=#0000EE]
    3939                  RenderInline {FONT} at (0,0) size 60x16
    40                     RenderText {#text} at (362,-1) size 60x16
     40                    RenderText {#text} at (362,-1) size 60x17
    4141                      text run at (362,0) width 60: "Homework"
    4242            RenderTableRow {TR} at (0,184) size 784x33
     
    4444                RenderInline {A} at (0,0) size 42x20 [color=#0000EE]
    4545                  RenderInline {FONT} at (0,0) size 42x16
    46                     RenderText {#text} at (371,-1) size 42x16
     46                    RenderText {#text} at (371,-1) size 42x17
    4747                      text run at (371,0) width 42: "Quizzes"
    4848            RenderTableRow {TR} at (0,216) size 784x34
     
    5050                RenderInline {FONT} at (0,0) size 36x16 [color=#0000FF]
    5151                  RenderInline {A} at (0,0) size 36x16 [color=#0000EE]
    52                     RenderText {#text} at (374,-1) size 36x16
     52                    RenderText {#text} at (374,-1) size 36x17
    5353                      text run at (374,0) width 36: "Exams"
    5454            RenderTableRow {TR} at (0,249) size 784x34
     
    5858                RenderInline {A} at (0,0) size 58x20 [color=#0000EE]
    5959                  RenderInline {FONT} at (0,0) size 58x16
    60                     RenderText {#text} at (363,-1) size 21x16
     60                    RenderText {#text} at (363,-1) size 21x17
    6161                      text run at (363,0) width 21: "Lab"
    6262                    RenderInline {U} at (0,0) size 38x16
    63                       RenderText {#text} at (383,-1) size 38x16
     63                      RenderText {#text} at (383,-1) size 38x17
    6464                        text run at (383,0) width 38: "oratory"
    6565            RenderTableRow {TR} at (0,282) size 784x33
     
    6868                  RenderInline {U} at (0,0) size 38x20
    6969                    RenderInline {FONT} at (0,0) size 38x16
    70                       RenderText {#text} at (373,-1) size 38x16
     70                      RenderText {#text} at (373,-1) size 38x17
    7171                        text run at (373,0) width 38: "Grades"
    7272            RenderTableRow {TR} at (0,314) size 784x34
     
    7474                RenderInline {FONT} at (0,0) size 70x16
    7575                  RenderInline {A} at (0,0) size 70x16 [color=#0000EE]
    76                     RenderText {#text} at (357,-1) size 70x16
     76                    RenderText {#text} at (357,-1) size 70x17
    7777                      text run at (357,0) width 33: "Filter "
    7878                      text run at (389,0) width 38: "Design"
     
    8282                  RenderInline {U} at (0,0) size 68x16
    8383                    RenderInline {A} at (0,0) size 68x16 [color=#0000EE]
    84                       RenderText {#text} at (358,-1) size 68x16
     84                      RenderText {#text} at (358,-1) size 68x17
    8585                        text run at (358,0) width 37: "Office "
    8686                        text run at (394,0) width 32: "Hours"
  • trunk/LayoutTests/platform/ios/tables/mozilla/bugs/bug16252-expected.txt

    r272100 r278931  
    2626                        RenderTableRow {TR} at (0,24) size 260x293
    2727                          RenderTableCell {TD} at (0,158) size 6x25 [bgcolor=#FFFFFF] [r=1 c=0 rs=1 cs=1]
    28                             RenderBR {BR} at (2,2) size 0x20
     28                            RenderBR {BR} at (2,1) size 0x21
    2929                          RenderTableCell {TD} at (6,24) size 254x293 [r=1 c=1 rs=1 cs=1]
    3030                            RenderTable {TABLE} at (2,2) size 250x272
  • trunk/LayoutTests/platform/ios/tables/mozilla/bugs/bug22513-expected.txt

    r275515 r278931  
    1212              RenderInline {B} at (0,0) size 62x20
    1313                RenderInline {FONT} at (0,0) size 62x15
    14                   RenderText {#text} at (19,0) size 62x15
    15                     text run at (19,1) width 62: "Downloads"
     14                  RenderText {#text} at (19,-1) size 62x16
     15                    text run at (19,0) width 62: "Downloads"
    1616            RenderTableCell {TD} at (115,0) size 15x15 [bgcolor=#FFCC00] [r=0 c=2 rs=1 cs=1]
    1717              RenderImage {IMG} at (0,0) size 15x15
  • trunk/LayoutTests/platform/ios/tables/mozilla/bugs/bug82946-2-expected.txt

    r272100 r278931  
    1515                      RenderText {#text} at (0,0) size 0x0
    1616            RenderTableCell {TD} at (763,87) size 4x23 [r=0 c=1 rs=2 cs=1]
    17               RenderBR {BR} at (1,1) size 0x20
     17              RenderBR {BR} at (1,0) size 0x21
    1818          RenderTableRow {TR} at (0,147) size 768x48
    1919            RenderTableCell {TD} at (2,147) size 765x48 [r=1 c=0 rs=1 cs=2]
  • trunk/LayoutTests/platform/ios/tables/mozilla_expected_failures/bugs/bug89315-expected.txt

    r275515 r278931  
    3131                RenderInline {B} at (0,0) size 55x39
    3232                  RenderInline {SPAN} at (0,0) size 55x38
    33                     RenderText {#text} at (22,1) size 55x37
    34                       text run at (22,1) width 55: "Channel"
    35                       text run at (23,20) width 52: "number"
     33                    RenderText {#text} at (22,0) size 55x38
     34                      text run at (22,0) width 55: "Channel"
     35                      text run at (23,19) width 52: "number"
    3636                RenderText {#text} at (0,0) size 0x0
    3737              RenderTableCell {TD} at (98,22) size 171x20 [border: (0.50px solid #000000) (0.50px none #808080)] [r=1 c=1 rs=1 cs=1]
    3838                RenderInline {B} at (0,0) size 95x20
    3939                  RenderInline {SPAN} at (0,0) size 95x19
    40                     RenderText {#text} at (38,1) size 95x18
    41                       text run at (38,1) width 95: "Member name"
     40                    RenderText {#text} at (38,0) size 95x19
     41                      text run at (38,0) width 95: "Member name"
    4242                RenderText {#text} at (0,0) size 0x0
    4343              RenderTableCell {TD} at (268,22) size 100x39 [border: (0.50px solid #000000) (0.50px none #808080)] [r=1 c=2 rs=1 cs=1]
     
    129129              RenderTableCell {TD} at (98,110) size 171x17 [border: (0.50px none #808080) none (0.50px none #808080)] [r=4 c=1 rs=1 cs=1]
    130130                RenderInline {FONT} at (0,0) size 55x16
    131                   RenderText {#text} at (7,1) size 55x15
    132                     text run at (7,1) width 55: "Don Coon"
     131                  RenderText {#text} at (7,0) size 55x16
     132                    text run at (7,0) width 55: "Don Coon"
    133133                RenderText {#text} at (0,0) size 0x0
    134134              RenderTableCell {TD} at (268,110) size 100x21 [border: (0.50px none #808080) none (0.50px none #808080)] [r=4 c=2 rs=1 cs=1]
     
    141141              RenderTableCell {TD} at (0,130) size 99x17 [border: (0.50px none #808080) none] [r=5 c=0 rs=1 cs=1]
    142142                RenderInline {FONT} at (0,0) size 14x16
    143                   RenderText {#text} at (42,1) size 14x15
    144                     text run at (42,1) width 14: "05"
     143                  RenderText {#text} at (42,0) size 14x16
     144                    text run at (42,0) width 14: "05"
    145145                RenderText {#text} at (0,0) size 0x0
    146146              RenderTableCell {TD} at (98,130) size 171x33 [border: (0.50px none #808080) none (0.50px none #808080)] [r=5 c=1 rs=1 cs=1]
     
    172172              RenderTableCell {TD} at (0,163) size 99x17 [border: (0.50px none #808080) none] [r=6 c=0 rs=1 cs=1]
    173173                RenderInline {FONT} at (0,0) size 14x16
    174                   RenderText {#text} at (42,1) size 14x15
    175                     text run at (42,1) width 14: "06"
     174                  RenderText {#text} at (42,0) size 14x16
     175                    text run at (42,0) width 14: "06"
    176176                RenderText {#text} at (0,0) size 0x0
    177177              RenderTableCell {TD} at (98,163) size 171x33 [border: (0.50px none #808080) none (0.50px none #808080)] [r=6 c=1 rs=1 cs=1]
    178178                RenderInline {FONT} at (0,0) size 135x32
    179                   RenderText {#text} at (7,1) size 135x31
    180                     text run at (7,1) width 135: "Gene Pheiffer                   "
    181                     text run at (7,17) width 81: "Alberto Lanzas"
     179                  RenderText {#text} at (7,0) size 135x32
     180                    text run at (7,0) width 135: "Gene Pheiffer                   "
     181                    text run at (7,16) width 81: "Alberto Lanzas"
    182182                RenderText {#text} at (0,0) size 0x0
    183183              RenderTableCell {TD} at (268,163) size 100x33 [border: (0.50px none #808080) none (0.50px none #808080)] [r=6 c=2 rs=1 cs=1]
     
    207207              RenderTableCell {TD} at (98,195) size 171x17 [border: (0.50px none #808080) none (0.50px none #808080)] [r=7 c=1 rs=1 cs=1]
    208208                RenderInline {FONT} at (0,0) size 50x16
    209                   RenderText {#text} at (7,1) size 50x15
    210                     text run at (7,1) width 50: "Phil Cole"
     209                  RenderText {#text} at (7,0) size 50x16
     210                    text run at (7,0) width 50: "Phil Cole"
    211211                RenderText {#text} at (0,0) size 0x0
    212212              RenderTableCell {TD} at (268,195) size 100x17 [border: (0.50px none #808080) none (0.50px none #808080)] [r=7 c=2 rs=1 cs=1]
  • trunk/LayoutTests/platform/mac/fast/text/basic/generic-family-reset-expected.txt

    r275515 r278931  
    8181            RenderTableCell {TD} at (10,350) size 377x15 [r=5 c=0 rs=1 cs=1]
    8282              RenderInline {TT} at (0,0) size 187x13
    83                 RenderText {#text} at (1,1) size 187x13
    84                   text run at (1,2) width 187: "default font; font-size: 0.8em;"
     83                RenderText {#text} at (1,0) size 187x14
     84                  text run at (1,1) width 187: "default font; font-size: 0.8em;"
    8585              RenderText {#text} at (0,0) size 0x0
    8686            RenderTableCell {TD} at (397,349) size 377x17 [r=5 c=1 rs=1 cs=1]
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug106795-expected.txt

    r272100 r278931  
    88          RenderTableRow {TR} at (0,0) size 781x38
    99            RenderTableCell {TD} at (0,8) size 781x21 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
    10               RenderBR {BR} at (1,1) size 0x19
     10              RenderBR {BR} at (1,0) size 0x20
    1111          RenderTableRow {TR} at (0,37) size 781x6
    1212            RenderTableCell {TD} at (0,37) size 781x6 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1]
     
    1414          RenderTableRow {TR} at (0,42) size 781x38
    1515            RenderTableCell {TD} at (0,51) size 781x21 [bgcolor=#CC0000] [border: (1px inset #808080)] [r=2 c=0 rs=1 cs=1]
    16               RenderBR {BR} at (1,1) size 0x19
     16              RenderBR {BR} at (1,0) size 0x20
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug1188-expected.txt

    r275515 r278931  
    8888                RenderInline {A} at (0,0) size 132x19 [color=#0000EE]
    8989                  RenderInline {FONT} at (0,0) size 132x16 [color=#0066FF]
    90                     RenderText {#text} at (14,1) size 132x16
    91                       text run at (14,2) width 132: "Hassle-Free Upgrades"
     90                    RenderText {#text} at (14,0) size 132x17
     91                      text run at (14,1) width 132: "Hassle-Free Upgrades"
    9292                RenderText {#text} at (0,0) size 0x0
    9393            RenderTableRow {TR} at (0,157) size 600x20
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug126742-expected.txt

    r275515 r278931  
    3838                RenderInline {A} at (0,0) size 64x19 [color=#0000EE]
    3939                  RenderInline {FONT} at (0,0) size 64x19
    40                     RenderText {#text} at (360,-1) size 64x19
     40                    RenderText {#text} at (360,-1) size 64x20
    4141                      text run at (360,0) width 64: "Homework"
    4242            RenderTableRow {TR} at (0,187) size 784x33
     
    5858                RenderInline {A} at (0,0) size 68x19 [color=#0000EE]
    5959                  RenderInline {FONT} at (0,0) size 68x19
    60                     RenderText {#text} at (358,-1) size 22x19
     60                    RenderText {#text} at (358,-1) size 22x20
    6161                      text run at (358,0) width 22: "Lab"
    6262                    RenderInline {U} at (0,0) size 47x19
    63                       RenderText {#text} at (379,-1) size 47x19
     63                      RenderText {#text} at (379,-1) size 47x20
    6464                        text run at (379,0) width 47: "oratory"
    6565            RenderTableRow {TR} at (0,283) size 784x33
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug1318-expected.txt

    r275515 r278931  
    2121            RenderTableCell {TD} at (0,75) size 558x18 [r=1 c=0 rs=1 cs=1]
    2222              RenderInline {FONT} at (0,0) size 142x16
    23                 RenderText {#text} at (415,1) size 142x16
    24                   text run at (415,2) width 142: "I agree with the program"
     23                RenderText {#text} at (415,0) size 142x17
     24                  text run at (415,1) width 142: "I agree with the program"
    2525              RenderText {#text} at (0,0) size 0x0
    2626            RenderTableCell {TD} at (557,74) size 66x20 [r=1 c=1 rs=1 cs=1]
     
    2929            RenderTableCell {TD} at (0,95) size 558x18 [r=2 c=0 rs=1 cs=1]
    3030              RenderInline {FONT} at (0,0) size 153x16
    31                 RenderText {#text} at (404,1) size 153x16
    32                   text run at (404,2) width 153: "I think vouchers are wrong"
     31                RenderText {#text} at (404,0) size 153x17
     32                  text run at (404,1) width 153: "I think vouchers are wrong"
    3333              RenderText {#text} at (0,0) size 0x0
    3434            RenderTableCell {TD} at (557,94) size 66x20 [r=2 c=1 rs=1 cs=1]
     
    3838              RenderInline {A} at (0,0) size 76x19 [color=#0000EE]
    3939                RenderInline {FONT} at (0,0) size 76x16
    40                   RenderText {#text} at (273,1) size 76x16
    41                     text run at (273,2) width 76: "View Results"
     40                  RenderText {#text} at (273,0) size 76x17
     41                    text run at (273,1) width 76: "View Results"
    4242              RenderInline {FONT} at (0,0) size 0x16
    4343                RenderText {#text} at (0,0) size 0x0
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug16252-expected.txt

    r275515 r278931  
    2222                            RenderInline {FONT} at (0,0) size 245x16
    2323                              RenderInline {B} at (0,0) size 245x16
    24                                 RenderText {#text} at (2,2) size 245x16
    25                                   text run at (2,3) width 245: "CHAMBERLAIN'S CAREER STATISTICS"
     24                                RenderText {#text} at (2,1) size 245x17
     25                                  text run at (2,2) width 245: "CHAMBERLAIN'S CAREER STATISTICS"
    2626                        RenderTableRow {TR} at (0,22) size 260x277
    2727                          RenderTableCell {TD} at (0,149) size 6x23 [bgcolor=#FFFFFF] [r=1 c=0 rs=1 cs=1]
    28                             RenderBR {BR} at (2,2) size 0x19
     28                            RenderBR {BR} at (2,1) size 0x20
    2929                          RenderTableCell {TD} at (6,22) size 254x277 [r=1 c=1 rs=1 cs=1]
    3030                            RenderTable {TABLE} at (2,2) size 250x256
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug22513-expected.txt

    r275515 r278931  
    1212              RenderInline {B} at (0,0) size 62x19
    1313                RenderInline {FONT} at (0,0) size 62x13
    14                   RenderText {#text} at (19,0) size 62x13
    15                     text run at (19,1) width 62: "Downloads"
     14                  RenderText {#text} at (19,-1) size 62x14
     15                    text run at (19,0) width 62: "Downloads"
    1616            RenderTableCell {TD} at (115,0) size 15x15 [bgcolor=#FFCC00] [r=0 c=2 rs=1 cs=1]
    1717              RenderImage {IMG} at (0,0) size 15x15
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug57828-2-expected.txt

    r275515 r278931  
    4242              RenderInline {FONT} at (0,0) size 152x21
    4343                RenderInline {B} at (0,0) size 152x21
    44                   RenderText {#text} at (2,2) size 152x21
    45                     text run at (2,3) width 152: "Technology News"
     44                  RenderText {#text} at (2,1) size 152x22
     45                    text run at (2,2) width 152: "Technology News"
    4646              RenderInline {FONT} at (0,0) size 181x16
    47                 RenderText {#text} at (153,6) size 181x16
    48                   text run at (153,7) width 63: " - updated "
    49                   text run at (215,7) width 119: "12:15 PM ET Oct 24"
     47                RenderText {#text} at (153,5) size 181x17
     48                  text run at (153,6) width 63: " - updated "
     49                  text run at (215,6) width 119: "12:15 PM ET Oct 24"
    5050              RenderText {#text} at (0,0) size 0x0
    5151            RenderTableCell {TD} at (510,0) size 166x26 [r=0 c=1 rs=1 cs=1]
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug60804-expected.txt

    r275515 r278931  
    3434            RenderTableCell {TD} at (0,1) size 133x18 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
    3535              RenderInline {FONT} at (0,0) size 92x16
    36                 RenderText {#text} at (1,1) size 92x16
    37                   text run at (1,2) width 92: "American Starlex"
     36                RenderText {#text} at (1,0) size 92x17
     37                  text run at (1,1) width 92: "American Starlex"
    3838            RenderTableCell {TD} at (132,8) size 6x4 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
    3939              RenderImage {IMG} at (1,1) size 1x1
    4040            RenderTableCell {TD} at (137,1) size 305x18 [border: (1px inset #808080)] [r=0 c=2 rs=1 cs=1]
    4141              RenderInline {FONT} at (0,0) size 243x16
    42                 RenderText {#text} at (1,1) size 243x16
    43                   text run at (1,2) width 243: "Digital_Cameras DC200 New|In stock; Kodak"
     42                RenderText {#text} at (1,0) size 243x17
     43                  text run at (1,1) width 243: "Digital_Cameras DC200 New|In stock; Kodak"
    4444            RenderTableCell {TD} at (441,8) size 7x4 [border: (1px inset #808080)] [r=0 c=3 rs=1 cs=1]
    4545              RenderImage {IMG} at (1,1) size 1x1
    4646            RenderTableCell {TD} at (447,1) size 79x18 [border: (1px inset #808080)] [r=0 c=4 rs=1 cs=1]
    4747              RenderInline {FONT} at (0,0) size 44x16
    48                 RenderText {#text} at (34,1) size 44x16
    49                   text run at (34,2) width 44: "$270.00"
     48                RenderText {#text} at (34,0) size 44x17
     49                  text run at (34,1) width 44: "$270.00"
    5050            RenderTableCell {TD} at (525,8) size 6x4 [border: (1px inset #808080)] [r=0 c=5 rs=1 cs=1]
    5151              RenderImage {IMG} at (1,1) size 1x1
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug60807-expected.txt

    r275515 r278931  
    3434            RenderTableCell {TD} at (0,1) size 133x18 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
    3535              RenderInline {FONT} at (0,0) size 92x16
    36                 RenderText {#text} at (1,1) size 92x16
    37                   text run at (1,2) width 92: "American Starlex"
     36                RenderText {#text} at (1,0) size 92x17
     37                  text run at (1,1) width 92: "American Starlex"
    3838            RenderTableCell {TD} at (132,8) size 6x4 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
    3939              RenderImage {IMG} at (1,1) size 1x1
    4040            RenderTableCell {TD} at (137,1) size 305x18 [border: (1px inset #808080)] [r=0 c=2 rs=1 cs=1]
    4141              RenderInline {FONT} at (0,0) size 243x16
    42                 RenderText {#text} at (1,1) size 243x16
    43                   text run at (1,2) width 243: "Digital_Cameras DC200 New|In stock; Kodak"
     42                RenderText {#text} at (1,0) size 243x17
     43                  text run at (1,1) width 243: "Digital_Cameras DC200 New|In stock; Kodak"
    4444            RenderTableCell {TD} at (441,8) size 7x4 [border: (1px inset #808080)] [r=0 c=3 rs=1 cs=1]
    4545              RenderImage {IMG} at (1,1) size 1x1
    4646            RenderTableCell {TD} at (447,1) size 79x18 [border: (1px inset #808080)] [r=0 c=4 rs=1 cs=1]
    4747              RenderInline {FONT} at (0,0) size 44x16
    48                 RenderText {#text} at (34,1) size 44x16
    49                   text run at (34,2) width 44: "$270.00"
     48                RenderText {#text} at (34,0) size 44x17
     49                  text run at (34,1) width 44: "$270.00"
    5050            RenderTableCell {TD} at (525,8) size 6x4 [border: (1px inset #808080)] [r=0 c=5 rs=1 cs=1]
    5151              RenderImage {IMG} at (1,1) size 1x1
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug82946-2-expected.txt

    r272100 r278931  
    1515                      RenderText {#text} at (0,0) size 0x0
    1616            RenderTableCell {TD} at (763,86) size 4x21 [r=0 c=1 rs=2 cs=1]
    17               RenderBR {BR} at (1,1) size 0x19
     17              RenderBR {BR} at (1,0) size 0x20
    1818          RenderTableRow {TR} at (0,147) size 768x44
    1919            RenderTableCell {TD} at (2,147) size 765x44 [r=1 c=0 rs=1 cs=2]
  • trunk/Source/WebCore/ChangeLog

    r278930 r278931  
     12021-06-16  Alan Bujtas  <zalan@apple.com>
     2
     3        Content moves up when hovering over a link on Hacker News
     4        https://bugs.webkit.org/show_bug.cgi?id=226852
     5        <rdar://78537231>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Legacy line layout integral-rounds the root inline box's vertical position and this integral position
     10        gets propagated down to the descendant inline boxes when descendantsHaveSameLineHeightAndBaseline() is true.
     11        See LegacyInlineFlowBox::addToLine and LegacyInlineFlowBox::placeBoxesInBlockDirection for more details.
     12        This patch attempts to mirror this behavior in IFC.
     13
     14        Test: fast/inline/hidpi-legacy-integral-rounding-on-inline-boxes.html
     15
     16        * layout/integration/LayoutIntegrationInlineContentBuilder.cpp:
     17        (WebCore::LayoutIntegration::InlineContentBuilder::computeLineLevelVisualAdjustmentsForRuns const):
     18
    1192021-06-16  Frederic Wang  <fwang@igalia.com>
    220
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContentBuilder.cpp

    r278405 r278931  
    183183    for (size_t lineIndex = 0; lineIndex < lines.size(); ++lineIndex) {
    184184        auto lineNeedsLegacyIntegralVerticalPosition = [&] {
    185             // InlineTree rounds y position to integral value for certain content (see LegacyInlineFlowBox::placeBoxesInBlockDirection).
     185            // Legacy inline tree integral rounds the vertical position for certain content (see LegacyInlineFlowBox::placeBoxesInBlockDirection and ::addToLine).
     186            auto& rootInlineBox = inlineFormattingState.lineBoxes()[lineIndex].rootInlineBox();
    186187            auto& nonRootInlineLevelBoxList = inlineFormattingState.lineBoxes()[lineIndex].nonRootInlineLevelBoxes();
    187188            if (nonRootInlineLevelBoxList.isEmpty()) {
     
    189190                return true;
    190191            }
    191             // Text + <br> (or just <br> or text<span></span><br>) behaves like text.
    192192            for (auto& inlineLevelBox : nonRootInlineLevelBoxList) {
    193                 if (inlineLevelBox.isAtomicInlineLevelBox()) {
    194                     // Content like text<img> prevents legacy snapping.
     193                // See shouldClearDescendantsHaveSameLineHeightAndBaseline in LegacyInlineFlowBox::addToLine.
     194                auto contentPreventsIntegralSnapping = inlineLevelBox.isAtomicInlineLevelBox() || (inlineLevelBox.isLineBreakBox() && !m_layoutState.inStandardsMode());
     195                if (contentPreventsIntegralSnapping)
    195196                    return false;
    196                 }
     197
     198                auto& rootInlineBoxStyle = rootInlineBox.style();
     199                auto& inlineLevelBoxStyle = inlineLevelBox.style();
     200                auto stylePreventsIntegralSnapping = rootInlineBoxStyle.lineHeight() != inlineLevelBoxStyle.lineHeight() || inlineLevelBoxStyle.verticalAlign() != VerticalAlign::Baseline;
     201                if (stylePreventsIntegralSnapping)
     202                    return false;
     203
     204                auto& rootInlineBoxFontMetrics = rootInlineBoxStyle.fontCascade().fontMetrics();
     205                auto& inlineLevelBoxFontMetrics = inlineLevelBoxStyle.fontCascade().fontMetrics();
     206                auto fontPreventsIntegralSnapping = !rootInlineBoxFontMetrics.hasIdenticalAscentDescentAndLineGap(inlineLevelBoxFontMetrics);
     207                if (fontPreventsIntegralSnapping)
     208                    return false;
    197209            }
    198210            return true;
Note: See TracChangeset for help on using the changeset viewer.