Reviewed by John
authorkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Jan 2005 22:18:47 +0000 (22:18 +0000)
committerkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Jan 2005 22:18:47 +0000 (22:18 +0000)
commita45eb3789fc8175eea2f3b91159303a1c666a353
treec67d3e5380d105643a5cc8e070156b241f74b027
parente071667631e3fa8e932aa83ec51e4e9d17a65aa3
    Reviewed by John

        Fix for this bug:

        <rdar://problem/3786659> REGRESSION (Mail): editable WebViews don't work with
        "size up" and "size down" NSFontManager changes

        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue): Add support for parsing new font size delta property.
        * khtml/css/cssproperties.c: Generated file.
        * khtml/css/cssproperties.h: Ditto.
        * khtml/css/cssproperties.in: Add support for parsing new font size delta property.
        * khtml/editing/htmlediting.cpp:
        (khtml::isEmptyStyleSpan): New helper function. Code existed before, but now factored out for convenient use.
        (khtml::CompositeEditCommand::removeNodeAttribute): Does check on value to see it exists before creating
        and running command to do the removal.
        (khtml::ApplyStyleCommand::doApply): Now calls new applyRelativeFontStyleChange() function as part of its work.
        (khtml::ApplyStyleCommand::applyRelativeFontStyleChange): New function that does the "heavy lifting" to handle
        relative font size changes.
        (khtml::ApplyStyleCommand::applyInlineStyle): Range check the start and end positions to make sure the start is
        before or equal to the end. Swap them if not true. I ran into this problem in some similar code in
        applyRelativeFontStyleChange(). Moving that goodness here too.
        (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded): Uses a local variable to save a value used often.
        Code is the same, but reads better now. Function now returns bool as well, just like splitTextAtStartIfNeeded.
        I use the bool return value now (I obviously did not need it before).
        (khtml::ApplyStyleCommand::computedFontSize): New helper function.
        (khtml::ApplyStyleCommand::joinChildTextNodes): Ditto.
        (khtml::createStyleSpanElement): Ditto.
        * khtml/editing/htmlediting.h: Update header accordingly.
        * khtml/editing/jsediting.cpp: Add new command string to enable relative font size changes.
        * kwq/DOM-CSS.mm:
        (-[DOMCSSStyleDeclaration _fontSizeDelta]): New convenience.
        (-[DOMCSSStyleDeclaration _setFontSizeDelta:]): Ditto.
        * kwq/DOMPrivate.h: Declare new conveniences.
        * layout-tests/editing/editing.js: Add new JS to enable relative font size changes, as well as explicit font size setting.
        * layout-tests/editing/style/relative-font-size-change-001-expected.txt: Added.
        * layout-tests/editing/style/relative-font-size-change-001.html: Added.
        * layout-tests/editing/style/relative-font-size-change-002-expected.txt: Added.
        * layout-tests/editing/style/relative-font-size-change-002.html: Added.
        * layout-tests/editing/style/relative-font-size-change-003-expected.txt: Added.
        * layout-tests/editing/style/relative-font-size-change-003.html: Added.
        * layout-tests/editing/style/relative-font-size-change-004-expected.txt: Added.
        * layout-tests/editing/style/relative-font-size-change-004.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8382 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/editing/editing.js
LayoutTests/editing/style/relative-font-size-change-001-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/relative-font-size-change-001.html [new file with mode: 0644]
LayoutTests/editing/style/relative-font-size-change-002-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/relative-font-size-change-002.html [new file with mode: 0644]
LayoutTests/editing/style/relative-font-size-change-003-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/relative-font-size-change-003.html [new file with mode: 0644]
LayoutTests/editing/style/relative-font-size-change-004-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/relative-font-size-change-004.html [new file with mode: 0644]
WebCore/ChangeLog-2005-08-23
WebCore/khtml/css/cssparser.cpp
WebCore/khtml/css/cssproperties.c
WebCore/khtml/css/cssproperties.h
WebCore/khtml/css/cssproperties.in
WebCore/khtml/editing/htmlediting.cpp
WebCore/khtml/editing/htmlediting.h
WebCore/khtml/editing/jsediting.cpp
WebCore/kwq/DOM-CSS.mm
WebCore/kwq/DOMPrivate.h