Diff
Modified: trunk/LayoutTests/ChangeLog (121906 => 121907)
--- trunk/LayoutTests/ChangeLog 2012-07-05 15:27:26 UTC (rev 121906)
+++ trunk/LayoutTests/ChangeLog 2012-07-05 15:38:10 UTC (rev 121907)
@@ -1,3 +1,24 @@
+2012-07-05 John Mellor <[email protected]>
+
+ Text Autosizing: Add test framework and simple test.
+ https://bugs.webkit.org/show_bug.cgi?id=90561
+
+ Added a RefTest checking that Text Autosizing is active.
+ Skipped the text-autosizing test directory on platforms that
+ currently disable ENABLE(TEXT_AUTOSIZING).
+
+ Reviewed by Adam Barth.
+
+ * fast/text-autosizing/simple-paragraph-expected.html: Added.
+ * fast/text-autosizing/simple-paragraph.html: Added.
+ * platform/efl/TestExpectations:
+ * platform/gtk/TestExpectations:
+ * platform/mac/TestExpectations:
+ * platform/qt/TestExpectations:
+ * platform/win/Skipped:
+ * platform/wincairo/Skipped:
+ * platform/wk2/Skipped:
+
2012-07-05 Dongwoo Im <[email protected]>
[EFL] Enable the CUSTOM_SCHEME_HANDLER feature as default.
Added: trunk/LayoutTests/fast/text-autosizing/simple-paragraph-expected.html (0 => 121907)
--- trunk/LayoutTests/fast/text-autosizing/simple-paragraph-expected.html (rev 0)
+++ trunk/LayoutTests/fast/text-autosizing/simple-paragraph-expected.html 2012-07-05 15:38:10 UTC (rev 121907)
@@ -0,0 +1,16 @@
+<html>
+<head>
+
+<meta name="viewport" content="width=800">
+<style type="text/css">
+body { width: 800px; margin: 0; }
+</style>
+
+</head>
+<body>
+
+<!-- The font-size change is intentional; the line-height change is a known FIXME; the margin-top change is a bug -->
+<p style="font-size: 2.5rem; line-height: 0.6; margin-top: 0.8rem">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sapien sapien, tempus id egestas a, consectetur et felis. Ut pharetra mi eget lectus laoreet rutrum. Mauris tellus odio, egestas vitae sodales in, vehicula eget ante. Pellentesque id egestas arcu. Quisque tellus quam, rhoncus ac elementum vel, volutpat vel felis. Aliquam ut leo dolor, eget egestas tellus. Nunc ut velit gravida nisl fringilla rutrum eget at arcu. Vivamus et pretium mauris.</p>
+
+</body>
+</html>
Added: trunk/LayoutTests/fast/text-autosizing/simple-paragraph.html (0 => 121907)
--- trunk/LayoutTests/fast/text-autosizing/simple-paragraph.html (rev 0)
+++ trunk/LayoutTests/fast/text-autosizing/simple-paragraph.html 2012-07-05 15:38:10 UTC (rev 121907)
@@ -0,0 +1,24 @@
+<html>
+<head>
+
+<meta name="viewport" content="width=800">
+<style type="text/css">
+body { width: 800px; margin: 0; }
+</style>
+
+<script type="text/_javascript_">
+if (window.internals) {
+ window.internals.settings.setTextAutosizingEnabled(true);
+ window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480);
+} else if (window.console && console.warn) {
+ console.warn("This test depends on the Text Autosizing setting being true, so run it in DumpRenderTree, or manually enable Text Autosizing, and either use a mobile device with 320px device-width (like Nexus S or iPhone), or define HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP.");
+}
+</script>
+
+</head>
+<body>
+
+<p style="line-height: 1.5">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sapien sapien, tempus id egestas a, consectetur et felis. Ut pharetra mi eget lectus laoreet rutrum. Mauris tellus odio, egestas vitae sodales in, vehicula eget ante. Pellentesque id egestas arcu. Quisque tellus quam, rhoncus ac elementum vel, volutpat vel felis. Aliquam ut leo dolor, eget egestas tellus. Nunc ut velit gravida nisl fringilla rutrum eget at arcu. Vivamus et pretium mauris.</p>
+
+</body>
+</html>
Modified: trunk/LayoutTests/platform/efl/TestExpectations (121906 => 121907)
--- trunk/LayoutTests/platform/efl/TestExpectations 2012-07-05 15:27:26 UTC (rev 121906)
+++ trunk/LayoutTests/platform/efl/TestExpectations 2012-07-05 15:38:10 UTC (rev 121907)
@@ -132,6 +132,9 @@
// Disable webaudio codec tests, including proprietary codecs.
BUGWK88794 SKIP : webaudio/codec-tests = PASS
+// Text Autosizing is not yet enabled.
+BUGWK84186 SKIP : fast/text-autosizing = PASS
+
//////////////////////////////////////////////////////////////////////////////////////////
// CRASHES
//////////////////////////////////////////////////////////////////////////////////////////
Modified: trunk/LayoutTests/platform/gtk/TestExpectations (121906 => 121907)
--- trunk/LayoutTests/platform/gtk/TestExpectations 2012-07-05 15:27:26 UTC (rev 121906)
+++ trunk/LayoutTests/platform/gtk/TestExpectations 2012-07-05 15:38:10 UTC (rev 121907)
@@ -345,6 +345,9 @@
// Content Security Policy 1.1 (ENABLE_CSP_NEXT) is not enabled
BUGWK85558 SKIP : http/tests/security/contentSecurityPolicy/1.1 = TEXT
+// Text Autosizing is not yet enabled.
+BUGWK84186 SKIP : fast/text-autosizing = PASS
+
//////////////////////////////////////////////////////////////////////////////////////////
// End of Expected failures
//////////////////////////////////////////////////////////////////////////////////////////
Modified: trunk/LayoutTests/platform/mac/TestExpectations (121906 => 121907)
--- trunk/LayoutTests/platform/mac/TestExpectations 2012-07-05 15:27:26 UTC (rev 121906)
+++ trunk/LayoutTests/platform/mac/TestExpectations 2012-07-05 15:38:10 UTC (rev 121907)
@@ -286,3 +286,6 @@
BUGWK88171 : fast/block/float/independent-align-positioning.html = TEXT
BUGWK88171 : fast/block/float/010.html = TEXT
BUGWK88171 : css1/formatting_model/floating_elements.html = TEXT
+
+// Text Autosizing is not enabled.
+BUGWK84186 SKIP : fast/text-autosizing = PASS
Modified: trunk/LayoutTests/platform/qt/TestExpectations (121906 => 121907)
--- trunk/LayoutTests/platform/qt/TestExpectations 2012-07-05 15:27:26 UTC (rev 121906)
+++ trunk/LayoutTests/platform/qt/TestExpectations 2012-07-05 15:38:10 UTC (rev 121907)
@@ -106,3 +106,6 @@
// Require rebaseline after bug 88171
BUGWK88171 : fast/block/float/010.html = TEXT
BUGWK88171 : css1/formatting_model/floating_elements.html = TEXT
+
+// Text Autosizing is not enabled.
+BUGWK84186 SKIP : fast/text-autosizing = PASS
Modified: trunk/LayoutTests/platform/win/Skipped (121906 => 121907)
--- trunk/LayoutTests/platform/win/Skipped 2012-07-05 15:27:26 UTC (rev 121906)
+++ trunk/LayoutTests/platform/win/Skipped 2012-07-05 15:38:10 UTC (rev 121907)
@@ -1286,6 +1286,9 @@
# viewport meta tag support
fast/viewport
+# Text Autosizing is not enabled (http://webkit.org/b/84186).
+fast/text-autosizing
+
# https://bugs.webkit.org/show_bug.cgi?id=45983
media/media-can-play-mpeg4-video.html
Modified: trunk/LayoutTests/platform/wincairo/Skipped (121906 => 121907)
--- trunk/LayoutTests/platform/wincairo/Skipped 2012-07-05 15:27:26 UTC (rev 121906)
+++ trunk/LayoutTests/platform/wincairo/Skipped 2012-07-05 15:38:10 UTC (rev 121907)
@@ -1794,6 +1794,9 @@
# viewport meta tag support
fast/viewport
+# Text Autosizing is not enabled (http://webkit.org/b/84186).
+fast/text-autosizing
+
# https://bugs.webkit.org/show_bug.cgi?id=45983
media/media-can-play-mpeg4-video.html
Modified: trunk/LayoutTests/platform/wk2/Skipped (121906 => 121907)
--- trunk/LayoutTests/platform/wk2/Skipped 2012-07-05 15:27:26 UTC (rev 121906)
+++ trunk/LayoutTests/platform/wk2/Skipped 2012-07-05 15:38:10 UTC (rev 121907)
@@ -812,6 +812,10 @@
# https://bugs.webkit.org/show_bug.cgi?id=86000
http/tests/security/referrer-policy-redirect-link.html
+# Text Autosizing is not yet enabled.
+# https://bugs.webkit.org/show_bug.cgi?id=84186
+fast/text-autosizing
+
### END OF (1) Classified failures with bug reports
########################################
Modified: trunk/Source/WebCore/ChangeLog (121906 => 121907)
--- trunk/Source/WebCore/ChangeLog 2012-07-05 15:27:26 UTC (rev 121906)
+++ trunk/Source/WebCore/ChangeLog 2012-07-05 15:38:10 UTC (rev 121907)
@@ -1,3 +1,34 @@
+2012-07-05 John Mellor <[email protected]>
+
+ Text Autosizing: Add test framework and simple test.
+ https://bugs.webkit.org/show_bug.cgi?id=90561
+
+ Exposes methods allowing Layout Tests to enable Text Autosizing and
+ get the same results as if they were running on a mobile device.
+
+ Reviewed by Adam Barth.
+
+ Test: fast/text-autosizing/simple-paragraph.html
+
+ * page/Settings.cpp:
+ (WebCore::Settings::Settings):
+ (WebCore):
+ (WebCore::Settings::setTextAutosizingWindowSizeOverride):
+ * page/Settings.h:
+ (Settings):
+ (WebCore::Settings::textAutosizingWindowSizeOverride):
+ * rendering/TextAutosizer.cpp:
+ (WebCore::TextAutosizer::boostSubtree):
+ * testing/InternalSettings.cpp:
+ (WebCore::InternalSettings::InternalSettings):
+ (WebCore::InternalSettings::restoreTo):
+ (WebCore::InternalSettings::setTextAutosizingEnabled):
+ (WebCore):
+ (WebCore::InternalSettings::setTextAutosizingWindowSizeOverride):
+ * testing/InternalSettings.h:
+ (InternalSettings):
+ * testing/InternalSettings.idl:
+
2012-07-04 Andrey Kosyakov <[email protected]>
Web Inspector: timeline events in the vicinity of event dividers some times are tricky to expand
Modified: trunk/Source/WebCore/page/Settings.cpp (121906 => 121907)
--- trunk/Source/WebCore/page/Settings.cpp 2012-07-05 15:27:26 UTC (rev 121906)
+++ trunk/Source/WebCore/page/Settings.cpp 2012-07-05 15:38:10 UTC (rev 121907)
@@ -139,8 +139,13 @@
, m_editingBehaviorType(editingBehaviorTypeForPlatform())
, m_maximumHTMLParserDOMTreeDepth(defaultMaximumHTMLParserDOMTreeDepth)
#if ENABLE(TEXT_AUTOSIZING)
+#if HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP
+ , m_textAutosizingWindowSizeOverride(320, 480)
, m_textAutosizingEnabled(true)
+#else
+ , m_textAutosizingEnabled(false)
#endif
+#endif
, m_isSpatialNavigationEnabled(false)
, m_isJavaEnabled(false)
, m_isJavaEnabledForLocalFiles(true)
@@ -414,6 +419,15 @@
m_textAutosizingEnabled = textAutosizingEnabled;
m_page->setNeedsRecalcStyleInAllFrames();
}
+
+void Settings::setTextAutosizingWindowSizeOverride(const IntSize& textAutosizingWindowSizeOverride)
+{
+ if (m_textAutosizingWindowSizeOverride == textAutosizingWindowSizeOverride)
+ return;
+
+ m_textAutosizingWindowSizeOverride = textAutosizingWindowSizeOverride;
+ m_page->setNeedsRecalcStyleInAllFrames();
+}
#endif
void Settings::setLoadsImagesAutomatically(bool loadsImagesAutomatically)
Modified: trunk/Source/WebCore/page/Settings.h (121906 => 121907)
--- trunk/Source/WebCore/page/Settings.h 2012-07-05 15:27:26 UTC (rev 121906)
+++ trunk/Source/WebCore/page/Settings.h 2012-07-05 15:38:10 UTC (rev 121907)
@@ -36,6 +36,10 @@
#include <wtf/text/AtomicStringHash.h>
#include <wtf/unicode/Unicode.h>
+#if ENABLE(TEXT_AUTOSIZING)
+#include "IntSize.h"
+#endif
+
namespace WebCore {
class Page;
@@ -106,6 +110,10 @@
#if ENABLE(TEXT_AUTOSIZING)
void setTextAutosizingEnabled(bool);
bool textAutosizingEnabled() const { return m_textAutosizingEnabled; }
+
+ // Only set by Layout Tests, and only used if textAutosizingEnabled() returns true.
+ void setTextAutosizingWindowSizeOverride(const IntSize&);
+ const IntSize& textAutosizingWindowSizeOverride() const { return m_textAutosizingWindowSizeOverride; }
#endif
// Unlike areImagesEnabled, this only suppresses the network load of
@@ -634,6 +642,7 @@
unsigned m_editingBehaviorType;
unsigned m_maximumHTMLParserDOMTreeDepth;
#if ENABLE(TEXT_AUTOSIZING)
+ IntSize m_textAutosizingWindowSizeOverride;
bool m_textAutosizingEnabled : 1;
#endif
bool m_isSpatialNavigationEnabled : 1;
Modified: trunk/Source/WebCore/rendering/TextAutosizer.cpp (121906 => 121907)
--- trunk/Source/WebCore/rendering/TextAutosizer.cpp 2012-07-05 15:27:26 UTC (rev 121906)
+++ trunk/Source/WebCore/rendering/TextAutosizer.cpp 2012-07-05 15:38:10 UTC (rev 121907)
@@ -49,13 +49,12 @@
if (!m_document->settings() || !m_document->settings()->textAutosizingEnabled() || layoutRoot->view()->printing() || !m_document->page())
return false;
-#ifdef HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP
- IntSize windowSize(320, 480);
-#else
- Frame* mainFrame = m_document->page()->mainFrame();
- bool includeScrollbars = !InspectorInstrumentation::shouldApplyScreenWidthOverride(mainFrame);
- IntSize windowSize = mainFrame->view()->visibleContentRect(includeScrollbars).size(); // FIXME: Check that this is always in logical (density-independent) pixels (see wkbug.com/87440).
-#endif
+ IntSize windowSize = m_document->settings()->textAutosizingWindowSizeOverride();
+ if (windowSize.isEmpty()) {
+ Frame* mainFrame = m_document->page()->mainFrame();
+ bool includeScrollbars = !InspectorInstrumentation::shouldApplyScreenWidthOverride(mainFrame);
+ windowSize = mainFrame->view()->visibleContentRect(includeScrollbars).size(); // FIXME: Check that this is always in logical (density-independent) pixels (see wkbug.com/87440).
+ }
for (RenderObject* descendant = traverseNext(layoutRoot, layoutRoot); descendant; descendant = traverseNext(descendant, layoutRoot)) {
if (!treatAsInline(descendant))
Modified: trunk/Source/WebCore/testing/InternalSettings.cpp (121906 => 121907)
--- trunk/Source/WebCore/testing/InternalSettings.cpp 2012-07-05 15:27:26 UTC (rev 121906)
+++ trunk/Source/WebCore/testing/InternalSettings.cpp 2012-07-05 15:38:10 UTC (rev 121907)
@@ -107,6 +107,10 @@
, m_originalWindowFocusRestricted(settings()->windowFocusRestricted())
, m_originalDeviceSupportsTouch(settings()->deviceSupportsTouch())
, m_originalDeviceSupportsMouse(settings()->deviceSupportsMouse())
+#if ENABLE(TEXT_AUTOSIZING)
+ , m_originalTextAutosizingEnabled(settings()->textAutosizingEnabled())
+ , m_originalTextAutosizingWindowSizeOverride(settings()->textAutosizingWindowSizeOverride())
+#endif
{
}
@@ -128,6 +132,10 @@
settings->setWindowFocusRestricted(m_originalWindowFocusRestricted);
settings->setDeviceSupportsTouch(m_originalDeviceSupportsTouch);
settings->setDeviceSupportsMouse(m_originalDeviceSupportsMouse);
+#if ENABLE(TEXT_AUTOSIZING)
+ settings->setTextAutosizingEnabled(m_originalTextAutosizingEnabled);
+ settings->setTextAutosizingWindowSizeOverride(m_originalTextAutosizingWindowSizeOverride);
+#endif
}
Settings* InternalSettings::settings() const
@@ -320,6 +328,29 @@
setFontFamily(settings(), family, script, &Settings::setPictographFontFamily);
}
+void InternalSettings::setTextAutosizingEnabled(bool enabled, ExceptionCode& ec)
+{
+#if ENABLE(TEXT_AUTOSIZING)
+ InternalSettingsGuardForSettings();
+ settings()->setTextAutosizingEnabled(enabled);
+#else
+ UNUSED_PARAM(enabled);
+ UNUSED_PARAM(ec);
+#endif
+}
+
+void InternalSettings::setTextAutosizingWindowSizeOverride(int width, int height, ExceptionCode& ec)
+{
+#if ENABLE(TEXT_AUTOSIZING)
+ InternalSettingsGuardForSettings();
+ settings()->setTextAutosizingWindowSizeOverride(IntSize(width, height));
+#else
+ UNUSED_PARAM(width);
+ UNUSED_PARAM(height);
+ UNUSED_PARAM(ec);
+#endif
+}
+
void InternalSettings::setEnableScrollAnimator(bool enabled, ExceptionCode& ec)
{
#if ENABLE(SMOOTH_SCROLLING)
Modified: trunk/Source/WebCore/testing/InternalSettings.h (121906 => 121907)
--- trunk/Source/WebCore/testing/InternalSettings.h 2012-07-05 15:27:26 UTC (rev 121906)
+++ trunk/Source/WebCore/testing/InternalSettings.h 2012-07-05 15:38:10 UTC (rev 121907)
@@ -32,6 +32,10 @@
#include <wtf/RefCounted.h>
#include <wtf/text/WTFString.h>
+#if ENABLE(TEXT_AUTOSIZING)
+#include "IntSize.h"
+#endif
+
namespace WebCore {
typedef int ExceptionCode;
@@ -72,6 +76,8 @@
void setCursiveFontFamily(const String& family, const String& script, ExceptionCode&);
void setFantasyFontFamily(const String& family, const String& script, ExceptionCode&);
void setPictographFontFamily(const String& family, const String& script, ExceptionCode&);
+ void setTextAutosizingEnabled(bool enabled, ExceptionCode&);
+ void setTextAutosizingWindowSizeOverride(int width, int height, ExceptionCode&);
void setEnableScrollAnimator(bool enabled, ExceptionCode&);
bool scrollAnimatorEnabled(ExceptionCode&);
void setCSSExclusionsEnabled(bool enabled, ExceptionCode&);
@@ -109,6 +115,10 @@
bool m_originalWindowFocusRestricted;
bool m_originalDeviceSupportsTouch;
bool m_originalDeviceSupportsMouse;
+#if ENABLE(TEXT_AUTOSIZING)
+ bool m_originalTextAutosizingEnabled;
+ IntSize m_originalTextAutosizingWindowSizeOverride;
+#endif
};
} // namespace WebCore
Modified: trunk/Source/WebCore/testing/InternalSettings.idl (121906 => 121907)
--- trunk/Source/WebCore/testing/InternalSettings.idl 2012-07-05 15:27:26 UTC (rev 121906)
+++ trunk/Source/WebCore/testing/InternalSettings.idl 2012-07-05 15:38:10 UTC (rev 121907)
@@ -51,6 +51,8 @@
void setCursiveFontFamily(in DOMString family, in DOMString script) raises(DOMException);
void setFantasyFontFamily(in DOMString family, in DOMString script) raises(DOMException);
void setPictographFontFamily(in DOMString family, in DOMString script) raises(DOMException);
+ void setTextAutosizingEnabled(in boolean enabled) raises(DOMException);
+ void setTextAutosizingWindowSizeOverride(in long width, in long height) raises(DOMException);
void setEnableScrollAnimator(in boolean enabled) raises(DOMException);
boolean scrollAnimatorEnabled() raises(DOMException);
void setCSSExclusionsEnabled(in boolean enabled) raises(DOMException);
Modified: trunk/Source/WebKit/chromium/ChangeLog (121906 => 121907)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-07-05 15:27:26 UTC (rev 121906)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-07-05 15:38:10 UTC (rev 121907)
@@ -1,3 +1,16 @@
+2012-07-05 John Mellor <[email protected]>
+
+ Text Autosizing: Add test framework and simple test.
+ https://bugs.webkit.org/show_bug.cgi?id=90561
+
+ ENABLE(TEXT_AUTOSIZING) is now on in Chromium (but disabled at runtime).
+ This allows it to be used in Layout Tests (and in future by Web
+ Inspector's mobile device emulation).
+
+ Reviewed by Adam Barth.
+
+ * features.gypi:
+
2012-07-05 Oli Lan <[email protected]>
[chromium] Add a method didChangeFormState to WebViewClient.
Modified: trunk/Source/WebKit/chromium/features.gypi (121906 => 121907)
--- trunk/Source/WebKit/chromium/features.gypi 2012-07-05 15:27:26 UTC (rev 121906)
+++ trunk/Source/WebKit/chromium/features.gypi 2012-07-05 15:38:10 UTC (rev 121907)
@@ -92,6 +92,7 @@
'ENABLE_STYLE_SCOPED=1',
'ENABLE_SVG=<(enable_svg)',
'ENABLE_SVG_FONTS=<(enable_svg)',
+ 'ENABLE_TEXT_AUTOSIZING=1',
'ENABLE_TOUCH_ADJUSTMENT=1',
'ENABLE_TOUCH_EVENTS=<(enable_touch_events)',
'ENABLE_TOUCH_ICON_LOADING=<(enable_touch_icon_loading)',
@@ -153,7 +154,6 @@
# FIXME: Disable once the linking error has been resolved.
# https://bugs.webkit.org/show_bug.cgi?id=88636
'ENABLE_SHARED_WORKERS=1',
- 'ENABLE_TEXT_AUTOSIZING=1',
'ENABLE_WEB_AUDIO=0',
'WTF_USE_NATIVE_FULLSCREEN_VIDEO=1',
],
@@ -172,7 +172,6 @@
'ENABLE_OVERFLOW_SCROLLING=0',
'ENABLE_PAGE_POPUP=1',
'ENABLE_SHARED_WORKERS=1',
- 'ENABLE_TEXT_AUTOSIZING=0',
'ENABLE_WEB_AUDIO=1',
],
}],