• apavlov@chromium.org's avatar
    font property does not show up as "shorthand" in inspector · d9fbbe2c
    apavlov@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=15598
    
    Reviewed by Nikolas Zimmermann.
    
    Source/WebCore:
    
    The "font" CSS property is turned into a real shorthand, as its longhands used to float around
    in the resulting style declaration without any reference to their underlying "font" property.
    
    Test: fast/css/font-shorthand.html
    
    * css/CSSMutableStyleDeclaration.cpp:
    (WebCore::CSSMutableStyleDeclaration::getPropertyValue): Extracted the "font" value building into fontValue().
    (WebCore::CSSMutableStyleDeclaration::appendFontLonghandValueIfExplicit): Added
    (WebCore::CSSMutableStyleDeclaration::fontValue): Build the "font" value from longhands.
    * css/CSSMutableStyleDeclaration.h:
    * css/CSSParser.cpp:
    (WebCore::CSSParser::addProperty): Added optional "implicit" parameter.
    (WebCore::CSSParser::parseFont): Build respective longhands instead of the shorthand "font" property.
    * css/CSSParser.h: Added optional "implicit" parameter to addProperty().
    * css/CSSPropertyLonghand.cpp:
    (WebCore::initShorthandMap): Added "font" shorthand map entry.
    * css/CSSStyleSelector.cpp:
    (WebCore::CSSStyleSelector::applyPropertyToStyle): Separated the property application from the instance setup.
    (WebCore::CSSStyleSelector::applyPropertyToCurrentStyle): Added.
    * css/CSSStyleSelector.h: Made updateFont() public.
    * css/FontValue.cpp:
    (WebCore::FontValue::customCssText): Made use of StringBuilder.
    * html/canvas/CanvasRenderingContext2D.cpp:
    (WebCore::CanvasRenderingContext2D::setFont): Apply "font" longhands rather than the (non-existent) "font" property.
    * inspector/front-end/StylesSidebarPane.js:
    (WebInspector.StylesSidebarPane.prototype._markUsedProperties): Removed a workaround for "font" not being a shorthand.
    * page/animation/AnimationBase.cpp:
    (WebCore::addShorthandProperties): Removed a workaround for "font" not being a shorthand.
    
    LayoutTests:
    
    * fast/css/font-shorthand-expected.txt: Added.
    * fast/css/font-shorthand.html: Added.
    * fast/inspector-support/style-expected.txt:
    * fast/inspector-support/style.html:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@100273 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    d9fbbe2c
ChangeLog 4.31 MB