Changeset 48474 in webkit


Ignore:
Timestamp:
Sep 17, 2009, 10:33:48 AM (16 years ago)
Author:
mitz@apple.com
Message:

FontDescription.h includes RenderStyleConstants.h, which violates layering
https://bugs.webkit.org/show_bug.cgi?id=29327

Reviewed by Simon Fraser.

  • GNUmakefile.am: Added FontSmoothingMode.h.
  • WebCore.gypi: Added FontSmoothingMode.h.
  • WebCore.vcproj/WebCore.vcproj: Added FontSmoothingMode.h.
  • WebCore.xcodeproj/project.pbxproj: Added FontSmoothingMode.h and made

it a private header.

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Get the

font smoothing mode via the font description.

  • css/CSSPrimitiveValueMappings.h: Include FontSmoothingMode.h

(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Updated for the rename

of FontSmoothing to FontSmoothingMode.

(WebCore::CSSPrimitiveValue::operator FontSmoothingMode): Ditto.

  • css/CSSStyleSelector.cpp:

(WebCore::CSSStyleSelector::applyProperty): Get the font smoothing mode

via the font description.

  • platform/graphics/FontDescription.h: Do not include

RenderStyleConstants.h.

(WebCore::FontDescription::fontSmoothing): Updated for the rename of

FontSmoothing to FontSmoothingMode.

(WebCore::FontDescription::setFontSmoothing): Ditto.

  • platform/graphics/FontSmoothingMode.h: Added.

(WebCore::FontSmoothingMode): Moved the FontSmoothing enum from

RenderStyleConstants here and renamed it to this.

  • rendering/style/RenderStyle.h:

(WebCore::InheritedFlags::fontSmoothing): Removed this getter, since

this can be accessed via the font description.

  • rendering/style/RenderStyleConstants.h: Moved the FontSmoothing enum

from here to FontSmoothingMode.h.

Location:
trunk/WebCore
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r48472 r48474  
     12009-09-17  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Simon Fraser.
     4
     5        FontDescription.h includes RenderStyleConstants.h, which violates layering
     6        https://bugs.webkit.org/show_bug.cgi?id=29327
     7
     8        * GNUmakefile.am: Added FontSmoothingMode.h.
     9        * WebCore.gypi: Added FontSmoothingMode.h.
     10        * WebCore.vcproj/WebCore.vcproj: Added FontSmoothingMode.h.
     11        * WebCore.xcodeproj/project.pbxproj: Added FontSmoothingMode.h and made
     12            it a private header.
     13        * css/CSSComputedStyleDeclaration.cpp:
     14        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Get the
     15            font smoothing mode via the font description.
     16        * css/CSSPrimitiveValueMappings.h: Include FontSmoothingMode.h
     17        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Updated for the rename
     18            of FontSmoothing to FontSmoothingMode.
     19        (WebCore::CSSPrimitiveValue::operator FontSmoothingMode): Ditto.
     20        * css/CSSStyleSelector.cpp:
     21        (WebCore::CSSStyleSelector::applyProperty): Get the font smoothing mode
     22            via the font description.
     23        * platform/graphics/FontDescription.h: Do not include
     24            RenderStyleConstants.h.
     25        (WebCore::FontDescription::fontSmoothing): Updated for the rename of
     26            FontSmoothing to FontSmoothingMode.
     27        (WebCore::FontDescription::setFontSmoothing): Ditto.
     28        * platform/graphics/FontSmoothingMode.h: Added.
     29        (WebCore::FontSmoothingMode): Moved the FontSmoothing enum from
     30            RenderStyleConstants here and renamed it to this.
     31        * rendering/style/RenderStyle.h:
     32        (WebCore::InheritedFlags::fontSmoothing): Removed this getter, since
     33            this can be accessed via the font description.
     34        * rendering/style/RenderStyleConstants.h: Moved the FontSmoothing enum
     35            from here to FontSmoothingMode.h.
     36
    1372009-09-17  Kevin Ollivier  <kevino@theolliviers.com>
    238
  • trunk/WebCore/GNUmakefile.am

    r48270 r48474  
    14871487        WebCore/platform/graphics/FontRenderingMode.h \
    14881488        WebCore/platform/graphics/FontSelector.h \
     1489        WebCore/platform/graphics/FontSmoothingMode.h \
    14891490        WebCore/platform/graphics/FontTraitsMask.h \
    14901491        WebCore/platform/graphics/GeneratedImage.cpp \
  • trunk/WebCore/WebCore.gypi

    r48469 r48474  
    20672067            'platform/graphics/FontRenderingMode.h',
    20682068            'platform/graphics/FontSelector.h',
     2069            'platform/graphics/FontSmoothingMode.h',
    20692070            'platform/graphics/FontTraitsMask.h',
    20702071            'platform/graphics/GeneratedImage.cpp',
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r48431 r48474  
    1853518535                                <File
    1853618536                                        RelativePath="..\platform\graphics\FontSelector.h"
     18537                                        >
     18538                                </File>
     18539                                <File
     18540                                        RelativePath="..\platform\graphics\FontSmoothingMode.h"
    1853718541                                        >
    1853818542                                </File>
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r48454 r48474  
    656656                371F53E90D2704F900ECE0D5 /* CSSUnicodeRangeValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 371F53E70D2704F900ECE0D5 /* CSSUnicodeRangeValue.h */; };
    657657                371F53EA0D2704F900ECE0D5 /* CSSUnicodeRangeValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 371F53E80D2704F900ECE0D5 /* CSSUnicodeRangeValue.cpp */; };
     658                37202199106213C600F25C4B /* FontSmoothingMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 37202198106213C600F25C4B /* FontSmoothingMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
    658659                3724CA570E68A7E400DB4384 /* CoreTextController.h in Headers */ = {isa = PBXBuildFile; fileRef = 3724CA540E68A7E400DB4384 /* CoreTextController.h */; };
    659660                3724CA580E68A7E400DB4384 /* CoreTextController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3724CA550E68A7E400DB4384 /* CoreTextController.cpp */; };
     
    58095810                371F53E70D2704F900ECE0D5 /* CSSUnicodeRangeValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSUnicodeRangeValue.h; sourceTree = "<group>"; };
    58105811                371F53E80D2704F900ECE0D5 /* CSSUnicodeRangeValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSUnicodeRangeValue.cpp; sourceTree = "<group>"; };
     5812                37202198106213C600F25C4B /* FontSmoothingMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontSmoothingMode.h; sourceTree = "<group>"; };
    58115813                3724CA540E68A7E400DB4384 /* CoreTextController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreTextController.h; sourceTree = "<group>"; };
    58125814                3724CA550E68A7E400DB4384 /* CoreTextController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CoreTextController.cpp; sourceTree = "<group>"; };
     
    1391813920                                37ACCE410DA2980F0089E602 /* FontRenderingMode.h */,
    1391913921                                B2C3DA5A0D006CD600EF6F26 /* FontSelector.h */,
     13922                                37202198106213C600F25C4B /* FontSmoothingMode.h */,
    1392013923                                3784C34A0E11AA34007D8D48 /* FontTraitsMask.h */,
    1392113924                                BCE04C930DAFF902007A0F41 /* GeneratedImage.cpp */,
     
    1782417827                                510D4A50103177A20049EA54 /* WebSocketChannelClient.h in Headers */,
    1782517828                                51ABAE451043AB4A008C5260 /* WebSocketHandshake.h in Headers */,
     17829                                37202199106213C600F25C4B /* FontSmoothingMode.h in Headers */,
    1782617830                        );
    1782717831                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebCore/css/CSSComputedStyleDeclaration.cpp

    r48441 r48474  
    11231123            return CSSPrimitiveValue::create(style->resize());
    11241124        case CSSPropertyWebkitFontSmoothing:
    1125             return CSSPrimitiveValue::create(style->fontSmoothing());
     1125            return CSSPrimitiveValue::create(style->fontDescription().fontSmoothing());
    11261126        case CSSPropertyZIndex:
    11271127            if (style->hasAutoZIndex())
  • trunk/WebCore/css/CSSPrimitiveValueMappings.h

    r48441 r48474  
    3131#include "CSSPrimitiveValue.h"
    3232#include "CSSValueKeywords.h"
     33#include "FontSmoothingMode.h"
    3334#include "GraphicsTypes.h"
    3435#include "Path.h"
     
    17991800}
    18001801
    1801 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontSmoothing smoothing)
     1802template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontSmoothingMode smoothing)
    18021803    : m_type(CSS_IDENT)
    18031804{
     
    18211822}
    18221823
    1823 template<> inline CSSPrimitiveValue::operator FontSmoothing() const
     1824template<> inline CSSPrimitiveValue::operator FontSmoothingMode() const
    18241825{
    18251826    switch (m_value.ident) {
  • trunk/WebCore/css/CSSStyleSelector.cpp

    r48442 r48474  
    34993499        FontDescription fontDescription = m_style->fontDescription();
    35003500        if (isInherit)
    3501             fontDescription.setFontSmoothing(m_parentStyle->fontSmoothing());
     3501            fontDescription.setFontSmoothing(m_parentStyle->fontDescription().fontSmoothing());
    35023502        else if (isInitial)
    35033503            fontDescription.setFontSmoothing(AutoSmoothing);
     
    35063506                return;
    35073507            int id = primitiveValue->getIdent();
    3508             FontSmoothing smoothing;
     3508            FontSmoothingMode smoothing;
    35093509            switch (id) {
    35103510                case CSSValueAuto:
  • trunk/WebCore/platform/graphics/FontDescription.h

    r48441 r48474  
    2828#include "FontFamily.h"
    2929#include "FontRenderingMode.h"
     30#include "FontSmoothingMode.h"
    3031#include "FontTraitsMask.h"
    31 #include "RenderStyleConstants.h"
    3232
    3333namespace WebCore {
     
    8787    FontRenderingMode renderingMode() const { return static_cast<FontRenderingMode>(m_renderingMode); }
    8888    unsigned keywordSize() const { return m_keywordSize; }
    89     FontSmoothing fontSmoothing() const { return static_cast<FontSmoothing>(m_fontSmoothing); }
     89    FontSmoothingMode fontSmoothing() const { return static_cast<FontSmoothingMode>(m_fontSmoothing); }
    9090
    9191    FontTraitsMask traitsMask() const;
     
    102102    void setRenderingMode(FontRenderingMode mode) { m_renderingMode = mode; }
    103103    void setKeywordSize(unsigned s) { m_keywordSize = s; }
    104     void setFontSmoothing(FontSmoothing smoothing) { m_fontSmoothing = smoothing; }
     104    void setFontSmoothing(FontSmoothingMode smoothing) { m_fontSmoothing = smoothing; }
    105105
    106106private:
     
    125125                           // (e.g., 13px monospace vs. 16px everything else).  Sizes are 1-8 (like the HTML size values for <font>).
    126126
    127     unsigned m_fontSmoothing : 2; // FontSmoothing
     127    unsigned m_fontSmoothing : 2; // FontSmoothingMode
    128128};
    129129
  • trunk/WebCore/rendering/style/RenderStyle.h

    r48441 r48474  
    435435    const FontDescription& fontDescription() const { return inherited->font.fontDescription(); }
    436436    int fontSize() const { return inherited->font.pixelSize(); }
    437     FontSmoothing fontSmoothing() const { return inherited->font.fontDescription().fontSmoothing(); }
    438437
    439438    const Color& color() const { return inherited->color; }
  • trunk/WebCore/rendering/style/RenderStyleConstants.h

    r48441 r48474  
    322322};
    323323
    324 enum FontSmoothing {
    325     AutoSmoothing, NoSmoothing, Antialiased, SubpixelAntialiased
    326 };
    327 
    328324} // namespace WebCore
    329325
Note: See TracChangeset for help on using the changeset viewer.