Changeset 82386 in webkit


Ignore:
Timestamp:
Mar 29, 2011 9:14:46 PM (13 years ago)
Author:
tkent@chromium.org
Message:

2011-03-29 Kent Tamura <tkent@chromium.org>

Reviewed by Dimitri Glazkov.

Make validation message bubble testable
https://bugs.webkit.org/show_bug.cgi?id=57290

Add a new test for validation message bubble, and skip it on non-Mac platforms.

  • fast/forms/validation-message-appearance.html: Added.
  • platform/chromium/test_expectations.txt:
  • platform/gtk/Skipped:
  • platform/mac/fast/forms/validation-message-appearance-expected.checksum: Added.
  • platform/mac/fast/forms/validation-message-appearance-expected.png: Added.
  • platform/mac/fast/forms/validation-message-appearance-expected.txt: Added.
  • platform/qt/Skipped:
  • platform/win/Skipped:

2011-03-29 Kent Tamura <tkent@chromium.org>

Reviewed by Dimitri Glazkov.

Make validation message bubble testable
https://bugs.webkit.org/show_bug.cgi?id=57290

Introduce a setting for validation message timer so that we can configure
how long we show a validation message bubble.

Test: fast/forms/validation-message-appearance.html

  • html/ValidationMessage.cpp: (WebCore::ValidationMessage::setMessageDOMAndStartTimer): Don't set a timer if the timer magnification value is 0 or negative. Otherwise, hides the bubble length * magnification / 1000 seconds.
  • page/Settings.cpp: (WebCore::Settings::Settings): Initialize the timer magnification value.
  • page/Settings.h: (WebCore::Settings::setValidationMessageTimerMagnification): Added. (WebCore::Settings::validationMessageTimerMaginification): Added.

2011-03-29 Kent Tamura <tkent@chromium.org>

Reviewed by Dimitri Glazkov.

Make validation message bubble testable
https://bugs.webkit.org/show_bug.cgi?id=57290

  • WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): Copy the private value of the timer magnification to WebCore::Settings. (-[WebView validationMessageTimerMagnification]): Added. (-[WebView setValidationMessageTimerMagnification:]): Added.
  • WebView/WebViewData.h: Declare a member for the timer magnification.
  • WebView/WebViewData.mm: (-[WebViewPrivate init]): Initialize the timer magnification.
  • WebView/WebViewPrivate.h: Declare a setter and a getter for the timer magnification.

2011-03-29 Kent Tamura <tkent@chromium.org>

Reviewed by Dimitri Glazkov.

Make validation message bubble testable
https://bugs.webkit.org/show_bug.cgi?id=57290

  • DumpRenderTree/mac/DumpRenderTree.mm: (createWebViewAndOffscreenWindow): Change a setting so that validation bubbles isn't hidden automatically.
Location:
trunk
Files:
4 added
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r82384 r82386  
     12011-03-29  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Dimitri Glazkov.
     4
     5        Make validation message bubble testable
     6        https://bugs.webkit.org/show_bug.cgi?id=57290
     7
     8        Add a new test for validation message bubble, and skip it on non-Mac platforms.
     9
     10        * fast/forms/validation-message-appearance.html: Added.
     11        * platform/chromium/test_expectations.txt:
     12        * platform/gtk/Skipped:
     13        * platform/mac/fast/forms/validation-message-appearance-expected.checksum: Added.
     14        * platform/mac/fast/forms/validation-message-appearance-expected.png: Added.
     15        * platform/mac/fast/forms/validation-message-appearance-expected.txt: Added.
     16        * platform/qt/Skipped:
     17        * platform/win/Skipped:
     18
    1192011-03-29  Adam Barth  <abarth@webkit.org>
    220
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r82384 r82386  
    778778// The feature was disabled due to a compatibility issue.
    779779BUGWK40520 : fast/forms/interactive-validation-lost-focusable.html = TEXT
     780// Needs to call Settings::setValidationMessageTimerMagnification(-1).
     781BUGWK57290 : fast/forms/validation-message-appearance.html = PASS FAIL
    780782
    781783// These tests need to be changed to be platform independent.
  • trunk/LayoutTests/platform/gtk/Skipped

    r82342 r82386  
    11281128fast/forms/interactive-validation-select-crash.html
    11291129fast/forms/interactive-validation-crash-by-style-override.html
     1130fast/forms/validation-message-appearance.html
    11301131
    11311132# Tests that seem to be Mac only, assume that smart drag-and-drop
  • trunk/LayoutTests/platform/qt/Skipped

    r82346 r82386  
    30273027fast/forms/interactive-validation-select-crash.html
    30283028fast/forms/interactive-validation-crash-by-style-override.html
     3029fast/forms/validation-message-appearance.html
    30293030
    30303031# [Qt] REGRESSION(63862): animations/play-state.html fails intermittently
  • trunk/LayoutTests/platform/win/Skipped

    r82342 r82386  
    10711071fast/forms/interactive-validation-select-crash.html
    10721072fast/forms/interactive-validation-crash-by-style-override.html
     1073fast/forms/validation-message-appearance.html
    10731074
    10741075# Web Timing is not enabled.
  • trunk/Source/WebCore/ChangeLog

    r82385 r82386  
     12011-03-29  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Dimitri Glazkov.
     4
     5        Make validation message bubble testable
     6        https://bugs.webkit.org/show_bug.cgi?id=57290
     7
     8        Introduce a setting for validation message timer so that we can configure
     9        how long we show a validation message bubble.
     10
     11        Test: fast/forms/validation-message-appearance.html
     12
     13        * html/ValidationMessage.cpp:
     14        (WebCore::ValidationMessage::setMessageDOMAndStartTimer):
     15          Don't set a timer if the timer magnification value is 0 or negative.
     16          Otherwise, hides the bubble length * magnification / 1000 seconds.
     17        * page/Settings.cpp:
     18        (WebCore::Settings::Settings): Initialize the timer magnification value.
     19        * page/Settings.h:
     20        (WebCore::Settings::setValidationMessageTimerMagnification): Added.
     21        (WebCore::Settings::validationMessageTimerMaginification): Added.
     22
    1232011-03-29  Dimitri Glazkov  <dglazkov@chromium.org>
    224
  • trunk/Source/WebCore/html/ValidationMessage.cpp

    r82180 r82386  
    3838#include "HTMLBRElement.h"
    3939#include "HTMLNames.h"
     40#include "Page.h"
    4041#include "RenderObject.h"
     42#include "Settings.h"
    4143#include "Text.h"
    4244#include <wtf/PassOwnPtr.h>
     
    9395    }
    9496
    95     m_timer.set(new Timer<ValidationMessage>(this, &ValidationMessage::deleteBubbleTree));
    96     m_timer->startOneShot(max(5.0, m_message.length() / 20.0));
     97    int magnification = doc->page() ? doc->page()->settings()->validationMessageTimerMaginification() : -1;
     98    if (magnification <= 0)
     99        m_timer.clear();
     100    else {
     101        m_timer.set(new Timer<ValidationMessage>(this, &ValidationMessage::deleteBubbleTree));
     102        m_timer->startOneShot(max(5.0, static_cast<double>(m_message.length()) * magnification / 1000));
     103    }
    97104}
    98105
  • trunk/Source/WebCore/page/Settings.cpp

    r82171 r82386  
    8989    , m_defaultFontSize(0)
    9090    , m_defaultFixedFontSize(0)
     91    , m_validationMessageTimerMagnification(50)
    9192    , m_maximumDecodedImageSize(numeric_limits<size_t>::max())
    9293#if ENABLE(DOM_STORAGE)
  • trunk/Source/WebCore/page/Settings.h

    r81635 r82386  
    363363        void setInteractiveFormValidationEnabled(bool flag) { m_interactiveFormValidation = flag; }
    364364        bool interactiveFormValidationEnabled() const { return m_interactiveFormValidation; }
     365
     366        // Sets the maginication value for validation message timer.
     367        // If the maginication value is N, a validation message disappears
     368        // automatically after <message length> * N / 1000 seconds. If N is
     369        // equal to or less than 0, a validation message doesn't disappears
     370        // automaticaly. The default value is 50.
     371        void setValidationMessageTimerMagnification(int newValue) { m_validationMessageTimerMagnification = newValue; }
     372        int validationMessageTimerMaginification() const { return m_validationMessageTimerMagnification; }
    365373       
    366374        void setUsePreHTML5ParserQuirks(bool flag) { m_usePreHTML5ParserQuirks = flag; }
     
    398406        int m_defaultFontSize;
    399407        int m_defaultFixedFontSize;
     408        int m_validationMessageTimerMagnification;
    400409        size_t m_maximumDecodedImageSize;
    401410#if ENABLE(DOM_STORAGE)
  • trunk/Source/WebKit/mac/ChangeLog

    r82377 r82386  
     12011-03-29  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Dimitri Glazkov.
     4
     5        Make validation message bubble testable
     6        https://bugs.webkit.org/show_bug.cgi?id=57290
     7
     8        * WebView/WebView.mm:
     9        (-[WebView _preferencesChangedNotification:]): Copy the private value of
     10          the timer magnification to WebCore::Settings.
     11        (-[WebView validationMessageTimerMagnification]): Added.
     12        (-[WebView setValidationMessageTimerMagnification:]): Added.
     13        * WebView/WebViewData.h: Declare a member for the timer magnification.
     14        * WebView/WebViewData.mm:
     15        (-[WebViewPrivate init]): Initialize the timer magnification.
     16        * WebView/WebViewPrivate.h:
     17          Declare a setter and a getter for the timer magnification.
     18
    1192011-03-29  Kent Tamura  <tkent@chromium.org>
    220
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r82377 r82386  
    15221522    settings->setCrossOriginCheckInGetMatchedCSSRulesDisabled([self _needsUnrestrictedGetMatchedCSSRules]);
    15231523    settings->setInteractiveFormValidationEnabled([self interactiveFormValidationEnabled]);
     1524    settings->setValidationMessageTimerMagnification([self validationMessageTimerMagnification]);
    15241525
    15251526    // Application Cache Preferences are stored on the global cache storage manager, not in Settings.
     
    24142415{
    24152416    _private->interactiveFormValidationEnabled = enabled;
     2417}
     2418
     2419- (int)validationMessageTimerMagnification
     2420{
     2421    return _private->validationMessageTimerMagnification;
     2422}
     2423
     2424- (void)setValidationMessageTimerMagnification:(int)newValue
     2425{
     2426    _private->validationMessageTimerMagnification = newValue;
    24162427}
    24172428
  • trunk/Source/WebKit/mac/WebView/WebViewData.h

    r82377 r82386  
    189189
    190190    BOOL interactiveFormValidationEnabled;
     191    int validationMessageTimerMagnification;
    191192}
    192193@end
  • trunk/Source/WebKit/mac/WebView/WebViewData.mm

    r82377 r82386  
    6767
    6868    interactiveFormValidationEnabled = NO;
     69    // The default value should be synchronized with WebCore/page/Settings.cpp.
     70    validationMessageTimerMagnification = 50;
    6971
    7072#if ENABLE(DASHBOARD_SUPPORT)
  • trunk/Source/WebKit/mac/WebView/WebViewPrivate.h

    r82377 r82386  
    491491- (BOOL)interactiveFormValidationEnabled;
    492492- (void)setInteractiveFormValidationEnabled:(BOOL)enabled;
     493- (int)validationMessageTimerMagnification;
     494- (void)setValidationMessageTimerMagnification:(int)newValue;
    493495
    494496// Returns YES if NSView -displayRectIgnoringOpacity:inContext: will produce a faithful representation of the content.
  • trunk/Tools/ChangeLog

    r82383 r82386  
     12011-03-29  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Dimitri Glazkov.
     4
     5        Make validation message bubble testable
     6        https://bugs.webkit.org/show_bug.cgi?id=57290
     7
     8        * DumpRenderTree/mac/DumpRenderTree.mm:
     9        (createWebViewAndOffscreenWindow): Change a setting so that validation
     10          bubbles isn't hidden automatically.
     11
    1122011-03-29  Dirk Pranke  <dpranke@chromium.org>
    213
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r82377 r82386  
    309309    [webView setGrammarCheckingEnabled:YES];
    310310    [webView setInteractiveFormValidationEnabled:YES];
     311    [webView setValidationMessageTimerMagnification:-1];
    311312   
    312313    // To make things like certain NSViews, dragging, and plug-ins work, put the WebView a window, but put it off-screen so you don't see it.
Note: See TracChangeset for help on using the changeset viewer.