Changeset 54932 in webkit


Ignore:
Timestamp:
Feb 17, 2010 10:44:48 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-02-17 Tony Chang <tony@chromium.org>

Reviewed by Eric Seidel.

https://bugs.webkit.org/show_bug.cgi?id=34914
When pasting absolute font sizes into a content editable area with
page zoom, adjust the font sizes to be the same after page zoom is
applied.

  • editing/pasteboard/page-zoom-expected.txt: Added.
  • editing/pasteboard/page-zoom.html: Added.

2010-02-17 Tony Chang <tony@chromium.org>

Reviewed by Eric Seidel.

https://bugs.webkit.org/show_bug.cgi?id=34914
When pasting absolute font sizes into a content editable area with
page zoom, adjust the font sizes to be the same after page zoom is
applied.

Test: editing/pasteboard/page-zoom.html

  • editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::negateStyleRulesThatAffectAppearance):
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r54931 r54932  
     12010-02-17  Tony Chang  <tony@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=34914
     6        When pasting absolute font sizes into a content editable area with
     7        page zoom, adjust the font sizes to be the same after page zoom is
     8        applied.
     9
     10        * editing/pasteboard/page-zoom-expected.txt: Added.
     11        * editing/pasteboard/page-zoom.html: Added.
     12
    1132010-02-17  Tony Chang  <tony@chromium.org>
    214
  • trunk/WebCore/ChangeLog

    r54931 r54932  
     12010-02-17  Tony Chang  <tony@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=34914
     6        When pasting absolute font sizes into a content editable area with
     7        page zoom, adjust the font sizes to be the same after page zoom is
     8        applied.
     9
     10        Test: editing/pasteboard/page-zoom.html
     11
     12        * editing/ReplaceSelectionCommand.cpp:
     13        (WebCore::ReplaceSelectionCommand::negateStyleRulesThatAffectAppearance):
     14
    1152010-02-17  Tony Chang  <tony@chromium.org>
    216
  • trunk/WebCore/editing/ReplaceSelectionCommand.cpp

    r54931 r54932  
    469469            if (e->renderer() && e->renderer()->style()->floating() != FNONE)
    470470                e->getInlineStyleDecl()->setProperty(CSSPropertyFloat, CSSValueNone);
     471
     472            // Undo the effects of page zoom if we have an absolute font size.  When we copy, we
     473            // compute the new font size as an absolute size so pasting will cause the zoom to be
     474            // applied twice.
     475            if (e->renderer() && e->renderer()->style() && e->renderer()->style()->effectiveZoom() != 1.0
     476                && e->renderer()->style()->fontDescription().isAbsoluteSize()) {
     477                float newSize = e->renderer()->style()->fontDescription().specifiedSize() / e->renderer()->style()->effectiveZoom();
     478                ExceptionCode ec = 0;
     479                e->style()->setProperty(CSSPropertyFontSize, String::number(newSize), false, ec);
     480                ASSERT(!ec);
     481            }
    471482        }
    472483        if (node == m_lastLeafInserted)
Note: See TracChangeset for help on using the changeset viewer.