Changeset 148791 in webkit


Ignore:
Timestamp:
Apr 20, 2013 9:41:15 AM (11 years ago)
Author:
glenn@skynav.com
Message:

REGRESSION (r147588): Line breaks occur in the middle of Hebrew words at haaertz.co.il and other websites
https://bugs.webkit.org/show_bug.cgi?id=114721

Reviewed by Dean Jackson.

Source/WebCore:

Tests: fast/text/line-break-after-empty-inline-hebrew.html

fast/text/line-break-after-inline-latin1.html

If prior context changes content or length after creating line break iterator, then need to
create new iterator with new prior context instead of using cached iterator with old prior context.

  • platform/text/TextBreakIterator.h:

(WebCore::LazyLineBreakIterator::LazyLineBreakIterator): Initialize members to cache reference to initialized prior context.
(WebCore::LazyLineBreakIterator::get): Create new iterator if prior context content reference changes.
(WebCore::LazyLineBreakIterator::resetStringAndReleaseIterator): Reset cached prior context references.
(LazyLineBreakIterator): Add members to cache reference to initialized prior context.

LayoutTests:

  • fast/text/line-break-after-empty-inline-hebrew-expected.txt: Added.
  • fast/text/line-break-after-empty-inline-hebrew.html: Added.
  • fast/text/line-break-after-inline-latin1-expected.txt: Added.
  • fast/text/line-break-after-inline-latin1.html: Added.
  • platform/mac/fast/writing-mode/Kusa-Makura-background-canvas-expected.txt: Rebaseline.
Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r148786 r148791  
     12013-04-20  Glenn Adams  <glenn@skynav.com>
     2
     3        REGRESSION (r147588): Line breaks occur in the middle of Hebrew words at haaertz.co.il and other websites
     4        https://bugs.webkit.org/show_bug.cgi?id=114721
     5
     6        Reviewed by Dean Jackson.
     7
     8        * fast/text/line-break-after-empty-inline-hebrew-expected.txt: Added.
     9        * fast/text/line-break-after-empty-inline-hebrew.html: Added.
     10        * fast/text/line-break-after-inline-latin1-expected.txt: Added.
     11        * fast/text/line-break-after-inline-latin1.html: Added.
     12        * platform/mac/fast/writing-mode/Kusa-Makura-background-canvas-expected.txt: Rebaseline.
     13
    1142013-04-19  Bear Travis  <betravis@adobe.com>
    215
  • trunk/LayoutTests/platform/mac/fast/writing-mode/Kusa-Makura-background-canvas-expected.txt

    r147613 r148791  
    15151515          RenderText {#text} at (1750,368) size 70x480
    15161516            text run at (1750,368) width 112: "\x{3057}\x{305F}\x{304C}\x{3001}\x{3069}\x{3053}\x{3067}"
    1517             text run at (1774,0) width 464: "\x{9CF4}\x{3044}\x{3066}\x{308B}\x{304B}\x{5F71}\x{3082}\x{5F62}\x{3082}\x{898B}\x{3048}\x{306C}\x{3002}\x{305F}\x{3060}\x{58F0}\x{3060}\x{3051}\x{304C}\x{660E}\x{3089}\x{304B}\x{306B}\x{805E}\x{3048}\x{308B}\x{3002}\x{305B}\x{3063}"
    1518             text run at (1802,0) width 32: "\x{305B}\x{3068}"
    1519           RenderRuby (inline) {RUBY} at (0,0) size 18x16
    1520             RenderRubyRun (anonymous) at (1799,31) size 24x18
     1517            text run at (1774,0) width 480: "\x{9CF4}\x{3044}\x{3066}\x{308B}\x{304B}\x{5F71}\x{3082}\x{5F62}\x{3082}\x{898B}\x{3048}\x{306C}\x{3002}\x{305F}\x{3060}\x{58F0}\x{3060}\x{3051}\x{304C}\x{660E}\x{3089}\x{304B}\x{306B}\x{805E}\x{3048}\x{308B}\x{3002}\x{305B}\x{3063}\x{305B}"
     1518            text run at (1802,0) width 16: "\x{3068}"
     1519          RenderRuby (inline) {RUBY} at (0,0) size 18x16
     1520            RenderRubyRun (anonymous) at (1799,15) size 24x18
    15211521              RenderRubyText {RT} at (-9,0) size 14x18
    15221522                RenderText {#text} at (2,0) size 10x18
     
    15261526                  RenderText {#text} at (3,1) size 18x16
    15271527                    text run at (3,1) width 16: "\x{5FD9}"
    1528           RenderText {#text} at (1802,48) size 18x48
    1529             text run at (1802,48) width 48: "\x{3057}\x{304F}\x{3001}"
    1530           RenderRuby (inline) {RUBY} at (0,0) size 18x32
    1531             RenderRubyRun (anonymous) at (1799,96) size 24x32
     1528          RenderText {#text} at (1802,32) size 18x48
     1529            text run at (1802,32) width 48: "\x{3057}\x{304F}\x{3001}"
     1530          RenderRuby (inline) {RUBY} at (0,0) size 18x32
     1531            RenderRubyRun (anonymous) at (1799,80) size 24x32
    15321532              RenderRubyText {RT} at (-9,0) size 14x32
    15331533                RenderText {#text} at (2,0) size 10x31
     
    15371537                  RenderText {#text} at (3,0) size 18x32
    15381538                    text run at (3,0) width 32: "\x{7D76}\x{9593}"
    1539           RenderText {#text} at (1802,128) size 18x128
    1540             text run at (1802,128) width 128: "\x{306A}\x{304F}\x{9CF4}\x{3044}\x{3066}\x{3044}\x{308B}\x{3002}"
     1539          RenderText {#text} at (1802,112) size 18x128
     1540            text run at (1802,112) width 128: "\x{306A}\x{304F}\x{9CF4}\x{3044}\x{3066}\x{3044}\x{308B}\x{3002}"
    15411541          RenderRuby (inline) {RUBY} at (0,0) size 18x48
    1542             RenderRubyRun (anonymous) at (1799,256) size 24x48
     1542            RenderRubyRun (anonymous) at (1799,240) size 24x48
    15431543              RenderRubyText {RT} at (-9,0) size 14x48
    15441544                RenderText {#text} at (2,0) size 10x48
     
    15481548                  RenderText {#text} at (3,0) size 18x48
    15491549                    text run at (3,0) width 48: "\x{65B9}\x{5E7E}\x{91CC}"
    1550           RenderText {#text} at (1802,304) size 18x112
    1551             text run at (1802,304) width 112: "\x{306E}\x{7A7A}\x{6C17}\x{304C}\x{4E00}\x{9762}\x{306B}"
    1552           RenderRuby (inline) {RUBY} at (0,0) size 18x16
    1553             RenderRubyRun (anonymous) at (1799,415) size 24x18
     1550          RenderText {#text} at (1802,288) size 18x112
     1551            text run at (1802,288) width 112: "\x{306E}\x{7A7A}\x{6C17}\x{304C}\x{4E00}\x{9762}\x{306B}"
     1552          RenderRuby (inline) {RUBY} at (0,0) size 18x16
     1553            RenderRubyRun (anonymous) at (1799,399) size 24x18
    15541554              RenderRubyText {RT} at (-9,0) size 14x18
    15551555                RenderText {#text} at (2,0) size 10x18
     
    15591559                  RenderText {#text} at (3,1) size 18x16
    15601560                    text run at (3,1) width 16: "\x{86A4}"
    1561           RenderText {#text} at (1802,432) size 46x480
    1562             text run at (1802,432) width 48: "\x{306B}\x{523A}\x{3055}"
    1563             text run at (1830,0) width 368: "\x{308C}\x{3066}\x{3044}\x{305F}\x{305F}\x{307E}\x{308C}\x{306A}\x{3044}\x{3088}\x{3046}\x{306A}\x{6C17}\x{304C}\x{3059}\x{308B}\x{3002}\x{3042}\x{306E}\x{9CE5}\x{306E}\x{9CF4}\x{304F}"
    1564           RenderRuby (inline) {RUBY} at (0,0) size 18x16
    1565             RenderRubyRun (anonymous) at (1827,368) size 24x16
     1561          RenderText {#text} at (1802,416) size 46x480
     1562            text run at (1802,416) width 64: "\x{306B}\x{523A}\x{3055}\x{308C}"
     1563            text run at (1830,0) width 352: "\x{3066}\x{3044}\x{305F}\x{305F}\x{307E}\x{308C}\x{306A}\x{3044}\x{3088}\x{3046}\x{306A}\x{6C17}\x{304C}\x{3059}\x{308B}\x{3002}\x{3042}\x{306E}\x{9CE5}\x{306E}\x{9CF4}\x{304F}"
     1564          RenderRuby (inline) {RUBY} at (0,0) size 18x16
     1565            RenderRubyRun (anonymous) at (1827,352) size 24x16
    15661566              RenderRubyText {RT} at (-9,0) size 14x16
    15671567                RenderText {#text} at (2,3) size 10x10
     
    15711571                  RenderText {#text} at (3,0) size 18x16
    15721572                    text run at (3,0) width 16: "\x{97F3}"
    1573           RenderText {#text} at (1830,384) size 118x480
    1574             text run at (1830,384) width 96: "\x{306B}\x{306F}\x{77AC}\x{6642}\x{306E}\x{4F59}"
    1575             text run at (1854,0) width 480: "\x{88D5}\x{3082}\x{306A}\x{3044}\x{3002}\x{306E}\x{3069}\x{304B}\x{306A}\x{6625}\x{306E}\x{65E5}\x{3092}\x{9CF4}\x{304D}\x{5C3D}\x{304F}\x{3057}\x{3001}\x{9CF4}\x{304D}\x{3042}\x{304B}\x{3057}\x{3001}\x{307E}\x{305F}\x{9CF4}\x{304D}\x{66AE}"
    1576             text run at (1878,0) width 480: "\x{3089}\x{3055}\x{306A}\x{3051}\x{308C}\x{3070}\x{6C17}\x{304C}\x{6E08}\x{307E}\x{3093}\x{3068}\x{898B}\x{3048}\x{308B}\x{3002}\x{305D}\x{306E}\x{4E0A}\x{3069}\x{3053}\x{307E}\x{3067}\x{3082}\x{767B}\x{3063}\x{3066}\x{884C}\x{304F}\x{3001}"
    1577             text run at (1902,0) width 464: "\x{3044}\x{3064}\x{307E}\x{3067}\x{3082}\x{767B}\x{3063}\x{3066}\x{884C}\x{304F}\x{3002}\x{96F2}\x{96C0}\x{306F}\x{304D}\x{3063}\x{3068}\x{96F2}\x{306E}\x{4E2D}\x{3067}\x{6B7B}\x{306C}\x{306B}\x{76F8}\x{9055}\x{306A}\x{3044}\x{3002}"
    1578             text run at (1930,0) width 80: "\x{767B}\x{308A}\x{8A70}\x{3081}\x{305F}"
    1579           RenderRuby (inline) {RUBY} at (0,0) size 18x32
    1580             RenderRubyRun (anonymous) at (1927,80) size 24x32
     1573          RenderText {#text} at (1830,368) size 118x480
     1574            text run at (1830,368) width 112: "\x{306B}\x{306F}\x{77AC}\x{6642}\x{306E}\x{4F59}\x{88D5}"
     1575            text run at (1854,0) width 480: "\x{3082}\x{306A}\x{3044}\x{3002}\x{306E}\x{3069}\x{304B}\x{306A}\x{6625}\x{306E}\x{65E5}\x{3092}\x{9CF4}\x{304D}\x{5C3D}\x{304F}\x{3057}\x{3001}\x{9CF4}\x{304D}\x{3042}\x{304B}\x{3057}\x{3001}\x{307E}\x{305F}\x{9CF4}\x{304D}\x{66AE}\x{3089}"
     1576            text run at (1878,0) width 480: "\x{3055}\x{306A}\x{3051}\x{308C}\x{3070}\x{6C17}\x{304C}\x{6E08}\x{307E}\x{3093}\x{3068}\x{898B}\x{3048}\x{308B}\x{3002}\x{305D}\x{306E}\x{4E0A}\x{3069}\x{3053}\x{307E}\x{3067}\x{3082}\x{767B}\x{3063}\x{3066}\x{884C}\x{304F}\x{3001}\x{3044}"
     1577            text run at (1902,0) width 480: "\x{3064}\x{307E}\x{3067}\x{3082}\x{767B}\x{3063}\x{3066}\x{884C}\x{304F}\x{3002}\x{96F2}\x{96C0}\x{306F}\x{304D}\x{3063}\x{3068}\x{96F2}\x{306E}\x{4E2D}\x{3067}\x{6B7B}\x{306C}\x{306B}\x{76F8}\x{9055}\x{306A}\x{3044}\x{3002}\x{767B}\x{308A}"
     1578            text run at (1930,0) width 48: "\x{8A70}\x{3081}\x{305F}"
     1579          RenderRuby (inline) {RUBY} at (0,0) size 18x32
     1580            RenderRubyRun (anonymous) at (1927,48) size 24x32
    15811581              RenderRubyText {RT} at (-9,0) size 14x32
    15821582                RenderText {#text} at (2,0) size 10x31
     
    15861586                  RenderText {#text} at (3,0) size 18x32
    15871587                    text run at (3,0) width 32: "\x{63DA}\x{53E5}"
    1588           RenderText {#text} at (1930,112) size 18x112
    1589             text run at (1930,112) width 112: "\x{306F}\x{3001}\x{6D41}\x{308C}\x{3066}\x{96F2}\x{306B}"
    1590           RenderRuby (inline) {RUBY} at (0,0) size 18x16
    1591             RenderRubyRun (anonymous) at (1927,224) size 24x16
     1588          RenderText {#text} at (1930,80) size 18x112
     1589            text run at (1930,80) width 112: "\x{306F}\x{3001}\x{6D41}\x{308C}\x{3066}\x{96F2}\x{306B}"
     1590          RenderRuby (inline) {RUBY} at (0,0) size 18x16
     1591            RenderRubyRun (anonymous) at (1927,192) size 24x16
    15921592              RenderRubyText {RT} at (-9,0) size 14x16
    15931593                RenderText {#text} at (2,3) size 10x10
     
    15971597                  RenderText {#text} at (3,0) size 18x16
    15981598                    text run at (3,0) width 16: "\x{5165}"
    1599           RenderText {#text} at (1930,240) size 18x48
    1600             text run at (1930,240) width 48: "\x{3063}\x{3066}\x{3001}"
     1599          RenderText {#text} at (1930,208) size 18x48
     1600            text run at (1930,208) width 48: "\x{3063}\x{3066}\x{3001}"
    16011601          RenderRuby (inline) {RUBY} at (0,0) size 18x19
    1602             RenderRubyRun (anonymous) at (1927,284) size 24x27
     1602            RenderRubyRun (anonymous) at (1927,252) size 24x27
    16031603              RenderRubyText {RT} at (-9,0) size 14x27
    16041604                RenderText {#text} at (2,0) size 10x27
     
    16081608                  RenderText {#text} at (3,5) size 18x17
    16091609                    text run at (3,5) width 16: "\x{6F02}"
    1610           RenderText {#text} at (1930,307) size 46x483
    1611             text run at (1930,307) width 176: "\x{3046}\x{3066}\x{3044}\x{308B}\x{3046}\x{3061}\x{306B}\x{5F62}\x{306F}\x{6D88}\x{3048}"
    1612             text run at (1958,0) width 240: "\x{3066}\x{306A}\x{304F}\x{306A}\x{3063}\x{3066}\x{3001}\x{305F}\x{3060}\x{58F0}\x{3060}\x{3051}\x{304C}\x{7A7A}\x{306E}"
    1613           RenderRuby (inline) {RUBY} at (0,0) size 18x16
    1614             RenderRubyRun (anonymous) at (1955,239) size 24x18
     1610          RenderText {#text} at (1930,275) size 46x483
     1611            text run at (1930,275) width 208: "\x{3046}\x{3066}\x{3044}\x{308B}\x{3046}\x{3061}\x{306B}\x{5F62}\x{306F}\x{6D88}\x{3048}\x{3066}\x{306A}"
     1612            text run at (1958,0) width 208: "\x{304F}\x{306A}\x{3063}\x{3066}\x{3001}\x{305F}\x{3060}\x{58F0}\x{3060}\x{3051}\x{304C}\x{7A7A}\x{306E}"
     1613          RenderRuby (inline) {RUBY} at (0,0) size 18x16
     1614            RenderRubyRun (anonymous) at (1955,207) size 24x18
    16151615              RenderRubyText {RT} at (-9,0) size 14x18
    16161616                RenderText {#text} at (2,0) size 10x18
     
    16201620                  RenderText {#text} at (3,1) size 18x16
    16211621                    text run at (3,1) width 16: "\x{88E1}"
    1622           RenderText {#text} at (1958,256) size 18x176
    1623             text run at (1958,256) width 176: "\x{306B}\x{6B8B}\x{308B}\x{306E}\x{304B}\x{3082}\x{77E5}\x{308C}\x{306A}\x{3044}\x{3002}"
    1624           RenderBR {BR} at (1958,432) size 18x0
     1622          RenderText {#text} at (1958,224) size 18x176
     1623            text run at (1958,224) width 176: "\x{306B}\x{6B8B}\x{308B}\x{306E}\x{304B}\x{3082}\x{77E5}\x{308C}\x{306A}\x{3044}\x{3002}"
     1624          RenderBR {BR} at (1958,400) size 18x0
    16251625          RenderText {#text} at (1986,0) size 18x16
    16261626            text run at (1986,0) width 16: "\x{3000}"
     
    21252125          RenderText {#text} at (470,432) size 70x480
    21262126            text run at (470,432) width 48: "\x{308B}\x{3070}\x{304B}"
    2127             text run at (494,0) width 464: "\x{308A}\x{3060}\x{3002}\x{84B2}\x{516C}\x{82F1}\x{3082}\x{305D}\x{306E}\x{901A}\x{308A}\x{3001}\x{685C}\x{3082}\x{2015}\x{2015}\x{685C}\x{306F}\x{3044}\x{3064}\x{304B}\x{898B}\x{3048}\x{306A}\x{304F}\x{306A}\x{3063}\x{305F}\x{3002}"
    2128             text run at (522,0) width 176: "\x{3053}\x{3046}\x{5C71}\x{306E}\x{4E2D}\x{3078}\x{6765}\x{3066}\x{81EA}\x{7136}\x{306E}"
    2129           RenderRuby (inline) {RUBY} at (0,0) size 18x34
    2130             RenderRubyRun (anonymous) at (519,175) size 24x36
     2127            text run at (494,0) width 480: "\x{308A}\x{3060}\x{3002}\x{84B2}\x{516C}\x{82F1}\x{3082}\x{305D}\x{306E}\x{901A}\x{308A}\x{3001}\x{685C}\x{3082}\x{2015}\x{2015}\x{685C}\x{306F}\x{3044}\x{3064}\x{304B}\x{898B}\x{3048}\x{306A}\x{304F}\x{306A}\x{3063}\x{305F}\x{3002}\x{3053}"
     2128            text run at (522,0) width 160: "\x{3046}\x{5C71}\x{306E}\x{4E2D}\x{3078}\x{6765}\x{3066}\x{81EA}\x{7136}\x{306E}"
     2129          RenderRuby (inline) {RUBY} at (0,0) size 18x34
     2130            RenderRubyRun (anonymous) at (519,159) size 24x36
    21312131              RenderRubyText {RT} at (-9,0) size 14x36
    21322132                RenderText {#text} at (2,0) size 10x36
     
    21362136                  RenderText {#text} at (3,1) size 18x34
    21372137                    text run at (3,1) width 34: "\x{666F}\x{7269}"
    2138           RenderText {#text} at (522,210) size 46x482
    2139             text run at (522,210) width 272: "\x{306B}\x{63A5}\x{3059}\x{308C}\x{3070}\x{3001}\x{898B}\x{308B}\x{3082}\x{306E}\x{3082}\x{805E}\x{304F}\x{3082}\x{306E}\x{3082}\x{9762}"
    2140             text run at (550,0) width 448: "\x{767D}\x{3044}\x{3002}\x{9762}\x{767D}\x{3044}\x{3060}\x{3051}\x{3067}\x{5225}\x{6BB5}\x{306E}\x{82E6}\x{3057}\x{307F}\x{3082}\x{8D77}\x{3089}\x{306C}\x{3002}\x{8D77}\x{308B}\x{3068}\x{3059}\x{308C}\x{3070}\x{8DB3}\x{304C}"
    2141           RenderRuby (inline) {RUBY} at (0,0) size 18x32
    2142             RenderRubyRun (anonymous) at (547,448) size 24x32
     2138          RenderText {#text} at (522,194) size 46x482
     2139            text run at (522,194) width 288: "\x{306B}\x{63A5}\x{3059}\x{308C}\x{3070}\x{3001}\x{898B}\x{308B}\x{3082}\x{306E}\x{3082}\x{805E}\x{304F}\x{3082}\x{306E}\x{3082}\x{9762}\x{767D}"
     2140            text run at (550,0) width 432: "\x{3044}\x{3002}\x{9762}\x{767D}\x{3044}\x{3060}\x{3051}\x{3067}\x{5225}\x{6BB5}\x{306E}\x{82E6}\x{3057}\x{307F}\x{3082}\x{8D77}\x{3089}\x{306C}\x{3002}\x{8D77}\x{308B}\x{3068}\x{3059}\x{308C}\x{3070}\x{8DB3}\x{304C}"
     2141          RenderRuby (inline) {RUBY} at (0,0) size 18x32
     2142            RenderRubyRun (anonymous) at (547,432) size 24x32
    21432143              RenderRubyText {RT} at (-9,0) size 14x32
    21442144                RenderText {#text} at (2,0) size 10x31
     
    21482148                  RenderText {#text} at (3,0) size 18x32
    21492149                    text run at (3,0) width 32: "\x{8349}\x{81E5}"
    2150           RenderText {#text} at (578,0) size 18x48
    2151             text run at (578,0) width 48: "\x{308C}\x{3066}\x{3001}"
    2152           RenderRuby (inline) {RUBY} at (0,0) size 18x16
    2153             RenderRubyRun (anonymous) at (575,47) size 24x18
     2150          RenderText {#text} at (550,464) size 46x480
     2151            text run at (550,464) width 16: "\x{308C}"
     2152            text run at (578,0) width 32: "\x{3066}\x{3001}"
     2153          RenderRuby (inline) {RUBY} at (0,0) size 18x16
     2154            RenderRubyRun (anonymous) at (575,31) size 24x18
    21542155              RenderRubyText {RT} at (-9,0) size 14x18
    21552156                RenderText {#text} at (2,0) size 10x18
     
    21592160                  RenderText {#text} at (3,1) size 18x16
    21602161                    text run at (3,1) width 16: "\x{65E8}"
    2161           RenderText {#text} at (578,64) size 18x288
    2162             text run at (578,64) width 288: "\x{3044}\x{3082}\x{306E}\x{304C}\x{98DF}\x{3079}\x{3089}\x{308C}\x{306C}\x{304F}\x{3089}\x{3044}\x{306E}\x{4E8B}\x{3060}\x{308D}\x{3046}\x{3002}"
    2163           RenderBR {BR} at (578,352) size 18x0
     2162          RenderText {#text} at (578,48) size 18x288
     2163            text run at (578,48) width 288: "\x{3044}\x{3082}\x{306E}\x{304C}\x{98DF}\x{3079}\x{3089}\x{308C}\x{306C}\x{304F}\x{3089}\x{3044}\x{306E}\x{4E8B}\x{3060}\x{308D}\x{3046}\x{3002}"
     2164          RenderBR {BR} at (578,336) size 18x0
    21642165          RenderText {#text} at (606,0) size 18x416
    21652166            text run at (606,0) width 416: "\x{3000}\x{3057}\x{304B}\x{3057}\x{82E6}\x{3057}\x{307F}\x{306E}\x{306A}\x{3044}\x{306E}\x{306F}\x{306A}\x{305C}\x{3060}\x{308D}\x{3046}\x{3002}\x{305F}\x{3060}\x{3053}\x{306E}\x{666F}\x{8272}\x{3092}\x{4E00}"
  • trunk/Source/WebCore/ChangeLog

    r148787 r148791  
     12013-04-20  Glenn Adams  <glenn@skynav.com>
     2
     3        REGRESSION (r147588): Line breaks occur in the middle of Hebrew words at haaertz.co.il and other websites
     4        https://bugs.webkit.org/show_bug.cgi?id=114721
     5
     6        Reviewed by Dean Jackson.
     7
     8        Tests: fast/text/line-break-after-empty-inline-hebrew.html
     9               fast/text/line-break-after-inline-latin1.html
     10
     11        If prior context changes content or length after creating line break iterator, then need to
     12        create new iterator with new prior context instead of using cached iterator with old prior context.
     13
     14        * platform/text/TextBreakIterator.h:
     15        (WebCore::LazyLineBreakIterator::LazyLineBreakIterator): Initialize members to cache reference to initialized prior context.
     16        (WebCore::LazyLineBreakIterator::get): Create new iterator if prior context content reference changes.
     17        (WebCore::LazyLineBreakIterator::resetStringAndReleaseIterator): Reset cached prior context references.
     18        (LazyLineBreakIterator): Add members to cache reference to initialized prior context.
     19
    1202013-04-19  Ryuan Choi  <ryuan.choi@samsung.com>
    221
  • trunk/Source/WebCore/platform/text/TextBreakIterator.h

    r147588 r148791  
    6060    LazyLineBreakIterator()
    6161        : m_iterator(0)
     62        , m_cachedPriorContext(0)
     63        , m_cachedPriorContextLength(0)
    6264    {
    6365        resetPriorContext();
     
    6870        , m_locale(locale)
    6971        , m_iterator(0)
     72        , m_cachedPriorContext(0)
     73        , m_cachedPriorContextLength(0)
    7074    {
    7175        resetPriorContext();
     
    124128    TextBreakIterator* get(unsigned priorContextLength)
    125129    {
     130        ASSERT(priorContextLength <= priorContextCapacity);
     131        const UChar* priorContext = priorContextLength ? &m_priorContext[priorContextCapacity - priorContextLength] : 0;
    126132        if (!m_iterator) {
    127             ASSERT(priorContextLength <= priorContextCapacity);
    128             const UChar* priorContext = priorContextLength ? &m_priorContext[priorContextCapacity - priorContextLength] : 0;
    129133            if (m_string.is8Bit())
    130134                m_iterator = acquireLineBreakIterator(m_string.characters8(), m_string.length(), m_locale, priorContext, priorContextLength);
    131135            else
    132136                m_iterator = acquireLineBreakIterator(m_string.characters16(), m_string.length(), m_locale, priorContext, priorContextLength);
     137            m_cachedPriorContext = priorContext;
     138            m_cachedPriorContextLength = priorContextLength;
     139        } else if (priorContext != m_cachedPriorContext || priorContextLength != m_cachedPriorContextLength) {
     140            this->resetStringAndReleaseIterator(m_string, m_locale);
     141            return this->get(priorContextLength);
    133142        }
    134143        return m_iterator;
     
    141150        m_locale = locale;
    142151        m_iterator = 0;
     152        m_cachedPriorContext = 0;
     153        m_cachedPriorContextLength = 0;
    143154    }
    144155
     
    149160    TextBreakIterator* m_iterator;
    150161    UChar m_priorContext[priorContextCapacity];
     162    const UChar* m_cachedPriorContext;
     163    unsigned m_cachedPriorContextLength;
    151164};
    152165
Note: See TracChangeset for help on using the changeset viewer.