Changeset 31920 in webkit


Ignore:
Timestamp:
Apr 15, 2008 2:31:11 PM (16 years ago)
Author:
hyatt@apple.com
Message:

2008-04-15 David Hyatt <hyatt@apple.com>

Fix the zoom property so that it works properly with font-size.

Reviewed by John Sullivan

Added fast/css/zoom-font-size.html

  • css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::updateFont): (WebCore::CSSStyleSelector::applyProperty): (WebCore::CSSStyleSelector::checkForZoomChange):
  • css/CSSStyleSelector.h:
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r31918 r31920  
     12008-04-15  David Hyatt  <hyatt@apple.com>
     2
     3        Fix the zoom property so that it works properly with font-size.
     4
     5        Reviewed by John Sullivan
     6
     7        Added fast/css/zoom-font-size.html
     8
     9        * css/CSSStyleSelector.cpp:
     10        (WebCore::CSSStyleSelector::updateFont):
     11        (WebCore::CSSStyleSelector::applyProperty):
     12        (WebCore::CSSStyleSelector::checkForZoomChange):
     13        * css/CSSStyleSelector.h:
     14
    1152008-04-15  Timothy Hatcher  <timothy@apple.com>
    216
  • trunk/WebCore/css/CSSStyleSelector.cpp

    r31915 r31920  
    11971197    checkForTextSizeAdjust();
    11981198    checkForGenericFamilyChange(m_style, m_parentStyle);
     1199    checkForZoomChange(m_style, m_parentStyle);
    11991200    m_style->font().update(m_fontSelector);
    12001201    m_fontDirty = false;
     
    35833584                m_style->setZoom(primitiveValue->getFloatValue());
    35843585        }
     3586       
     3587        m_fontDirty = true;
    35853588        return;
    35863589    }
     
    48784881}
    48794882
     4883void CSSStyleSelector::checkForZoomChange(RenderStyle* style, RenderStyle* parentStyle)
     4884{
     4885    if (style->effectiveZoom() == parentStyle->effectiveZoom())
     4886        return;
     4887   
     4888    const FontDescription& childFont = style->fontDescription();
     4889    FontDescription newFontDescription(childFont);
     4890    setFontSize(newFontDescription, childFont.specifiedSize());
     4891    style->setFontDescription(newFontDescription);
     4892}
     4893
    48804894void CSSStyleSelector::checkForGenericFamilyChange(RenderStyle* style, RenderStyle* parentStyle)
    48814895{
  • trunk/WebCore/css/CSSStyleSelector.h

    r31873 r31920  
    139139        // This function fixes up the default font size if it detects that the current generic font family has changed. -dwh
    140140        void checkForGenericFamilyChange(RenderStyle*, RenderStyle* parentStyle);
     141        void checkForZoomChange(RenderStyle*, RenderStyle* parentStyle);
    141142        void checkForTextSizeAdjust();
    142143
Note: See TracChangeset for help on using the changeset viewer.