Skip to content
  • dbates@webkit.org's avatar
    [iOS] Upstream Letterpress effect · 5c168d75
    dbates@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=123932
    
    Reviewed by Sam Weinig.
    
    Source/JavaScriptCore:
    
    Add feature define ENABLE_LETTERPRESS disabled by default. We only enable
    letterpress on iOS.
    
    * Configurations/FeatureDefines.xcconfig:
    
    Source/WebCore:
    
    Test: platform/iphone-simulator/iphone/getComputedStyle-text-decoration-letterpress.html
    
    * Configurations/FeatureDefines.xcconfig: Add feature define ENABLE_LETTERPRESS disabled
    by default. We only enable letterpress on iOS.
    * css/CSSComputedStyleDeclaration.cpp:
    (WebCore::renderTextDecorationFlagsToCSSValue): Add support for CSS value -webkit-letterpress.
    * css/CSSParser.cpp:
    (WebCore::CSSParser::parseTextDecoration): Ditto.
    * css/CSSPrimitiveValueMappings.h:
    (WebCore::CSSPrimitiveValue::operator TextDecoration): Ditto.
    * css/CSSValueKeywords.in: Added CSS value -webkit-letterpress.
    * platform/graphics/GraphicsContext.h:
    * platform/graphics/mac/FontMac.mm:
    (WebCore::fillVectorWithHorizontalGlyphPositions): Added.
    (WebCore::shouldUseLetterpressEffect): Added.
    (WebCore::showLetterpressedGlyphsWithAdvances): Added.
    (WebCore::showGlyphsWithAdvances): Modified to call showLetterpressedGlyphsWithAdvances()
    to show a letterpressed glyph. I also included additional iOS-specific changes.
    (WebCore::Font::drawGlyphs):
    * rendering/TextPaintStyle.cpp:
    (WebCore::TextPaintStyle::TextPaintStyle):
    (WebCore::computeTextPaintStyle): Modified to compute letterpress effect style.
    (WebCore::updateGraphicsContext): Modified to apply/unapply letterpress effect drawing mode.
    * rendering/TextPaintStyle.h:
    * rendering/style/RenderStyleConstants.h:
    
    Source/WebKit/mac:
    
    Add feature define ENABLE_LETTERPRESS disabled by default. We only enable
    letterpress on iOS.
    
    * Configurations/FeatureDefines.xcconfig:
    
    Source/WebKit2:
    
    Add feature define ENABLE_LETTERPRESS disabled by default. We only enable
    letterpress on iOS.
    
    * Configurations/FeatureDefines.xcconfig:
    
    Source/WTF:
    
    Add feature define ENABLE_LETTERPRESS disabled by default. We only enable
    letterpress on iOS.
    
    * wtf/FeatureDefines.h:
    
    LayoutTests:
    
    * platform/iphone-simulator/iphone/getComputedStyle-text-decoration-letterpress-expected.txt: Added.
    * platform/iphone-simulator/iphone/getComputedStyle-text-decoration-letterpress.html: Added.
    * platform/iphone-simulator/iphone/resources/getComputedStyle-text-decoration-letterpress.js: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158803 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    5c168d75