Changeset 124372 in webkit
- Timestamp:
- Aug 1, 2012 3:12:23 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r124371 r124372 1 2012-08-01 Peter Beverloo <peter@chromium.org> 2 3 [Text Autosizing] Provide an API for influencing the font scale factor 4 https://bugs.webkit.org/show_bug.cgi?id=92882 5 6 Reviewed by Adam Barth. 7 8 Add a basic test. More usable tests should be added later, as it's 9 really hard to test this accurately in this phase of the implementation, 10 and Text Autosizing is still subject to various bugs. 11 12 The font scale factor applied to Text Autosizing influences the sizing 13 of text, and will influence the scaling of boosted blocks once the 14 implementation progresses. For Android, it will be set to the font size 15 chosen in the user's system-wide preferences. 16 17 * fast/text-autosizing/font-scale-factor-expected.html: Added. 18 * fast/text-autosizing/font-scale-factor.html: Added. 19 1 20 2012-08-01 Mike West <mkwst@chromium.org> 2 21 -
trunk/Source/WebCore/ChangeLog
r124371 r124372 1 2012-08-01 Peter Beverloo <peter@chromium.org> 2 3 [Text Autosizing] Provide an API for influencing the font scale factor 4 https://bugs.webkit.org/show_bug.cgi?id=92882 5 6 Reviewed by Adam Barth. 7 8 Add the font scale factor to settings, and provide an API in 9 window.internal.settings to change it from layout tests. 10 11 The font scale factor applied to Text Autosizing influences the sizing 12 of text, and will influence the scaling of boosted blocks once the 13 implementation progresses. For Android, it will be set to the font size 14 chosen in the user's system-wide preferences. 15 16 Test: fast/text-autosizing/font-scale-factor.html 17 18 * page/Settings.cpp: 19 (WebCore::Settings::Settings): 20 (WebCore): 21 (WebCore::Settings::setTextAutosizingFontScaleFactor): 22 * page/Settings.h: 23 (Settings): 24 (WebCore::Settings::textAutosizingFontScaleFactor): 25 * rendering/TextAutosizer.cpp: 26 (WebCore::TextAutosizer::processBlock): 27 * testing/InternalSettings.cpp: 28 (WebCore::InternalSettings::Backup::Backup): 29 (WebCore::InternalSettings::Backup::restoreTo): 30 (WebCore::InternalSettings::setTextAutosizingFontScaleFactor): 31 (WebCore): 32 * testing/InternalSettings.h: 33 (Backup): 34 (InternalSettings): 35 * testing/InternalSettings.idl: 36 1 37 2012-08-01 Mike West <mkwst@chromium.org> 2 38 -
trunk/Source/WebCore/page/Settings.cpp
r123856 r124372 140 140 , m_maximumHTMLParserDOMTreeDepth(defaultMaximumHTMLParserDOMTreeDepth) 141 141 #if ENABLE(TEXT_AUTOSIZING) 142 , m_textAutosizingFontScaleFactor(1) 142 143 #if HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP 143 144 , m_textAutosizingWindowSizeOverride(320, 480) … … 430 431 m_page->setNeedsRecalcStyleInAllFrames(); 431 432 } 433 434 void Settings::setTextAutosizingFontScaleFactor(float fontScaleFactor) 435 { 436 m_textAutosizingFontScaleFactor = fontScaleFactor; 437 m_page->setNeedsRecalcStyleInAllFrames(); 438 } 439 432 440 #endif 433 441 -
trunk/Source/WebCore/page/Settings.h
r123856 r124372 111 111 void setTextAutosizingEnabled(bool); 112 112 bool textAutosizingEnabled() const { return m_textAutosizingEnabled; } 113 114 void setTextAutosizingFontScaleFactor(float); 115 float textAutosizingFontScaleFactor() const { return m_textAutosizingFontScaleFactor; } 113 116 114 117 // Only set by Layout Tests, and only used if textAutosizingEnabled() returns true. … … 645 648 unsigned m_maximumHTMLParserDOMTreeDepth; 646 649 #if ENABLE(TEXT_AUTOSIZING) 650 float m_textAutosizingFontScaleFactor; 647 651 IntSize m_textAutosizingWindowSizeOverride; 648 652 bool m_textAutosizingEnabled : 1; -
trunk/Source/WebCore/rendering/TextAutosizer.cpp
r121920 r124372 69 69 int windowLogicalWidth = block->isHorizontalWritingMode() ? windowSize.width() : windowSize.height(); 70 70 float multiplier = static_cast<float>(block->logicalWidth()) / windowLogicalWidth; // FIXME: This is overly simplistic. 71 multiplier *= m_document->settings()->textAutosizingFontScaleFactor(); 72 71 73 if (multiplier < 1) 72 74 return; -
trunk/Source/WebCore/testing/InternalSettings.cpp
r124304 r124372 92 92 , m_originalTextAutosizingEnabled(settings->textAutosizingEnabled()) 93 93 , m_originalTextAutosizingWindowSizeOverride(settings->textAutosizingWindowSizeOverride()) 94 , m_originalTextAutosizingFontScaleFactor(settings->textAutosizingFontScaleFactor()) 94 95 #endif 95 96 #if ENABLE(DIALOG_ELEMENT) … … 122 123 settings->setTextAutosizingEnabled(m_originalTextAutosizingEnabled); 123 124 settings->setTextAutosizingWindowSizeOverride(m_originalTextAutosizingWindowSizeOverride); 125 settings->setTextAutosizingFontScaleFactor(m_originalTextAutosizingFontScaleFactor); 124 126 #endif 125 127 #if ENABLE(DIALOG_ELEMENT) … … 377 379 UNUSED_PARAM(width); 378 380 UNUSED_PARAM(height); 381 UNUSED_PARAM(ec); 382 #endif 383 } 384 385 void InternalSettings::setTextAutosizingFontScaleFactor(float fontScaleFactor, ExceptionCode& ec) 386 { 387 #if ENABLE(TEXT_AUTOSIZING) 388 InternalSettingsGuardForSettings(); 389 settings()->setTextAutosizingFontScaleFactor(fontScaleFactor); 390 #else 391 UNUSED_PARAM(fontScaleFactor); 379 392 UNUSED_PARAM(ec); 380 393 #endif -
trunk/Source/WebCore/testing/InternalSettings.h
r124304 r124372 74 74 bool m_originalTextAutosizingEnabled; 75 75 IntSize m_originalTextAutosizingWindowSizeOverride; 76 float m_originalTextAutosizingFontScaleFactor; 76 77 #endif 77 78 #if ENABLE(DIALOG_ELEMENT) … … 116 117 void setTextAutosizingEnabled(bool enabled, ExceptionCode&); 117 118 void setTextAutosizingWindowSizeOverride(int width, int height, ExceptionCode&); 119 void setTextAutosizingFontScaleFactor(float fontScaleFactor, ExceptionCode&); 118 120 void setEnableScrollAnimator(bool enabled, ExceptionCode&); 119 121 bool scrollAnimatorEnabled(ExceptionCode&); -
trunk/Source/WebCore/testing/InternalSettings.idl
r124304 r124372 55 55 void setTextAutosizingEnabled(in boolean enabled) raises(DOMException); 56 56 void setTextAutosizingWindowSizeOverride(in long width, in long height) raises(DOMException); 57 void setTextAutosizingFontScaleFactor(in float fontScaleFactor) raises(DOMException); 57 58 void setEnableScrollAnimator(in boolean enabled) raises(DOMException); 58 59 boolean scrollAnimatorEnabled() raises(DOMException); -
trunk/Source/WebKit/chromium/ChangeLog
r124348 r124372 1 2012-08-01 Peter Beverloo <peter@chromium.org> 2 3 [Text Autosizing] Provide an API for influencing the font scale factor 4 https://bugs.webkit.org/show_bug.cgi?id=92882 5 6 Reviewed by Adam Barth. 7 8 Add an API to change Text Autosizing's font scale factor. 9 10 The font scale factor applied to Text Autosizing influences the sizing 11 of text, and will influence the scaling of boosted blocks once the 12 implementation progresses. For Android, it will be set to the font size 13 chosen in the user's system-wide preferences. 14 15 * public/WebSettings.h: 16 * src/WebSettingsImpl.cpp: 17 (WebKit::WebSettingsImpl::setTextAutosizingFontScaleFactor): 18 (WebKit): 19 * src/WebSettingsImpl.h: 20 (WebSettingsImpl): 21 1 22 2012-08-01 Dirk Pranke <dpranke@chromium.org> 2 23 -
trunk/Source/WebKit/chromium/public/WebSettings.h
r124097 r124372 146 146 virtual void setTextAreasAreResizable(bool) = 0; 147 147 virtual void setTextAutosizingEnabled(bool) = 0; 148 virtual void setTextAutosizingFontScaleFactor(float) = 0; 148 149 virtual void setTextDirectionSubmenuInclusionBehaviorNeverIncluded() = 0; 149 150 virtual void setUnifiedTextCheckerEnabled(bool) = 0; -
trunk/Source/WebKit/chromium/src/WebSettingsImpl.cpp
r124097 r124372 150 150 } 151 151 152 void WebSettingsImpl::setTextAutosizingFontScaleFactor(float fontScaleFactor) 153 { 154 #if ENABLE(TEXT_AUTOSIZING) 155 m_settings->setTextAutosizingFontScaleFactor(fontScaleFactor); 156 #else 157 UNUSED_PARAM(fontScaleFactor); 158 #endif 159 } 160 152 161 void WebSettingsImpl::setDefaultTextEncodingName(const WebString& encoding) 153 162 { -
trunk/Source/WebKit/chromium/src/WebSettingsImpl.h
r124097 r124372 141 141 virtual void setTextAreasAreResizable(bool); 142 142 virtual void setTextAutosizingEnabled(bool); 143 virtual void setTextAutosizingFontScaleFactor(float); 143 144 virtual void setTextDirectionSubmenuInclusionBehaviorNeverIncluded(); 144 145 virtual void setUnifiedTextCheckerEnabled(bool);
Note: See TracChangeset
for help on using the changeset viewer.