2007-07-24 Mitz Pettel <mitz@webkit.org>
authorbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jul 2007 09:55:33 +0000 (09:55 +0000)
committerbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jul 2007 09:55:33 +0000 (09:55 +0000)
commit731e1905e19de34b62d1062e4dd2dc7de978075c
treea735fd65c29f6b739e93c803f4780efbe023143f
parent0599d5bdf7ac93cb958bc767ed7d251bb83fc3dc
2007-07-24  Mitz Pettel  <mitz@webkit.org>

        Reviewed by Darin.

        - fix http://bugs.webkit.org/show_bug.cgi?id=14684
          Hebrew text in Safari chrome is reversed (LTR instead of RTL)

        Test: fast/text/drawBidiText.html

        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * WebCoreSources.bkl:
        * manual-tests/chrome-bidi-text.html: Added.
        * manual-tests/resources/chrome-bidi-text-window.html: Added.
        * platform/BidiReorderCharacters.cpp: Removed.
        * platform/BidiReorderCharacters.h: Removed.
        * platform/BidiResolver.h:
        (WebCore::BidiCharacterRun::start): Added accessor method.
        (WebCore::BidiCharacterRun::stop): Ditto.
        (WebCore::BidiCharacterRun::level): Ditto.
        (WebCore::BidiCharacterRun::next): Ditto.
        (WebCore::::appendRun): Added default implementation.
        * platform/TextStyle.h:
        (WebCore::TextStyle::setDirectionalOverride): Added accessor method.
        * platform/graphics/GraphicsContext.cpp:
        (WebCore::TextRunIterator::TextRunIterator): Added. A BidiResolver-
        compliant iterator over the characters in a TextRun.
        (WebCore::TextRunIterator::offset):
        (WebCore::TextRunIterator::increment):
        (WebCore::TextRunIterator::atEnd):
        (WebCore::TextRunIterator::current):
        (WebCore::TextRunIterator::direction):
        (WebCore::TextRunIterator::operator==):
        (WebCore::TextRunIterator::operator!=):
        (WebCore::GraphicsContext::drawBidiText): Added. Applies the Unicode
        Bidi Algorithm to the text and draws the resulting unidirectional runs
        in the right order and with the right directionality.
        * platform/graphics/GraphicsContext.h:
        * platform/win/PopupMenuWin.cpp:
        (WebCore::PopupMenu::paint): Replaced the use of a character buffer
        and BidiReorderCharacters with calling to drawBidiText(). Removed special
        handling of '-webkit-rtl-ordering:visual' because that CSS property is an
        implementation detail of WebCore's visual Hebrew support, and the UA stylesheet
        sets it to 'logical' for this form control. Authors can specify the ordering
        using the 'direction' and 'unicode-bidi' properties.
        * platform/win/WebCoreTextRenderer.cpp:
        (WebCore::isOneLeftToRightRun): Added. Checks if the text consists of
        a single left-to-right run, in which case it requires no bidi processing.
        (WebCore::doDrawTextAtPoint): Changed to call drawBidiText if the text
        is not entirely left-to-right.
        * rendering/RenderFileUploadControl.cpp:
        (WebCore::RenderFileUploadControl::paintObject): Replaced the use of a
        character buffer in BidiReorderCharacters with calling to drawBidiText().
        Removed special handling of '-webkit-rtl-ordering:visual' for the same reason
        stated above.
        * rendering/RenderListBox.cpp:
        (WebCore::RenderListBox::paintItemForeground): Ditto. Also changed the
        run-rounding modes used when drawing to match those used when measuring.

2007-07-24  Mitz Pettel  <mitz@webkit.org>

        Reviewed by Darin.

        - test, updated tests and updated results for
          http://bugs.webkit.org/show_bug.cgi?id=14684
          Hebrew text in Safari chrome is reversed (LTR instead of RTL)

        * fast/forms/HTMLOptionElement_label05-expected.checksum:
        * fast/forms/HTMLOptionElement_label05-expected.png:
        * fast/forms/listbox-deselect-scroll-expected.checksum:
        * fast/forms/listbox-deselect-scroll-expected.png:
        * fast/forms/listbox-width-change-expected.checksum:
        * fast/forms/listbox-width-change-expected.png:
        * fast/forms/option-strip-whitespace-expected.checksum:
        * fast/forms/option-strip-whitespace-expected.png:
        * fast/forms/select-change-popup-to-listbox-expected.checksum:
        * fast/forms/select-change-popup-to-listbox-expected.png:
        * fast/forms/select-initial-position-expected.checksum:
        * fast/forms/select-initial-position-expected.png:
        * fast/text/drawBidiText-expected.checksum: Added.
        * fast/text/drawBidiText-expected.png: Added.
        * fast/text/drawBidiText-expected.txt: Added.
        * fast/text/drawBidiText.html: Added.
        * fast/text/international/bidi-listbox-atsui-expected.checksum:
        * fast/text/international/bidi-listbox-atsui-expected.png:
        * fast/text/international/bidi-listbox-atsui-expected.txt:
        * fast/text/international/bidi-listbox-atsui.html: Removed the
        visual ordering cases.
        * fast/text/international/bidi-listbox-expected.checksum:
        * fast/text/international/bidi-listbox-expected.png:
        * fast/text/international/bidi-listbox-expected.txt:
        * fast/text/international/bidi-listbox.html: Removed the visual ordering
        cases because the patch removed special handling of visual ordering.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@24582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
42 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/forms/HTMLOptionElement_label05-expected.checksum
LayoutTests/fast/forms/HTMLOptionElement_label05-expected.png
LayoutTests/fast/forms/listbox-deselect-scroll-expected.checksum
LayoutTests/fast/forms/listbox-deselect-scroll-expected.png
LayoutTests/fast/forms/listbox-width-change-expected.checksum
LayoutTests/fast/forms/listbox-width-change-expected.png
LayoutTests/fast/forms/option-strip-whitespace-expected.checksum
LayoutTests/fast/forms/option-strip-whitespace-expected.png
LayoutTests/fast/forms/select-change-popup-to-listbox-expected.checksum
LayoutTests/fast/forms/select-change-popup-to-listbox-expected.png
LayoutTests/fast/forms/select-initial-position-expected.checksum
LayoutTests/fast/forms/select-initial-position-expected.png
LayoutTests/fast/text/drawBidiText-expected.checksum [new file with mode: 0644]
LayoutTests/fast/text/drawBidiText-expected.png [new file with mode: 0644]
LayoutTests/fast/text/drawBidiText-expected.txt [new file with mode: 0644]
LayoutTests/fast/text/drawBidiText.html [new file with mode: 0644]
LayoutTests/fast/text/international/bidi-listbox-atsui-expected.checksum
LayoutTests/fast/text/international/bidi-listbox-atsui-expected.png
LayoutTests/fast/text/international/bidi-listbox-atsui-expected.txt
LayoutTests/fast/text/international/bidi-listbox-atsui.html
LayoutTests/fast/text/international/bidi-listbox-expected.checksum
LayoutTests/fast/text/international/bidi-listbox-expected.png
LayoutTests/fast/text/international/bidi-listbox-expected.txt
LayoutTests/fast/text/international/bidi-listbox.html
WebCore/ChangeLog
WebCore/WebCore.pro
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/WebCoreSources.bkl
WebCore/manual-tests/chrome-bidi-text.html [new file with mode: 0644]
WebCore/manual-tests/resources/chrome-bidi-text-window.html [new file with mode: 0644]
WebCore/platform/BidiReorderCharacters.cpp [deleted file]
WebCore/platform/BidiReorderCharacters.h [deleted file]
WebCore/platform/BidiResolver.h
WebCore/platform/TextStyle.h
WebCore/platform/graphics/GraphicsContext.cpp
WebCore/platform/graphics/GraphicsContext.h
WebCore/platform/win/PopupMenuWin.cpp
WebCore/platform/win/WebCoreTextRenderer.cpp
WebCore/rendering/RenderFileUploadControl.cpp
WebCore/rendering/RenderListBox.cpp