WebCore:
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Jan 2005 01:13:07 +0000 (01:13 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Jan 2005 01:13:07 +0000 (01:13 +0000)
commit31e133b8352fa884d3414dfeddc5930fb75b728d
treef1507a7d685874fb1de3d859bd11bac3bacf29dd
parentc52b8d8d82abcaeb67515ccc5fe35aa242dd2325
WebCore:

        Reviewed by Darin, Hyatt and Ken.

<rdar://problem/3790449> REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration

        * khtml/css/css_computedstyle.cpp:
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support
for -khtml-text-decorations-in-effect property. This works like text-docration
but follows proper inline semantics, that is, if a parent is causing text
decoration then -khtml-text-decorations-in-effect on this element will reflect that.
        * khtml/css/cssproperties.in: Add -khtml-text-decorations-in-effect property.
        * khtml/css/cssproperties.h: regenerated
        * khtml/css/cssvalues.c: regenerated
        * khtml/css/cssparser.cpp: regenerated
        * khtml/css/cssproperties.c: regenerated

        * khtml/css/css_valueimpl.h: Made copyPropertiesInSet public.

        * khtml/editing/htmlediting.cpp:
        (khtml::StyleChange::init): Handle -khtml-text-decorations-in-effect
specially, translate to text-decoration
        (khtml::ApplyStyleCommand::applyInlineStyle): Fix a comment.
        (khtml::ApplyStyleCommand::removeInlineStyle): Add new way of pushing down
text-decoration styles around the edges of the selected range.
        (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAroundNode): Helper for this.
        (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAtBoundaries): ditto
        (khtml::ApplyStyleCommand::nodeFullyUnselected): ditto
        (khtml::hasTextDecorationProperty): ditto
        (khtml::highestAncestorWithTextDecoration): ditto
        (khtml::ApplyStyleCommand::extractTextDecorationStyle): ditto
        (khtml::ApplyStyleCommand::extractAndNegateTextDecorationStyle): ditto
        (khtml::ApplyStyleCommand::applyTextDecorationStyle): ditto
        * khtml/editing/htmlediting.h: Prototype new methods.
        * khtml/editing/jsediting.cpp: Make underline execCommand use the new CSS property.

- as a necessary part of the fix, fixed the longstanding problem
that mutating an element's inlineStyleDecl would not property
update its style attribute. now it does.

        * khtml/css/css_valueimpl.cpp:
        (DOM::CSSMutableStyleDeclarationImpl::setChanged): If this is an inline style
declaration, tell the element it's style attribute needs updating.
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::invalidateStyleAttribute): New method, just calls down
to the dom element.
        (HTMLElementImpl::updateStyleAttribute): Regenerate style attribute from
inline style declaration.
        * khtml/html/html_elementimpl.h: Prototype new stuff.
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::ElementImpl): Initialize new attribute.
        (ElementImpl::updateStyleAttributeIfNeeded): New method to check if the style
is dirty and this is an html element, and if so call the html element to
regenerate the style attribute.
        (ElementImpl::attributes): update style if needed
        (ElementImpl::getAttribute): ditto
        (ElementImpl::hasAttributes): ditto
        (ElementImpl::dump): ditto
        (XMLElementImpl::cloneNode): ditto
        * khtml/xml/dom_elementimpl.h:
        (DOM::ElementImpl::isStyleAttributeValid): new method to manage style attr
dirty bit
        (DOM::ElementImpl::setStyleAttributeValid): ditto

- added new layout tests for underlining:

        * layout-tests/editing/editing.js:
        * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt: Added.
        * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt: Added.
        * layout-tests/editing/style/remove-underline-across-paragraph-in-bold.html: Added.
        * layout-tests/editing/style/remove-underline-across-paragraph.html: Added.
        * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt: Added.
        * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt: Added.
        * layout-tests/editing/style/remove-underline-after-paragraph-in-bold.html: Added.
        * layout-tests/editing/style/remove-underline-after-paragraph.html: Added.
        * layout-tests/editing/style/remove-underline-expected.txt: Added.
        * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt: Added.
        * layout-tests/editing/style/remove-underline-from-stylesheet.html: Added.
        * layout-tests/editing/style/remove-underline-in-bold-expected.txt: Added.
        * layout-tests/editing/style/remove-underline-in-bold.html: Added.
        * layout-tests/editing/style/remove-underline.html: Added.
        * layout-tests/editing/style/underline-expected.txt: Added.
        * layout-tests/editing/style/underline.html: Added.

WebKit:

        Reviewed by Darin, Hyatt and Ken.

<rdar://problem/3790449> REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration

        * WebView.subproj/WebHTMLView.m:
        (-[WebHTMLView _styleFromFontAttributes:]): Use new -khtml-text-decorations-in-effect
property
        (-[WebHTMLView _styleForAttributeChange:]): likewise
        (-[WebHTMLView underline:]): likewise

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8466 268f45cc-cd09-0410-ab3c-d52691b4dbfc
35 files changed:
LayoutTests/editing/editing.js
LayoutTests/editing/style/remove-underline-across-paragraph-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/remove-underline-across-paragraph-in-bold.html [new file with mode: 0644]
LayoutTests/editing/style/remove-underline-across-paragraph.html [new file with mode: 0644]
LayoutTests/editing/style/remove-underline-after-paragraph-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/remove-underline-after-paragraph-in-bold.html [new file with mode: 0644]
LayoutTests/editing/style/remove-underline-after-paragraph.html [new file with mode: 0644]
LayoutTests/editing/style/remove-underline-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/remove-underline-from-stylesheet-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/remove-underline-from-stylesheet.html [new file with mode: 0644]
LayoutTests/editing/style/remove-underline-in-bold-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/remove-underline-in-bold.html [new file with mode: 0644]
LayoutTests/editing/style/remove-underline.html [new file with mode: 0644]
LayoutTests/editing/style/underline-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/underline.html [new file with mode: 0644]
WebCore/ChangeLog-2005-08-23
WebCore/khtml/css/css_computedstyle.cpp
WebCore/khtml/css/css_valueimpl.cpp
WebCore/khtml/css/css_valueimpl.h
WebCore/khtml/css/cssparser.cpp
WebCore/khtml/css/cssproperties.c
WebCore/khtml/css/cssproperties.h
WebCore/khtml/css/cssproperties.in
WebCore/khtml/css/cssvalues.c
WebCore/khtml/editing/htmlediting.cpp
WebCore/khtml/editing/htmlediting.h
WebCore/khtml/editing/jsediting.cpp
WebCore/khtml/html/html_elementimpl.cpp
WebCore/khtml/html/html_elementimpl.h
WebCore/khtml/xml/dom_elementimpl.cpp
WebCore/khtml/xml/dom_elementimpl.h
WebKit/ChangeLog
WebKit/WebView.subproj/WebHTMLView.m