Changeset 24582 in webkit
- Timestamp:
- Jul 24, 2007 2:55:33 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 2 deleted
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r24561 r24582 1 2007-07-24 Mitz Pettel <mitz@webkit.org> 2 3 Reviewed by Darin. 4 5 - test, updated tests and updated results for 6 http://bugs.webkit.org/show_bug.cgi?id=14684 7 Hebrew text in Safari chrome is reversed (LTR instead of RTL) 8 9 * fast/forms/HTMLOptionElement_label05-expected.checksum: 10 * fast/forms/HTMLOptionElement_label05-expected.png: 11 * fast/forms/listbox-deselect-scroll-expected.checksum: 12 * fast/forms/listbox-deselect-scroll-expected.png: 13 * fast/forms/listbox-width-change-expected.checksum: 14 * fast/forms/listbox-width-change-expected.png: 15 * fast/forms/option-strip-whitespace-expected.checksum: 16 * fast/forms/option-strip-whitespace-expected.png: 17 * fast/forms/select-change-popup-to-listbox-expected.checksum: 18 * fast/forms/select-change-popup-to-listbox-expected.png: 19 * fast/forms/select-initial-position-expected.checksum: 20 * fast/forms/select-initial-position-expected.png: 21 * fast/text/drawBidiText-expected.checksum: Added. 22 * fast/text/drawBidiText-expected.png: Added. 23 * fast/text/drawBidiText-expected.txt: Added. 24 * fast/text/drawBidiText.html: Added. 25 * fast/text/international/bidi-listbox-atsui-expected.checksum: 26 * fast/text/international/bidi-listbox-atsui-expected.png: 27 * fast/text/international/bidi-listbox-atsui-expected.txt: 28 * fast/text/international/bidi-listbox-atsui.html: Removed the 29 visual ordering cases. 30 * fast/text/international/bidi-listbox-expected.checksum: 31 * fast/text/international/bidi-listbox-expected.png: 32 * fast/text/international/bidi-listbox-expected.txt: 33 * fast/text/international/bidi-listbox.html: Removed the visual ordering 34 cases because the patch removed special handling of visual ordering. 35 1 36 2007-07-23 Justin Garcia <justin.garcia@apple.com> 2 37 -
trunk/LayoutTests/fast/forms/HTMLOptionElement_label05-expected.checksum
r19001 r24582 1 d1d9d9a9a6ffd3798ba2b3e76d96fea9 1 b3b5818c4f83fcf1f2a8bf403f922e1d -
trunk/LayoutTests/fast/forms/listbox-deselect-scroll-expected.checksum
r19520 r24582 1 d862b7a67fd414a09bf1acc2661db300 1 f1c4493b9e56621a4202423c6f31e709 -
trunk/LayoutTests/fast/forms/listbox-width-change-expected.checksum
r19001 r24582 1 dbbd628b7e1e30ab6834eae5f26d9246 1 7fb56f5841a1b75f536d5877ff766db1 -
trunk/LayoutTests/fast/forms/option-strip-whitespace-expected.checksum
r19001 r24582 1 3f629d2f9fe347280e7fb281b1a89549 1 22159b81d176cc343e4b70252dad904d -
trunk/LayoutTests/fast/forms/select-change-popup-to-listbox-expected.checksum
r19001 r24582 1 d9f6db46ccb5fa290329a4ffb1889c7b 1 cb14923e00f31b642c7dc43fd88b68a0 -
trunk/LayoutTests/fast/forms/select-initial-position-expected.checksum
r19797 r24582 1 7099cf6855580900bbcd91ca42a80a0f 1 e6bf209c781a5b2ff9fe16b3a46dbefb -
trunk/LayoutTests/fast/text/international/bidi-listbox-atsui-expected.checksum
r19414 r24582 1 9d0c98dc78689c102f86a3ef5a40c5a3 1 4a503c6c334e3e2176c07e83858385f7 -
trunk/LayoutTests/fast/text/international/bidi-listbox-atsui-expected.txt
r19414 r24582 1 layer at (0,0) size 785x6432 RenderView at (0,0) size 785x6003 layer at (0,0) size 785x6434 RenderBlock {HTML} at (0,0) size 785x6435 RenderBody {BODY} at (8,8) size 7 69x6276 RenderBlock {P} at (0,0) size 7 69x361 layer at (0,0) size 800x600 2 RenderView at (0,0) size 800x600 3 layer at (0,0) size 800x600 4 RenderBlock {HTML} at (0,0) size 800x600 5 RenderBody {BODY} at (8,8) size 784x584 6 RenderBlock {P} at (0,0) size 784x36 7 7 RenderText {#text} at (0,0) size 580x18 8 8 text run at (0,0) width 580: "This tests that bidirectional text is correctly rendered when using ATSUI in list box controls." … … 10 10 RenderText {#text} at (0,18) size 566x18 11 11 text run at (0,18) width 566: "The order of the text below each list box should match the order of the select's option text." 12 RenderBlock (anonymous) at (0,52) size 7 69x7913 RenderText {#text} at (0,0) size 270x1814 text run at (0,0) width 270: "1) direction: rtl; -webkit-rtl-ordering: visual"15 RenderBR {BR} at ( 270,14) size 0x012 RenderBlock (anonymous) at (0,52) size 784x79 13 RenderText {#text} at (0,0) size 97x18 14 text run at (0,0) width 97: "1) direction: rtl;" 15 RenderBR {BR} at (97,14) size 0x0 16 16 RenderListBox {SELECT} at (2,20) size 77x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)] 17 17 RenderBR {BR} at (81,72) size 0x0 18 18 RenderBlock {DIV} at (0,131) size 100x18 19 19 RenderText {#text} at (18,0) size 82x18 20 text run at (18,0) width 22 LTR override: "a\x{300}bc"21 text run at ( 40,0) width 60 LTR override: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}"22 RenderBlock (anonymous) at (0,149) size 7 69x9720 text run at (18,0) width 60 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}" 21 text run at (78,0) width 22: "a\x{300}bc" 22 RenderBlock (anonymous) at (0,149) size 784x97 23 23 RenderBR {BR} at (0,0) size 0x18 24 RenderText {#text} at (0,18) size 275x1825 text run at (0,18) width 275: "2) direction: rtl; -webkit-rtl-ordering: logical"26 RenderBR {BR} at ( 275,32) size 0x024 RenderText {#text} at (0,18) size 97x18 25 text run at (0,18) width 97: "2) direction: ltr;" 26 RenderBR {BR} at (97,32) size 0x0 27 27 RenderListBox {SELECT} at (2,38) size 77x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)] 28 28 RenderBR {BR} at (81,90) size 0x0 29 29 RenderBlock {DIV} at (0,246) size 100x18 30 RenderText {#text} at ( 18,0) size 82x1831 text run at ( 18,0) width 60 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}"32 text run at ( 78,0) width 22: "a\x{300}bc"33 RenderBlock (anonymous) at (0,264) size 7 69x9730 RenderText {#text} at (0,0) size 82x18 31 text run at (0,0) width 22: "a\x{300}bc" 32 text run at (22,0) width 60 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}" 33 RenderBlock (anonymous) at (0,264) size 784x97 34 34 RenderBR {BR} at (0,0) size 0x18 35 RenderText {#text} at (0,18) size 270x1836 text run at (0,18) width 270: "3) direction: ltr; -webkit-rtl-ordering: visual"37 RenderBR {BR} at ( 270,32) size 0x035 RenderText {#text} at (0,18) size 70x18 36 text run at (0,18) width 70: "3) No style" 37 RenderBR {BR} at (70,32) size 0x0 38 38 RenderListBox {SELECT} at (2,38) size 77x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)] 39 39 RenderBR {BR} at (81,90) size 0x0 40 40 RenderBlock {DIV} at (0,361) size 100x18 41 41 RenderText {#text} at (0,0) size 82x18 42 text run at (0,0) width 22 LTR override: "a\x{300}bc"43 text run at (22,0) width 60 LTR override: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}"44 RenderBlock (anonymous) at (0,379) size 769x9745 RenderBR {BR} at (0,0) size 0x1846 RenderText {#text} at (0,18) size 275x1847 text run at (0,18) width 275: "4) direction: ltr; -webkit-rtl-ordering: logical"48 RenderBR {BR} at (275,32) size 0x049 RenderListBox {SELECT} at (2,38) size 77x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]50 RenderBR {BR} at (81,90) size 0x051 RenderBlock {DIV} at (0,476) size 100x1852 RenderText {#text} at (0,0) size 82x1853 42 text run at (0,0) width 22: "a\x{300}bc" 54 43 text run at (22,0) width 60 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}" 55 RenderBlock (anonymous) at (0, 494) size 769x9744 RenderBlock (anonymous) at (0,379) size 784x18 56 45 RenderBR {BR} at (0,0) size 0x18 57 RenderText {#text} at (0,18) size 70x1858 text run at (0,18) width 70: "5) No style"59 RenderBR {BR} at (70,32) size 0x060 RenderListBox {SELECT} at (2,38) size 77x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]61 RenderBR {BR} at (81,90) size 0x062 RenderBlock {DIV} at (0,591) size 100x1863 RenderText {#text} at (0,0) size 82x1864 text run at (0,0) width 22: "a\x{300}bc"65 text run at (22,0) width 60 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}"66 RenderBlock (anonymous) at (0,609) size 769x1867 RenderBR {BR} at (0,0) size 0x18 -
trunk/LayoutTests/fast/text/international/bidi-listbox-atsui.html
r19414 r24582 1 1 <style> 2 .bidi1 {3 direction: rtl;4 -webkit-rtl-ordering: visual;5 max-width: 100px;6 }7 2 .bidi2 { 8 3 direction: rtl; 9 4 -webkit-rtl-ordering: logical; 10 max-width: 100px;11 }12 .bidi3 {13 direction: ltr;14 -webkit-rtl-ordering: visual;15 5 max-width: 100px; 16 6 } … … 29 19 The order of the text below each list box should match the order of the select's option text. 30 20 </p> 31 1) direction: rtl; -webkit-rtl-ordering: visual<br> 32 <select size="2" class="bidi1"><option>àbcאפרסמון</option></select><br> 33 <div class="bidi1">àbcאפרסמון</div><br> 34 2) direction: rtl; -webkit-rtl-ordering: logical<br> 21 1) direction: rtl;<br> 35 22 <select size="2" class="bidi2"><option>àbcאפרסמון</option></select><br> 36 23 <div class="bidi2">àbcאפרסמון</div><br> 37 3) direction: ltr; -webkit-rtl-ordering: visual<br> 38 <select size="2" class="bidi3"><option>àbcאפרסמון</option></select><br> 39 <div class="bidi3">àbcאפרסמון</div><br> 40 4) direction: ltr; -webkit-rtl-ordering: logical<br> 24 2) direction: ltr;<br> 41 25 <select size="2" class="bidi4"><option>àbcאפרסמון</option></select><br> 42 26 <div class="bidi4">àbcאפרסמון</div><br> 43 5) No style<br>27 3) No style<br> 44 28 <select size="2" class="bidi5"><option>àbcאפרסמון</option></select><br> 45 29 <div class="bidi5">àbcאפרסמון</div><br> -
trunk/LayoutTests/fast/text/international/bidi-listbox-expected.checksum
r19414 r24582 1 730279a3f2d7c4636181ceb9e56c4c9b1 89922a6c1b914696729536e391047e8b -
trunk/LayoutTests/fast/text/international/bidi-listbox-expected.txt
r19414 r24582 1 layer at (0,0) size 785x6432 RenderView at (0,0) size 785x6003 layer at (0,0) size 785x6434 RenderBlock {HTML} at (0,0) size 785x6435 RenderBody {BODY} at (8,8) size 7 69x6276 RenderBlock {P} at (0,0) size 7 69x361 layer at (0,0) size 800x600 2 RenderView at (0,0) size 800x600 3 layer at (0,0) size 800x600 4 RenderBlock {HTML} at (0,0) size 800x600 5 RenderBody {BODY} at (8,8) size 784x584 6 RenderBlock {P} at (0,0) size 784x36 7 7 RenderText {#text} at (0,0) size 451x18 8 8 text run at (0,0) width 451: "This tests that bidirectional text is correctly rendered in list box controls." … … 10 10 RenderText {#text} at (0,18) size 566x18 11 11 text run at (0,18) width 566: "The order of the text below each list box should match the order of the select's option text." 12 RenderBlock (anonymous) at (0,52) size 7 69x7913 RenderText {#text} at (0,0) size 270x1814 text run at (0,0) width 270: "1) direction: rtl; -webkit-rtl-ordering: visual"15 RenderBR {BR} at ( 270,14) size 0x012 RenderBlock (anonymous) at (0,52) size 784x79 13 RenderText {#text} at (0,0) size 97x18 14 text run at (0,0) width 97: "1) direction: rtl;" 15 RenderBR {BR} at (97,14) size 0x0 16 16 RenderListBox {SELECT} at (2,20) size 77x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)] 17 17 RenderBR {BR} at (81,72) size 0x0 18 18 RenderBlock {DIV} at (0,131) size 100x18 19 19 RenderText {#text} at (18,0) size 82x18 20 text run at (18,0) width 22 LTR override: "abc"21 text run at ( 40,0) width 60 LTR override: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}"22 RenderBlock (anonymous) at (0,149) size 7 69x9720 text run at (18,0) width 60 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}" 21 text run at (78,0) width 22: "abc" 22 RenderBlock (anonymous) at (0,149) size 784x97 23 23 RenderBR {BR} at (0,0) size 0x18 24 RenderText {#text} at (0,18) size 275x1825 text run at (0,18) width 275: "2) direction: rtl; -webkit-rtl-ordering: logical"26 RenderBR {BR} at ( 275,32) size 0x024 RenderText {#text} at (0,18) size 97x18 25 text run at (0,18) width 97: "2) direction: ltr;" 26 RenderBR {BR} at (97,32) size 0x0 27 27 RenderListBox {SELECT} at (2,38) size 77x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)] 28 28 RenderBR {BR} at (81,90) size 0x0 29 29 RenderBlock {DIV} at (0,246) size 100x18 30 RenderText {#text} at ( 18,0) size 82x1831 text run at ( 18,0) width 60 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}"32 text run at ( 78,0) width 22: "abc"33 RenderBlock (anonymous) at (0,264) size 7 69x9730 RenderText {#text} at (0,0) size 82x18 31 text run at (0,0) width 22: "abc" 32 text run at (22,0) width 60 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}" 33 RenderBlock (anonymous) at (0,264) size 784x97 34 34 RenderBR {BR} at (0,0) size 0x18 35 RenderText {#text} at (0,18) size 270x1836 text run at (0,18) width 270: "3) direction: ltr; -webkit-rtl-ordering: visual"37 RenderBR {BR} at ( 270,32) size 0x035 RenderText {#text} at (0,18) size 70x18 36 text run at (0,18) width 70: "3) No style" 37 RenderBR {BR} at (70,32) size 0x0 38 38 RenderListBox {SELECT} at (2,38) size 77x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)] 39 39 RenderBR {BR} at (81,90) size 0x0 40 40 RenderBlock {DIV} at (0,361) size 100x18 41 41 RenderText {#text} at (0,0) size 82x18 42 text run at (0,0) width 22 LTR override: "abc"43 text run at (22,0) width 60 LTR override: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}"44 RenderBlock (anonymous) at (0,379) size 769x9745 RenderBR {BR} at (0,0) size 0x1846 RenderText {#text} at (0,18) size 275x1847 text run at (0,18) width 275: "4) direction: ltr; -webkit-rtl-ordering: logical"48 RenderBR {BR} at (275,32) size 0x049 RenderListBox {SELECT} at (2,38) size 77x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]50 RenderBR {BR} at (81,90) size 0x051 RenderBlock {DIV} at (0,476) size 100x1852 RenderText {#text} at (0,0) size 82x1853 42 text run at (0,0) width 22: "abc" 54 43 text run at (22,0) width 60 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}" 55 RenderBlock (anonymous) at (0, 494) size 769x9744 RenderBlock (anonymous) at (0,379) size 784x18 56 45 RenderBR {BR} at (0,0) size 0x18 57 RenderText {#text} at (0,18) size 70x1858 text run at (0,18) width 70: "5) No style"59 RenderBR {BR} at (70,32) size 0x060 RenderListBox {SELECT} at (2,38) size 77x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]61 RenderBR {BR} at (81,90) size 0x062 RenderBlock {DIV} at (0,591) size 100x1863 RenderText {#text} at (0,0) size 82x1864 text run at (0,0) width 22: "abc"65 text run at (22,0) width 60 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}"66 RenderBlock (anonymous) at (0,609) size 769x1867 RenderBR {BR} at (0,0) size 0x18 -
trunk/LayoutTests/fast/text/international/bidi-listbox.html
r19414 r24582 1 1 <style> 2 .bidi1 {3 direction: rtl;4 -webkit-rtl-ordering: visual;5 max-width: 100px;6 }7 2 .bidi2 { 8 3 direction: rtl; 9 4 -webkit-rtl-ordering: logical; 10 max-width: 100px;11 }12 .bidi3 {13 direction: ltr;14 -webkit-rtl-ordering: visual;15 5 max-width: 100px; 16 6 } … … 29 19 The order of the text below each list box should match the order of the select's option text. 30 20 </p> 31 1) direction: rtl; -webkit-rtl-ordering: visual<br> 32 <select size="2" class="bidi1"><option>abcאפרסמון</option></select><br> 33 <div class="bidi1">abcאפרסמון</div><br> 34 2) direction: rtl; -webkit-rtl-ordering: logical<br> 21 1) direction: rtl;<br> 35 22 <select size="2" class="bidi2"><option>abcאפרסמון</option></select><br> 36 23 <div class="bidi2">abcאפרסמון</div><br> 37 3) direction: ltr; -webkit-rtl-ordering: visual<br> 38 <select size="2" class="bidi3"><option>abcאפרסמון</option></select><br> 39 <div class="bidi3">abcאפרסמון</div><br> 40 4) direction: ltr; -webkit-rtl-ordering: logical<br> 24 2) direction: ltr;<br> 41 25 <select size="2" class="bidi4"><option>abcאפרסמון</option></select><br> 42 26 <div class="bidi4">abcאפרסמון</div><br> 43 5) No style<br>27 3) No style<br> 44 28 <select size="2" class="bidi5"><option>abcאפרסמון</option></select><br> 45 29 <div class="bidi5">abcאפרסמון</div><br> -
trunk/WebCore/ChangeLog
r24564 r24582 1 2007-07-24 Mitz Pettel <mitz@webkit.org> 2 3 Reviewed by Darin. 4 5 - fix http://bugs.webkit.org/show_bug.cgi?id=14684 6 Hebrew text in Safari chrome is reversed (LTR instead of RTL) 7 8 Test: fast/text/drawBidiText.html 9 10 * WebCore.pro: 11 * WebCore.vcproj/WebCore.vcproj: 12 * WebCore.xcodeproj/project.pbxproj: 13 * WebCoreSources.bkl: 14 * manual-tests/chrome-bidi-text.html: Added. 15 * manual-tests/resources/chrome-bidi-text-window.html: Added. 16 * platform/BidiReorderCharacters.cpp: Removed. 17 * platform/BidiReorderCharacters.h: Removed. 18 * platform/BidiResolver.h: 19 (WebCore::BidiCharacterRun::start): Added accessor method. 20 (WebCore::BidiCharacterRun::stop): Ditto. 21 (WebCore::BidiCharacterRun::level): Ditto. 22 (WebCore::BidiCharacterRun::next): Ditto. 23 (WebCore::::appendRun): Added default implementation. 24 * platform/TextStyle.h: 25 (WebCore::TextStyle::setDirectionalOverride): Added accessor method. 26 * platform/graphics/GraphicsContext.cpp: 27 (WebCore::TextRunIterator::TextRunIterator): Added. A BidiResolver- 28 compliant iterator over the characters in a TextRun. 29 (WebCore::TextRunIterator::offset): 30 (WebCore::TextRunIterator::increment): 31 (WebCore::TextRunIterator::atEnd): 32 (WebCore::TextRunIterator::current): 33 (WebCore::TextRunIterator::direction): 34 (WebCore::TextRunIterator::operator==): 35 (WebCore::TextRunIterator::operator!=): 36 (WebCore::GraphicsContext::drawBidiText): Added. Applies the Unicode 37 Bidi Algorithm to the text and draws the resulting unidirectional runs 38 in the right order and with the right directionality. 39 * platform/graphics/GraphicsContext.h: 40 * platform/win/PopupMenuWin.cpp: 41 (WebCore::PopupMenu::paint): Replaced the use of a character buffer 42 and BidiReorderCharacters with calling to drawBidiText(). Removed special 43 handling of '-webkit-rtl-ordering:visual' because that CSS property is an 44 implementation detail of WebCore's visual Hebrew support, and the UA stylesheet 45 sets it to 'logical' for this form control. Authors can specify the ordering 46 using the 'direction' and 'unicode-bidi' properties. 47 * platform/win/WebCoreTextRenderer.cpp: 48 (WebCore::isOneLeftToRightRun): Added. Checks if the text consists of 49 a single left-to-right run, in which case it requires no bidi processing. 50 (WebCore::doDrawTextAtPoint): Changed to call drawBidiText if the text 51 is not entirely left-to-right. 52 * rendering/RenderFileUploadControl.cpp: 53 (WebCore::RenderFileUploadControl::paintObject): Replaced the use of a 54 character buffer in BidiReorderCharacters with calling to drawBidiText(). 55 Removed special handling of '-webkit-rtl-ordering:visual' for the same reason 56 stated above. 57 * rendering/RenderListBox.cpp: 58 (WebCore::RenderListBox::paintItemForeground): Ditto. Also changed the 59 run-rounding modes used when drawing to match those used when measuring. 60 1 61 2007-07-23 Oliver Hunt <oliver@apple.com> 2 62 -
trunk/WebCore/WebCore.pro
r24537 r24582 591 591 platform/Base64.cpp \ 592 592 platform/BidiContext.cpp \ 593 platform/BidiReorderCharacters.cpp \594 593 platform/ContextMenu.cpp \ 595 594 platform/CString.cpp \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r24493 r24582 2896 2896 <File 2897 2897 RelativePath="..\platform\BidiContext.h" 2898 >2899 </File>2900 <File2901 RelativePath="..\platform\BidiReorderCharacters.cpp"2902 >2903 </File>2904 <File2905 RelativePath="..\platform\BidiReorderCharacters.h"2906 2898 > 2907 2899 </File> -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r24541 r24582 2728 2728 B2FA3E180AB75A6F000E5AC4 /* JSSVGZoomEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2FA3D300AB75A6F000E5AC4 /* JSSVGZoomEvent.cpp */; }; 2729 2729 B2FA3E190AB75A6F000E5AC4 /* JSSVGZoomEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = B2FA3D310AB75A6F000E5AC4 /* JSSVGZoomEvent.h */; }; 2730 B402007C0C4D217800210AA6 /* BidiReorderCharacters.h in Headers */ = {isa = PBXBuildFile; fileRef = B402007A0C4D217800210AA6 /* BidiReorderCharacters.h */; };2731 B402007D0C4D217800210AA6 /* BidiReorderCharacters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B402007B0C4D217800210AA6 /* BidiReorderCharacters.cpp */; };2732 2730 B402FD0B0C4C9C3900210AA6 /* BidiResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = B402FD090C4C9C3900210AA6 /* BidiResolver.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2733 2731 BC066F6F09FEB2FA00C589A7 /* WebCoreTextRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = BC066F6C09FEB2FA00C589A7 /* WebCoreTextRenderer.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 6059 6057 B2FA3D300AB75A6F000E5AC4 /* JSSVGZoomEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGZoomEvent.cpp; sourceTree = "<group>"; }; 6060 6058 B2FA3D310AB75A6F000E5AC4 /* JSSVGZoomEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSSVGZoomEvent.h; sourceTree = "<group>"; }; 6061 B402007A0C4D217800210AA6 /* BidiReorderCharacters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BidiReorderCharacters.h; sourceTree = "<group>"; };6062 B402007B0C4D217800210AA6 /* BidiReorderCharacters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BidiReorderCharacters.cpp; sourceTree = "<group>"; };6063 6059 B402FD090C4C9C3900210AA6 /* BidiResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BidiResolver.h; sourceTree = "<group>"; }; 6064 6060 BC066F6C09FEB2FA00C589A7 /* WebCoreTextRenderer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCoreTextRenderer.h; sourceTree = "<group>"; }; … … 9526 9522 514AF320BE854014A7DA49FB /* BidiContext.h */, 9527 9523 A579C284B928484FB9A446BC /* BidiContext.cpp */, 9528 B402007A0C4D217800210AA6 /* BidiReorderCharacters.h */,9529 B402007B0C4D217800210AA6 /* BidiReorderCharacters.cpp */,9530 9524 B402FD090C4C9C3900210AA6 /* BidiResolver.h */, 9531 9525 65F5382009B2B55700F3DC4A /* character-sets.txt */, … … 11702 11696 BC772C4F0C4EB3040083285F /* MIMETypeRegistry.h in Headers */, 11703 11697 B402FD0B0C4C9C3900210AA6 /* BidiResolver.h in Headers */, 11704 B402007C0C4D217800210AA6 /* BidiReorderCharacters.h in Headers */,11705 11698 0F31CBF92B654730BA0535E8 /* BidiContext.h in Headers */, 11706 11699 1432E8470C51493800B1500F /* GCController.h in Headers */, … … 13143 13136 BC772C5E0C4EB3440083285F /* MIMETypeRegistryMac.mm in Sources */, 13144 13137 F971E27FD70F4382BC66D792 /* BidiContext.cpp in Sources */, 13145 B402007D0C4D217800210AA6 /* BidiReorderCharacters.cpp in Sources */,13146 13138 1432E8490C51493F00B1500F /* GCController.cpp in Sources */, 13147 13139 ); -
trunk/WebCore/WebCoreSources.bkl
r24493 r24582 164 164 platform/Base64.cpp 165 165 platform/BidiContext.cpp 166 platform/BidiReorderCharacters.cpp167 166 platform/CString.cpp 168 167 platform/ContextMenu.cpp -
trunk/WebCore/platform/BidiResolver.h
r24485 r24582 87 87 } 88 88 89 int start() const { return m_start; } 90 int stop() const { return m_stop; } 91 unsigned char level() const { return m_level; } 89 92 bool reversed(bool visuallyOrdered) { return m_level % 2 && !visuallyOrdered; } 90 93 bool dirOverride(bool visuallyOrdered) { return m_override || visuallyOrdered; } 91 94 92 BidiCharacterRun* next() { return m_next; }95 BidiCharacterRun* next() const { return m_next; } 93 96 94 97 unsigned char m_level; … … 158 161 int m_runCount; 159 162 }; 163 164 template <class Iterator, class Run> 165 void BidiResolver<Iterator, Run>::appendRun() 166 { 167 if (emptyRun || eor.atEnd()) 168 return; 169 170 Run* bidiRun = new Run(sor.offset(), eor.offset() + 1, context(), m_direction); 171 if (!m_firstRun) 172 m_firstRun = bidiRun; 173 else 174 m_lastRun->m_next = bidiRun; 175 m_lastRun = bidiRun; 176 m_runCount++; 177 178 eor.increment(*this); 179 sor = eor; 180 m_direction = WTF::Unicode::OtherNeutral; 181 m_status.eor = WTF::Unicode::OtherNeutral; 182 } 160 183 161 184 template <class Iterator, class Run> -
trunk/WebCore/platform/TextStyle.h
r20610 r24582 51 51 void disableRoundingHacks() { m_applyRunRounding = m_applyWordRounding = false; } 52 52 void setRTL(bool b) { m_rtl = b; } 53 void setDirectionalOverride(bool override) { m_directionalOverride = override; } 53 54 54 55 private: -
trunk/WebCore/platform/graphics/GraphicsContext.cpp
r21601 r24582 27 27 #include "GraphicsContext.h" 28 28 29 #include "BidiResolver.h" 29 30 #include "Font.h" 30 31 #include "TextStyle.h" … … 33 34 34 35 namespace WebCore { 36 37 class TextRunIterator { 38 public: 39 TextRunIterator() 40 : m_textRun(0) 41 , m_offset(0) 42 { 43 } 44 45 TextRunIterator(const TextRun* textRun, unsigned offset) 46 : m_textRun(textRun) 47 , m_offset(offset) 48 { 49 } 50 51 TextRunIterator(const TextRunIterator& other) 52 : m_textRun(other.m_textRun) 53 , m_offset(other.m_offset) 54 { 55 } 56 57 unsigned offset() const { return m_offset; } 58 void increment(BidiResolver<TextRunIterator, BidiCharacterRun>&) { m_offset++; } 59 bool atEnd() const { return m_offset >= m_textRun->length(); } 60 UChar current() const { return (*m_textRun)[m_offset]; } 61 WTF::Unicode::Direction direction() const { return atEnd() ? WTF::Unicode::OtherNeutral : WTF::Unicode::direction(current()); } 62 63 bool operator==(const TextRunIterator& other) 64 { 65 return m_offset == other.m_offset && m_textRun == other.m_textRun; 66 } 67 68 bool operator!=(const TextRunIterator& other) { return !operator==(other); } 69 70 private: 71 const TextRun* m_textRun; 72 int m_offset; 73 }; 35 74 36 75 struct GraphicsContextState { … … 216 255 } 217 256 257 void GraphicsContext::drawBidiText(const TextRun& run, const IntPoint& point, const TextStyle& style) 258 { 259 if (paintingDisabled()) 260 return; 261 262 BidiResolver<TextRunIterator, BidiCharacterRun> bidiResolver; 263 WTF::Unicode::Direction paragraphDirection = style.ltr() ? WTF::Unicode::LeftToRight : WTF::Unicode::RightToLeft; 264 265 bidiResolver.setStatus(BidiStatus(paragraphDirection, paragraphDirection, paragraphDirection, new BidiContext(style.ltr() ? 0 : 1, paragraphDirection, style.directionalOverride()))); 266 267 bidiResolver.createBidiRunsForLine(TextRunIterator(&run, 0), TextRunIterator(&run, run.length())); 268 269 if (!bidiResolver.runCount()) 270 return; 271 272 FloatPoint currPoint = point; 273 BidiCharacterRun* bidiRun = bidiResolver.firstRun(); 274 while (bidiRun) { 275 TextStyle subrunStyle(style); 276 subrunStyle.setRTL(bidiRun->level() % 2); 277 subrunStyle.setDirectionalOverride(bidiRun->dirOverride(false)); 278 279 TextRun subrun(run.data(bidiRun->start()), bidiRun->stop() - bidiRun->start()); 280 281 font().drawText(this, subrun, subrunStyle, currPoint); 282 283 bidiRun = bidiRun->next(); 284 // FIXME: Have Font::drawText return the width of what it drew so that we don't have to re-measure here. 285 if (bidiRun) 286 currPoint.move(font().floatWidth(subrun, subrunStyle), 0.f); 287 } 288 289 bidiResolver.deleteRuns(); 290 } 291 218 292 void GraphicsContext::drawHighlightForText(const TextRun& run, const IntPoint& point, int h, const TextStyle& style, const Color& backgroundColor, int from, int to) 219 293 { -
trunk/WebCore/platform/graphics/GraphicsContext.h
r24322 r24582 148 148 void drawText(const TextRun&, const IntPoint&, int from = 0, int to = -1); 149 149 void drawText(const TextRun&, const IntPoint&, const TextStyle&, int from = 0, int to = -1); 150 void drawBidiText(const TextRun&, const IntPoint&, const TextStyle&); 150 151 void drawHighlightForText(const TextRun&, const IntPoint&, int h, const TextStyle&, const Color& backgroundColor, int from = 0, int to = -1); 151 152 -
trunk/WebCore/platform/win/PopupMenuWin.cpp
r24485 r24582 22 22 #include "PopupMenu.h" 23 23 24 #include "BidiReorderCharacters.h"25 24 #include "Document.h" 26 25 #include "FloatRect.h" … … 493 492 unsigned length = itemText.length(); 494 493 const UChar* string = itemText.characters(); 495 TextStyle textStyle(0, 0, 0, false, true); 496 CharacterBuffer characterBuffer; 497 498 if (clientStyle->direction() == RTL && clientStyle->unicodeBidi() == Override) 499 textStyle.setRTL(true); 500 else if ((clientStyle->direction() == RTL || clientStyle->unicodeBidi() != Override) && !clientStyle->visuallyOrdered()) { 501 // If necessary, reorder characters by running the string through the bidi algorithm 502 characterBuffer.append(string, length); 503 bidiReorderCharacters(characterBuffer, clientStyle->direction() == RTL, clientStyle->unicodeBidi() == Override, clientStyle->visuallyOrdered()); 504 string = characterBuffer.data(); 505 } 494 TextStyle textStyle(0, 0, 0, clientStyle->direction() == RTL, clientStyle->unicodeBidi() == Override); 506 495 TextRun textRun(string, length); 507 496 … … 521 510 int textX = client()->clientPaddingLeft(); 522 511 int textY = itemRect.y() + itemFont.ascent() + (itemRect.height() - itemFont.height()) / 2; 523 context.draw Text(textRun, IntPoint(textX, textY), textStyle);512 context.drawBidiText(textRun, IntPoint(textX, textY), textStyle); 524 513 } 525 514 } -
trunk/WebCore/platform/win/WebCoreTextRenderer.cpp
r23877 r24582 31 31 #include "StringTruncator.h" 32 32 #include "TextStyle.h" 33 #include <wtf/unicode/Unicode.h> 33 34 34 35 namespace WebCore { 36 37 static bool isOneLeftToRightRun(const TextRun& run) 38 { 39 unsigned i; 40 for (i = 0; i < run.length(); i++) { 41 WTF::Unicode::Direction direction = WTF::Unicode::direction(run[i]); 42 if (direction == WTF::Unicode::RightToLeft || direction > WTF::Unicode::OtherNeutral) 43 return false; 44 } 45 return true; 46 } 35 47 36 48 static void doDrawTextAtPoint(GraphicsContext& context, const String& text, const IntPoint& point, const Font& font, const Color& color, int underlinedIndex) … … 40 52 41 53 context.setFillColor(color); 42 font.drawText(&context, run, style, point); 54 if (isOneLeftToRightRun(run)) 55 font.drawText(&context, run, style, point); 56 else { 57 context.setFont(font); 58 context.drawBidiText(run, point, style); 59 } 43 60 44 61 if (underlinedIndex >= 0) { -
trunk/WebCore/rendering/RenderFileUploadControl.cpp
r24485 r24582 22 22 #include "RenderFileUploadControl.h" 23 23 24 #include "BidiReorderCharacters.h"25 24 #include "FrameView.h" 26 25 #include "GraphicsContext.h" … … 178 177 unsigned length = displayedFilename.length(); 179 178 const UChar* string = displayedFilename.characters(); 180 TextStyle textStyle(0, 0, 0, false, true); 181 CharacterBuffer characterBuffer; 182 183 if (style()->direction() == RTL && style()->unicodeBidi() == Override) 184 textStyle.setRTL(true); 185 else if ((style()->direction() == RTL || style()->unicodeBidi() != Override) && !style()->visuallyOrdered()) { 186 // If necessary, reorder characters by running the string through the bidi algorithm 187 characterBuffer.append(string, length); 188 bidiReorderCharacters(characterBuffer, style()->direction() == RTL, style()->unicodeBidi() == Override, style()->visuallyOrdered()); 189 string = characterBuffer.data(); 190 } 179 TextStyle textStyle(0, 0, 0, style()->direction() == RTL, style()->unicodeBidi() == Override); 191 180 TextRun textRun(string, length); 192 181 … … 210 199 211 200 // Draw the filename 212 paintInfo.context->draw Text(textRun, IntPoint(textX, textY), textStyle);201 paintInfo.context->drawBidiText(textRun, IntPoint(textX, textY), textStyle); 213 202 214 203 if (m_fileChooser->icon()) { -
trunk/WebCore/rendering/RenderListBox.cpp
r24485 r24582 32 32 #include "RenderListBox.h" 33 33 34 #include "BidiReorderCharacters.h"35 34 #include "Document.h" 36 35 #include "EventHandler.h" … … 332 331 unsigned length = itemText.length(); 333 332 const UChar* string = itemText.characters(); 334 TextStyle textStyle(0, 0, 0, false, true); 335 CharacterBuffer characterBuffer; 336 337 if (itemStyle->direction() == RTL && itemStyle->unicodeBidi() == Override) 338 textStyle.setRTL(true); 339 else if ((itemStyle->direction() == RTL || itemStyle->unicodeBidi() != Override) && !itemStyle->visuallyOrdered()) { 340 // If necessary, reorder characters by running the string through the bidi algorithm 341 characterBuffer.append(string, length); 342 bidiReorderCharacters(characterBuffer, itemStyle->direction() == RTL, itemStyle->unicodeBidi() == Override, itemStyle->visuallyOrdered()); 343 string = characterBuffer.data(); 344 } 333 TextStyle textStyle(0, 0, 0, itemStyle->direction() == RTL, itemStyle->unicodeBidi() == Override, false, false); 345 334 TextRun textRun(string, length); 346 335 347 336 // Draw the item text 348 337 if (itemStyle->visibility() != HIDDEN) 349 paintInfo.context->draw Text(textRun, r.location(), textStyle);338 paintInfo.context->drawBidiText(textRun, r.location(), textStyle); 350 339 } 351 340
Note: See TracChangeset
for help on using the changeset viewer.