Changeset 221974 in webkit


Ignore:
Timestamp:
Sep 13, 2017 10:14:54 AM (7 years ago)
Author:
Carlos Garcia Campos
Message:

[HarfBuzz] Wrong offset returned by HarfBuzzShaper::offsetForPosition in some cases
https://bugs.webkit.org/show_bug.cgi?id=176848

Reviewed by Michael Catanzaro.

Source/WebCore:

This patch rewrites HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition() to make it simpler and ensure we
return the right offset in all the cases, also honoring now the includePartialGlyphs parameter that we were
ignoring in FontCascade::offsetForPositionForComplexText().

Fixes several tests that started to fail after r221909.

  • platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:

(WebCore::FontCascade::offsetForPositionForComplexText const):

  • platform/graphics/harfbuzz/HarfBuzzShaper.cpp:

(WebCore::HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition):
(WebCore::HarfBuzzShaper::offsetForPosition):

  • platform/graphics/harfbuzz/HarfBuzzShaper.h:

LayoutTests:

Rebaseline several tests where we are now getting results similar to the mac ones.

  • platform/gtk/editing/execCommand/findString-2-expected.txt:
  • platform/gtk/editing/selection/14971-expected.png:
  • platform/gtk/editing/selection/14971-expected.txt:
  • platform/gtk/editing/selection/4895428-2-expected.png:
  • platform/gtk/editing/selection/4895428-2-expected.txt:
  • platform/gtk/editing/selection/5232159-expected.png:
  • platform/gtk/editing/selection/5232159-expected.txt:
  • platform/gtk/editing/selection/collapse-selection-in-bidi-expected.txt:
  • platform/gtk/editing/selection/drag-select-1-expected.png:
  • platform/gtk/editing/selection/drag-select-1-expected.txt:
  • platform/gtk/editing/selection/editable-links-expected.png:
  • platform/gtk/editing/selection/editable-links-expected.txt:
  • platform/gtk/editing/selection/fake-doubleclick-expected.txt:
  • platform/gtk/editing/selection/fake-drag-expected.txt:
  • platform/gtk/editing/selection/select-across-readonly-input-1-expected.png:
  • platform/gtk/editing/selection/select-across-readonly-input-1-expected.txt:
  • platform/gtk/editing/selection/select-across-readonly-input-2-expected.png:
  • platform/gtk/editing/selection/select-across-readonly-input-2-expected.txt:
  • platform/gtk/editing/selection/select-across-readonly-input-3-expected.png:
  • platform/gtk/editing/selection/select-across-readonly-input-3-expected.txt:
  • platform/gtk/editing/selection/select-across-readonly-input-4-expected.png:
  • platform/gtk/editing/selection/select-across-readonly-input-4-expected.txt:
  • platform/gtk/editing/selection/select-across-readonly-input-5-expected.png:
  • platform/gtk/editing/selection/select-across-readonly-input-5-expected.txt:
  • platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-br-expected.png:
  • platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-br-expected.txt:
  • platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-p-expected.png:
  • platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-p-expected.txt:
  • platform/gtk/fast/css/text-overflow-ellipsis-text-align-center-expected.png:
  • platform/gtk/fast/css/text-overflow-ellipsis-text-align-center-expected.txt:
  • platform/gtk/fast/css/text-overflow-ellipsis-text-align-left-expected.png:
  • platform/gtk/fast/css/text-overflow-ellipsis-text-align-left-expected.txt:
  • platform/gtk/fast/css/text-overflow-ellipsis-text-align-right-expected.png:
  • platform/gtk/fast/css/text-overflow-ellipsis-text-align-right-expected.txt:
  • platform/gtk/fast/repaint/japanese-rl-selection-repaint-expected.png:
  • platform/gtk/fast/repaint/japanese-rl-selection-repaint-expected.txt:
  • platform/gtk/fast/repaint/repaint-across-writing-mode-boundary-expected.png:
  • platform/gtk/fast/repaint/repaint-across-writing-mode-boundary-expected.txt:
  • platform/gtk/fast/repaint/selection-rl-expected.png:
  • platform/gtk/fast/repaint/selection-rl-expected.txt:
  • platform/gtk/fast/text/atsui-rtl-override-selection-expected.png:
  • platform/gtk/fast/text/atsui-rtl-override-selection-expected.txt:
  • platform/gtk/fast/text/in-rendered-text-rtl-expected.txt:
  • platform/gtk/svg/custom/foreignObject-crash-on-hover-expected.txt:
  • platform/gtk/svg/text/select-text-svgfont-expected.txt: Removed.
  • platform/gtk/transitions/svg-text-shadow-transition-expected.png:
  • platform/gtk/transitions/svg-text-shadow-transition-expected.txt:
Location:
trunk
Files:
1 deleted
51 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r221973 r221974  
     12017-09-13  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [HarfBuzz] Wrong offset returned by HarfBuzzShaper::offsetForPosition in some cases
     4        https://bugs.webkit.org/show_bug.cgi?id=176848
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Rebaseline several tests where we are now getting results similar to the mac ones.
     9
     10        * platform/gtk/editing/execCommand/findString-2-expected.txt:
     11        * platform/gtk/editing/selection/14971-expected.png:
     12        * platform/gtk/editing/selection/14971-expected.txt:
     13        * platform/gtk/editing/selection/4895428-2-expected.png:
     14        * platform/gtk/editing/selection/4895428-2-expected.txt:
     15        * platform/gtk/editing/selection/5232159-expected.png:
     16        * platform/gtk/editing/selection/5232159-expected.txt:
     17        * platform/gtk/editing/selection/collapse-selection-in-bidi-expected.txt:
     18        * platform/gtk/editing/selection/drag-select-1-expected.png:
     19        * platform/gtk/editing/selection/drag-select-1-expected.txt:
     20        * platform/gtk/editing/selection/editable-links-expected.png:
     21        * platform/gtk/editing/selection/editable-links-expected.txt:
     22        * platform/gtk/editing/selection/fake-doubleclick-expected.txt:
     23        * platform/gtk/editing/selection/fake-drag-expected.txt:
     24        * platform/gtk/editing/selection/select-across-readonly-input-1-expected.png:
     25        * platform/gtk/editing/selection/select-across-readonly-input-1-expected.txt:
     26        * platform/gtk/editing/selection/select-across-readonly-input-2-expected.png:
     27        * platform/gtk/editing/selection/select-across-readonly-input-2-expected.txt:
     28        * platform/gtk/editing/selection/select-across-readonly-input-3-expected.png:
     29        * platform/gtk/editing/selection/select-across-readonly-input-3-expected.txt:
     30        * platform/gtk/editing/selection/select-across-readonly-input-4-expected.png:
     31        * platform/gtk/editing/selection/select-across-readonly-input-4-expected.txt:
     32        * platform/gtk/editing/selection/select-across-readonly-input-5-expected.png:
     33        * platform/gtk/editing/selection/select-across-readonly-input-5-expected.txt:
     34        * platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-br-expected.png:
     35        * platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-br-expected.txt:
     36        * platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-p-expected.png:
     37        * platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-p-expected.txt:
     38        * platform/gtk/fast/css/text-overflow-ellipsis-text-align-center-expected.png:
     39        * platform/gtk/fast/css/text-overflow-ellipsis-text-align-center-expected.txt:
     40        * platform/gtk/fast/css/text-overflow-ellipsis-text-align-left-expected.png:
     41        * platform/gtk/fast/css/text-overflow-ellipsis-text-align-left-expected.txt:
     42        * platform/gtk/fast/css/text-overflow-ellipsis-text-align-right-expected.png:
     43        * platform/gtk/fast/css/text-overflow-ellipsis-text-align-right-expected.txt:
     44        * platform/gtk/fast/repaint/japanese-rl-selection-repaint-expected.png:
     45        * platform/gtk/fast/repaint/japanese-rl-selection-repaint-expected.txt:
     46        * platform/gtk/fast/repaint/repaint-across-writing-mode-boundary-expected.png:
     47        * platform/gtk/fast/repaint/repaint-across-writing-mode-boundary-expected.txt:
     48        * platform/gtk/fast/repaint/selection-rl-expected.png:
     49        * platform/gtk/fast/repaint/selection-rl-expected.txt:
     50        * platform/gtk/fast/text/atsui-rtl-override-selection-expected.png:
     51        * platform/gtk/fast/text/atsui-rtl-override-selection-expected.txt:
     52        * platform/gtk/fast/text/in-rendered-text-rtl-expected.txt:
     53        * platform/gtk/svg/custom/foreignObject-crash-on-hover-expected.txt:
     54        * platform/gtk/svg/text/select-text-svgfont-expected.txt: Removed.
     55        * platform/gtk/transitions/svg-text-shadow-transition-expected.png:
     56        * platform/gtk/transitions/svg-text-shadow-transition-expected.txt:
     57
    1582017-09-13  Matt Lewis  <jlewis3@apple.com>
    259
  • trunk/LayoutTests/platform/gtk/editing/execCommand/findString-2-expected.txt

    r221911 r221974  
    1 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 2 of #text > SPAN > DIV > BODY > HTML > #document to 2 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     1EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    22EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    3 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > SPAN > DIV > BODY > HTML > #document to 2 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     3EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    44EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    55EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
  • trunk/LayoutTests/platform/gtk/editing/selection/14971-expected.txt

    r221911 r221974  
    1919            text run at (39,0) width 39: "World"
    2020selection start: position 0 of child 0 {#text} of child 0 {SPAN} of child 2 {DIV} of body
    21 selection end:   position 3 of child 0 {#text} of child 2 {SPAN} of child 2 {DIV} of body
     21selection end:   position 2 of child 0 {#text} of child 2 {SPAN} of child 2 {DIV} of body
  • trunk/LayoutTests/platform/gtk/editing/selection/4895428-2-expected.txt

    r221911 r221974  
    2626          RenderText {#text} at (0,0) size 50x17
    2727            text run at (0,0) width 50: "Success"
    28 caret: position 5 of child 0 {#text} of child 1 {TD} of child 0 {TR} of child 0 {TBODY} of child 0 {TABLE} of child 2 {DIV} of body
     28caret: position 4 of child 0 {#text} of child 1 {TD} of child 0 {TR} of child 0 {TBODY} of child 0 {TABLE} of child 2 {DIV} of body
  • trunk/LayoutTests/platform/gtk/editing/selection/5232159-expected.txt

    r221911 r221974  
    2525        text run at (0,72) width 643: "Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Integer ut tortor."
    2626selection start: position 3 of child 0 {#text} of child 1 {SPAN} of child 1 {DIV} of child 1 {DIV} of child 3 {DIV} of body
    27 selection end:   position 236 of child 2 {#text} of child 1 {DIV} of child 1 {DIV} of child 3 {DIV} of body
     27selection end:   position 237 of child 2 {#text} of child 1 {DIV} of child 1 {DIV} of child 3 {DIV} of body
  • trunk/LayoutTests/platform/gtk/editing/selection/collapse-selection-in-bidi-expected.txt

    r221911 r221974  
    44PASS Selection is [anchorNode: [object Text](אבגדה) anchorOffset: 1 focusNode: [object Text](אבגדה) focusOffset: 1 isCollapsed: true]
    55PASS Selection is [anchorNode: [object Text](hello) anchorOffset: 2 focusNode: [object Text](hello) focusOffset: 2 isCollapsed: true]
    6 PASS Selection is [anchorNode: [object Text](hello) anchorOffset: 5 focusNode: [object Text](hello) focusOffset: 5 isCollapsed: true]
     6PASS Selection is [anchorNode: [object Text](hello) anchorOffset: 4 focusNode: [object Text](hello) focusOffset: 4 isCollapsed: true]
    77PASS successfullyParsed is true
    88
  • trunk/LayoutTests/platform/gtk/editing/selection/drag-select-1-expected.txt

    r221911 r221974  
    1818layer at (81,47) size 185x18
    1919  RenderBlock {DIV} at (3,3) size 185x18
    20 selection start: position 5 of child 0 {#text} of child 0 {SPAN} of child 2 {DIV} of body
     20selection start: position 4 of child 0 {#text} of child 0 {SPAN} of child 2 {DIV} of body
    2121selection end:   position 1 of child 1 {#text} of child 2 {DIV} of body
  • trunk/LayoutTests/platform/gtk/editing/selection/editable-links-expected.txt

    r221911 r221974  
    11EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 5 of BODY > HTML > #document
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    3 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 7 of #text > A > BODY > HTML > #document to 7 of #text > A > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     3EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 6 of #text > A > BODY > HTML > #document to 6 of #text > A > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    44EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    55layer at (0,0) size 800x600
     
    1515      RenderText {#text} at (142,0) size 4x17
    1616        text run at (142,0) width 4: "."
    17 caret: position 7 of child 0 {#text} of child 3 {A} of body
     17caret: position 6 of child 0 {#text} of child 3 {A} of body
  • trunk/LayoutTests/platform/gtk/editing/selection/fake-doubleclick-expected.txt

    r221911 r221974  
    11EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    3 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 2 of #text > DIV > BODY > HTML > #document to 2 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     3EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    44EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    5 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > DIV > BODY > HTML > #document to 2 of #text > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 6 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     5EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 6 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    66EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    77layer at (0,0) size 800x600
  • trunk/LayoutTests/platform/gtk/editing/selection/fake-drag-expected.txt

    r221911 r221974  
    33EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    44EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    5 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     5EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 4 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    66EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    7 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 6 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     7EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 4 of #text > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    88EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    9 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 6 of #text > DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 9 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     9EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 8 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    1010EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1111Select me, select me, select me
  • trunk/LayoutTests/platform/gtk/editing/selection/select-across-readonly-input-1-expected.txt

    r221911 r221974  
    2424    RenderText {#text} at (0,0) size 35x17
    2525      text run at (0,0) width 35: "hello"
    26 caret: position 5 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 1 {INPUT} of child 5 {DIV} of body
     26selection start: position 4 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 1 {INPUT} of child 5 {DIV} of body
     27selection end:   position 5 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 1 {INPUT} of child 5 {DIV} of body
  • trunk/LayoutTests/platform/gtk/editing/selection/select-across-readonly-input-2-expected.txt

    r221911 r221974  
    2525      text run at (0,0) width 35: "hello"
    2626selection start: position 0 of child 2 {#text} of child 5 {DIV} of body
    27 selection end:   position 3 of child 0 {#text} of child 3 {SPAN} of child 5 {DIV} of body
     27selection end:   position 2 of child 0 {#text} of child 3 {SPAN} of child 5 {DIV} of body
  • trunk/LayoutTests/platform/gtk/editing/selection/select-across-readonly-input-3-expected.txt

    r221911 r221974  
    2424    RenderText {#text} at (0,0) size 39x17
    2525      text run at (0,0) width 39: "world"
    26 selection start: position 3 of child 0 {#text} of child 1 {SPAN} of child 5 {DIV} of body
     26selection start: position 2 of child 0 {#text} of child 1 {SPAN} of child 5 {DIV} of body
    2727selection end:   position 1 of child 2 {#text} of child 5 {DIV} of body
  • trunk/LayoutTests/platform/gtk/editing/selection/select-across-readonly-input-4-expected.txt

    r221911 r221974  
    3131    RenderText {#text} at (0,0) size 52x17
    3232      text run at (0,0) width 52: "WebKit"
    33 caret: position 5 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 1 {INPUT} of child 5 {DIV} of body
     33selection start: position 4 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 1 {INPUT} of child 5 {DIV} of body
     34selection end:   position 5 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 1 {INPUT} of child 5 {DIV} of body
  • trunk/LayoutTests/platform/gtk/editing/selection/select-across-readonly-input-5-expected.txt

    r221911 r221974  
    3232      text run at (0,0) width 52: "WebKit"
    3333selection start: position 0 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 5 {INPUT} of child 5 {DIV} of body
    34 selection end:   position 3 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 5 {INPUT} of child 5 {DIV} of body
     34selection end:   position 2 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 5 {INPUT} of child 5 {DIV} of body
  • trunk/LayoutTests/platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-br-expected.txt

    r221911 r221974  
    1515            text run at (23,60) width 105 RTL: "\x{5D0}\x{5D9}\x{5DF} \x{5DC}\x{5D9} \x{5E9}\x{5DD}."
    1616      RenderBlock {PRE} at (0,212) size 784x0
    17 selection start: position 4 of child 0 {#text} of child 1 {P} of child 3 {DIV} of body
     17selection start: position 5 of child 0 {#text} of child 1 {P} of child 3 {DIV} of body
    1818selection end:   position 5 of child 2 {#text} of child 1 {P} of child 3 {DIV} of body
  • trunk/LayoutTests/platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-p-expected.txt

    r221911 r221974  
    1515            text run at (0,60) width 105 RTL: "\x{5D0}\x{5D9}\x{5DF} \x{5DC}\x{5D9} \x{5E9}\x{5DD}."
    1616      RenderBlock {PRE} at (0,212) size 784x0
    17 selection start: position 4 of child 0 {#text} of child 1 {P} of child 3 {DIV} of body
     17selection start: position 5 of child 0 {#text} of child 1 {P} of child 3 {DIV} of body
    1818selection end:   position 5 of child 0 {#text} of child 2 {P} of child 3 {DIV} of body
  • trunk/LayoutTests/platform/gtk/fast/css/text-overflow-ellipsis-text-align-center-expected.txt

    r221911 r221974  
    3434        RenderText {#text} at (0,0) size 507x21
    3535          text run at (0,0) width 507: "Right-To-Left containing replaced content blocking the ellipsis"
    36 layer at (8,119) size 310x20 clip at (9,120) size 308x18 scrollWidth 718
     36layer at (8,119) size 310x20 clip at (9,120) size 308x18 scrollWidth 721
    3737  RenderBlock {DIV} at (0,111) size 310x21 [border: (1px solid #000000)]
    38     RenderText {#text} at (1,1) size 718x17
    39       text run at (1,1) width 718: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
    40 layer at (8,200) size 310x74 clip at (9,201) size 308x72 scrollWidth 718
     38    RenderText {#text} at (3,1) size 719x17
     39      text run at (3,1) width 719: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     40layer at (8,200) size 310x74 clip at (9,201) size 308x72 scrollWidth 721
    4141  RenderBlock {DIV} at (0,192) size 310x75 [border: (1px solid #000000)]
    42     RenderText {#text} at (1,1) size 718x17
    43       text run at (1,1) width 718: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     42    RenderText {#text} at (3,1) size 719x17
     43      text run at (3,1) width 719: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
    4444    RenderBR {BR} at (0,0) size 0x0
    45     RenderText {#text} at (1,19) size 708x17
    46       text run at (1,19) width 708: "orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     45    RenderText {#text} at (2,19) size 708x17
     46      text run at (2,19) width 708: "orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
    4747    RenderBR {BR} at (0,0) size 0x0
    48     RenderText {#text} at (1,37) size 700x17
    49       text run at (1,37) width 700: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     48    RenderText {#text} at (4,37) size 700x17
     49      text run at (4,37) width 700: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
    5050    RenderBR {BR} at (0,0) size 0x0
    51     RenderText {#text} at (1,55) size 695x17
    52       text run at (1,55) width 695: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     51    RenderText {#text} at (2,55) size 696x17
     52      text run at (2,55) width 696: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
    5353    RenderBR {BR} at (0,0) size 0x0
    5454layer at (8,335) size 310x31 clip at (9,336) size 308x29 scrollWidth 747
     
    6666    RenderText {#text} at (297,12) size 447x17
    6767      text run at (297,12) width 447: "ipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
    68 layer at (8,518) size 310x20 clip at (9,519) size 308x18 scrollX 412 scrollWidth 721
     68layer at (8,518) size 310x20 clip at (9,519) size 308x18 scrollX 410 scrollWidth 718
    6969  RenderBlock {DIV} at (0,510) size 310x21 [border: (1px solid #000000)]
    70     RenderText {#text} at (-411,1) size 719x17
    71       text run at (-411,1) width 718 RTL override: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
    72 layer at (8,599) size 310x74 clip at (9,600) size 308x72 scrollX 412 scrollWidth 721
     70    RenderText {#text} at (-409,1) size 718x17
     71      text run at (-409,1) width 718 RTL override: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     72layer at (8,599) size 310x74 clip at (9,600) size 308x72 scrollX 410 scrollWidth 718
    7373  RenderBlock {DIV} at (0,591) size 310x75 [border: (1px solid #000000)]
    74     RenderText {#text} at (-411,1) size 719x17
    75       text run at (-411,1) width 718 RTL override: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     74    RenderText {#text} at (-409,1) size 718x17
     75      text run at (-409,1) width 718 RTL override: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
    7676    RenderBR {BR} at (0,0) size 0x0
    77     RenderText {#text} at (-400,19) size 708x17
    78       text run at (-400,19) width 708 RTL override: "orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     77    RenderText {#text} at (-399,19) size 708x17
     78      text run at (-399,19) width 708 RTL override: "orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
    7979    RenderBR {BR} at (0,0) size 0x0
    80     RenderText {#text} at (-394,37) size 700x17
    81       text run at (-394,37) width 700 RTL override: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     80    RenderText {#text} at (-391,37) size 700x17
     81      text run at (-391,37) width 700 RTL override: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
    8282    RenderBR {BR} at (0,0) size 0x0
    8383    RenderText {#text} at (-386,55) size 695x17
  • trunk/LayoutTests/platform/gtk/fast/css/text-overflow-ellipsis-text-align-left-expected.txt

    r221911 r221974  
    6666    RenderText {#text} at (297,12) size 447x17
    6767      text run at (297,12) width 447: "ipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
    68 layer at (8,518) size 310x20 clip at (9,519) size 308x18 scrollX 415 scrollWidth 723
     68layer at (8,518) size 310x20 clip at (9,519) size 308x18 scrollX 410 scrollWidth 718
    6969  RenderBlock {DIV} at (0,510) size 310x21 [border: (1px solid #000000)]
    70     RenderText {#text} at (-414,1) size 718x17
    71       text run at (-414,1) width 718 RTL override: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
    72 layer at (8,599) size 310x74 clip at (9,600) size 308x72 scrollX 415 scrollWidth 723
     70    RenderText {#text} at (-409,1) size 718x17
     71      text run at (-409,1) width 718 RTL override: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     72layer at (8,599) size 310x74 clip at (9,600) size 308x72 scrollX 410 scrollWidth 718
    7373  RenderBlock {DIV} at (0,591) size 310x75 [border: (1px solid #000000)]
    74     RenderText {#text} at (-414,1) size 718x17
    75       text run at (-414,1) width 718 RTL override: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     74    RenderText {#text} at (-409,1) size 718x17
     75      text run at (-409,1) width 718 RTL override: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
    7676    RenderBR {BR} at (0,0) size 0x0
    77     RenderText {#text} at (-401,19) size 708x17
    78       text run at (-401,19) width 708 RTL override: "orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     77    RenderText {#text} at (-399,19) size 708x17
     78      text run at (-399,19) width 708 RTL override: "orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
    7979    RenderBR {BR} at (0,0) size 0x0
    80     RenderText {#text} at (-397,37) size 700x17
    81       text run at (-397,37) width 700 RTL override: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     80    RenderText {#text} at (-391,37) size 700x17
     81      text run at (-391,37) width 700 RTL override: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
    8282    RenderBR {BR} at (0,0) size 0x0
    8383    RenderText {#text} at (-386,55) size 695x17
  • trunk/LayoutTests/platform/gtk/fast/css/text-overflow-ellipsis-text-align-right-expected.txt

    r221911 r221974  
    3434        RenderText {#text} at (0,0) size 507x21
    3535          text run at (0,0) width 507: "Right-To-Left containing replaced content blocking the ellipsis"
    36 layer at (8,119) size 310x20 clip at (9,120) size 308x18 scrollWidth 718
     36layer at (8,119) size 310x20 clip at (9,120) size 308x18 scrollWidth 723
    3737  RenderBlock {DIV} at (0,111) size 310x21 [border: (1px solid #000000)]
    38     RenderText {#text} at (1,1) size 718x17
    39       text run at (1,1) width 718: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
    40 layer at (8,200) size 310x74 clip at (9,201) size 308x72 scrollWidth 718
     38    RenderText {#text} at (6,1) size 718x17
     39      text run at (6,1) width 718: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     40layer at (8,200) size 310x74 clip at (9,201) size 308x72 scrollWidth 723
    4141  RenderBlock {DIV} at (0,192) size 310x75 [border: (1px solid #000000)]
    42     RenderText {#text} at (1,1) size 718x17
    43       text run at (1,1) width 718: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     42    RenderText {#text} at (6,1) size 718x17
     43      text run at (6,1) width 718: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
    4444    RenderBR {BR} at (0,0) size 0x0
    45     RenderText {#text} at (1,19) size 708x17
    46       text run at (1,19) width 708: "orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     45    RenderText {#text} at (3,19) size 708x17
     46      text run at (3,19) width 708: "orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
    4747    RenderBR {BR} at (0,0) size 0x0
    48     RenderText {#text} at (1,37) size 700x17
    49       text run at (1,37) width 700: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     48    RenderText {#text} at (7,37) size 700x17
     49      text run at (7,37) width 700: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
    5050    RenderBR {BR} at (0,0) size 0x0
    51     RenderText {#text} at (1,55) size 695x17
    52       text run at (1,55) width 695: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     51    RenderText {#text} at (4,55) size 695x17
     52      text run at (4,55) width 695: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
    5353    RenderBR {BR} at (0,0) size 0x0
    5454layer at (8,335) size 310x31 clip at (9,336) size 308x29 scrollWidth 747
  • trunk/LayoutTests/platform/gtk/fast/repaint/japanese-rl-selection-repaint-expected.txt

    r221912 r221974  
    1515        text run at (205,5) width 546: "\x{3064}\x{3051}\x{305F}\x{3059}\x{3070}\x{3089}\x{3057}\x{3044}\x{8A18}\x{4E8B}\x{304C}\x{3069}\x{3053}\x{306B}\x{3042}\x{3063}\x{305F}\x{304B}\x{5FD8}\x{308C}\x{3066}\x{3057}\x{307E}\x{3063}\x{305F}\x{7D4C}"
    1616        text run at (230,5) width 551: "\x{9A13}\x{306F}\x{3042}\x{308A}\x{307E}\x{3059}\x{304B} \x{306A}\x{3089}\x{30BF}\x{30A4}\x{30C8}\x{30EB}\x{3068}\x{30A2}\x{30C9}\x{30EC}\x{30B9}\x{3060}\x{3051}\x{3067}\x{306A}\x{304F}\x{3001}\x{8A2A}\x{554F}"
    17 selection start: position 10 of child 0 {#text} of body
     17selection start: position 9 of child 0 {#text} of body
    1818selection end:   position 263 of child 0 {#text} of body
  • trunk/LayoutTests/platform/gtk/fast/repaint/repaint-across-writing-mode-boundary-expected.txt

    r221912 r221974  
    2020              text run at (20,1) width 181: "\x{7B2C}\x{4E8C}\x{6BB5}\x{843D} paragraph 2"
    2121selection start: position 8 of child 0 {#text} of child 0 {P} of child 3 {DIV} of child 1 {DIV} of body
    22 selection end:   position 13 of child 0 {#text} of child 0 {P} of child 3 {DIV} of child 1 {DIV} of body
     22selection end:   position 12 of child 0 {#text} of child 0 {P} of child 3 {DIV} of child 1 {DIV} of body
  • trunk/LayoutTests/platform/gtk/fast/repaint/selection-rl-expected.txt

    r221912 r221974  
    3737        text run at (162,0) width 305: "Testing both hit testing and painting of selection."
    3838      RenderBR {BR} at (162,305) size 17x0
    39 selection start: position 6 of child 0 {#text} of child 1 {SPAN} of body
     39selection start: position 5 of child 0 {#text} of child 1 {SPAN} of body
    4040selection end:   position 19 of child 0 {#text} of child 1 {SPAN} of body
  • trunk/LayoutTests/platform/gtk/fast/text/atsui-rtl-override-selection-expected.txt

    r221675 r221974  
    1313        RenderText {#text} at (0,0) size 281x17
    1414          text run at (0,0) width 281: "\x{201C}remips\x{201D} should be highlighted in the above."
    15 selection start: position 2 of child 0 {#text} of child 3 {BDO} of body
     15selection start: position 3 of child 0 {#text} of child 3 {BDO} of body
    1616selection end:   position 9 of child 0 {#text} of child 3 {BDO} of body
  • trunk/LayoutTests/platform/gtk/fast/text/in-rendered-text-rtl-expected.txt

    r221912 r221974  
    2727            text run at (62,0) width 90 RTL: "\x{5D0}\x{5DB}\x{5DC}\x{5EA} \x{5E4}\x{5DC}\x{5E4}\x{5DC} "
    2828        RenderText {#text} at (0,0) size 0x0
    29 caret: position 2 of child 0 {#text} of child 7 {SPAN} of body
     29caret: position 3 of child 0 {#text} of child 7 {SPAN} of body
  • trunk/LayoutTests/platform/gtk/svg/custom/foreignObject-crash-on-hover-expected.txt

    r221912 r221974  
    1414          text run at (0,36) width 187: "style=\"fill:red; stroke:blue;\"/>"
    1515      RenderSVGPath {path} at (99,129) size 202x203 [stroke={[type=SOLID] [color=#0000FF]}] [fill={[type=SOLID] [color=#FF0000]}] [data="M 50 80 L 250 80 L 150 280 Z"]
    16 caret: position 67 of child 3 {#text} of child 5 {foreignObject} of child 3 {g} of child 1 {svg} of document
     16caret: position 66 of child 3 {#text} of child 5 {foreignObject} of child 3 {g} of child 1 {svg} of document
  • trunk/LayoutTests/platform/gtk/transitions/svg-text-shadow-transition-expected.txt

    r221720 r221974  
    1111        RenderText {#text} at (0,0) size 0x0
    1212      RenderBlock {DIV} at (0,104) size 784x36
    13         RenderText {#text} at (0,0) size 577x17
    14           text run at (0,0) width 577: "PASS - \"text-shadow\" property for \"text\" element at 0s saw something close to: -25,-5,0,15"
    15         RenderBR {BR} at (577,0) size 0x17
    16         RenderText {#text} at (0,18) size 559x17
    17           text run at (0,18) width 559: "PASS - \"text-shadow\" property for \"text\" element at 1s saw something close to: 5,5,0,15"
    18         RenderBR {BR} at (559,18) size 0x17
     13        RenderText {#text} at (0,0) size 576x17
     14          text run at (0,0) width 576: "PASS - \"text-shadow\" property for \"text\" element at 0s saw something close to: -25,-5,0,15"
     15        RenderBR {BR} at (576,0) size 0x17
     16        RenderText {#text} at (0,18) size 558x17
     17          text run at (0,18) width 558: "PASS - \"text-shadow\" property for \"text\" element at 1s saw something close to: 5,5,0,15"
     18        RenderBR {BR} at (558,18) size 0x17
  • trunk/Source/WebCore/ChangeLog

    r221972 r221974  
     12017-09-13  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [HarfBuzz] Wrong offset returned by HarfBuzzShaper::offsetForPosition in some cases
     4        https://bugs.webkit.org/show_bug.cgi?id=176848
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        This patch rewrites HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition() to make it simpler and ensure we
     9        return the right offset in all the cases, also honoring now the includePartialGlyphs parameter that we were
     10        ignoring in FontCascade::offsetForPositionForComplexText().
     11
     12        Fixes several tests that started to fail after r221909.
     13
     14        * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
     15        (WebCore::FontCascade::offsetForPositionForComplexText const):
     16        * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
     17        (WebCore::HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition):
     18        (WebCore::HarfBuzzShaper::offsetForPosition):
     19        * platform/graphics/harfbuzz/HarfBuzzShaper.h:
     20
    1212017-09-13  Per Arne Vollan  <pvollan@apple.com>
    222
  • trunk/Source/WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp

    r219970 r221974  
    7979}
    8080
    81 int FontCascade::offsetForPositionForComplexText(const TextRun& run, float x, bool) const
     81int FontCascade::offsetForPositionForComplexText(const TextRun& run, float x, bool includePartialGlyphs) const
    8282{
    8383    HarfBuzzShaper shaper(this, run);
    8484    if (shaper.shape())
    85         return shaper.offsetForPosition(x);
     85        return shaper.offsetForPosition(x, includePartialGlyphs);
    8686    LOG_ERROR("Shaper couldn't shape text run.");
    8787    return 0;
  • trunk/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp

    r220797 r221974  
    102102}
    103103
    104 unsigned HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition(float targetX)
     104unsigned HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition(float targetX, bool includePartialGlyphs)
    105105{
    106106    ASSERT(targetX <= m_width);
    107107    float currentX = 0;
    108     float currentAdvance = m_advances[0];
    109108    unsigned glyphIndex = 0;
    110 
    111     // Sum up advances that belong to a character.
    112     while (glyphIndex < m_numGlyphs - 1 && m_glyphToCharacterIndexes[glyphIndex] == m_glyphToCharacterIndexes[glyphIndex + 1])
    113         currentAdvance += m_advances[++glyphIndex];
    114     currentAdvance = currentAdvance / 2.0;
    115     if (targetX <= currentAdvance)
    116         return rtl() ? m_numCharacters : 0;
    117 
    118     ++glyphIndex;
    119     while (glyphIndex < m_numGlyphs) {
    120         unsigned prevCharacterIndex = m_glyphToCharacterIndexes[glyphIndex - 1];
    121         float prevAdvance = currentAdvance;
    122         currentAdvance = m_advances[glyphIndex];
    123         while (glyphIndex < m_numGlyphs - 1 && m_glyphToCharacterIndexes[glyphIndex] == m_glyphToCharacterIndexes[glyphIndex + 1])
    124             currentAdvance += m_advances[++glyphIndex];
    125         currentAdvance = currentAdvance / 2.0;
    126         float nextX = currentX + prevAdvance + currentAdvance;
    127         if (currentX <= targetX && targetX <= nextX)
    128             return rtl() ? prevCharacterIndex : m_glyphToCharacterIndexes[glyphIndex];
    129         currentX = nextX;
    130         prevAdvance = currentAdvance;
     109    float characterWidth = 0;
     110    unsigned characterIndex = 0;
     111    do {
     112        characterIndex = m_glyphToCharacterIndexes[glyphIndex];
     113        characterWidth = m_advances[glyphIndex];
     114        while (glyphIndex < m_numGlyphs - 1 && m_glyphToCharacterIndexes[glyphIndex + 1] == characterIndex)
     115            characterWidth += m_advances[++glyphIndex];
     116
     117        if ((includePartialGlyphs && (targetX < currentX + characterWidth / 2.0))
     118            || (!includePartialGlyphs && (targetX < currentX + characterWidth)))
     119            return rtl() ? std::min(m_numCharacters, characterIndex + 1) : characterIndex;
     120
     121        if ((includePartialGlyphs && (targetX >= (currentX + characterWidth / 2.0) && targetX < currentX + characterWidth))
     122            || (!includePartialGlyphs && (targetX >= currentX && targetX < currentX + characterWidth)))
     123            break;
     124
     125        currentX += characterWidth;
    131126        ++glyphIndex;
    132     }
    133 
    134     return rtl() ? 0 : m_numCharacters;
     127    } while (glyphIndex < m_numGlyphs);
     128
     129    return rtl() ? characterIndex : std::min(m_numCharacters, characterIndex + 1);
    135130}
    136131
     
    582577}
    583578
    584 int HarfBuzzShaper::offsetForPosition(float targetX)
     579int HarfBuzzShaper::offsetForPosition(float targetX, bool includePartialGlyphs)
    585580{
    586581    int charactersSoFar = 0;
     
    595590            if (offsetForRun >= 0 && offsetForRun <= m_harfBuzzRuns[i]->width()) {
    596591                // The x value in question is within this script run.
    597                 const unsigned index = m_harfBuzzRuns[i]->characterIndexForXPosition(offsetForRun);
     592                const unsigned index = m_harfBuzzRuns[i]->characterIndexForXPosition(offsetForRun, includePartialGlyphs);
    598593                return charactersSoFar + index;
    599594            }
     
    605600            float offsetForRun = targetX - currentX;
    606601            if (offsetForRun >= 0 && offsetForRun <= m_harfBuzzRuns[i]->width()) {
    607                 const unsigned index = m_harfBuzzRuns[i]->characterIndexForXPosition(offsetForRun);
     602                const unsigned index = m_harfBuzzRuns[i]->characterIndexForXPosition(offsetForRun, includePartialGlyphs);
    608603                return charactersSoFar + index;
    609604            }
  • trunk/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.h

    r218799 r221974  
    5858    FloatPoint adjustStartPoint(const FloatPoint&);
    5959    float totalWidth() { return m_totalWidth; }
    60     int offsetForPosition(float targetX);
     60    int offsetForPosition(float targetX, bool includePartialGlyphs = true);
    6161    FloatRect selectionRect(const FloatPoint&, int height, unsigned from, unsigned to);
    6262
     
    7070        void setWidth(float width) { m_width = width; }
    7171
    72         unsigned characterIndexForXPosition(float targetX);
     72        unsigned characterIndexForXPosition(float targetX, bool includePartialGlyphs);
    7373        float xPositionForOffset(unsigned offset);
    7474
Note: See TracChangeset for help on using the changeset viewer.