Bug 57290 - Make validation message bubble testable
Summary: Make validation message bubble testable
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 57308
Blocks: 57426
  Show dependency treegraph
 
Reported: 2011-03-28 18:07 PDT by Kent Tamura
Modified: 2011-03-29 23:51 PDT (History)
1 user (show)

See Also:


Attachments
Patch (40.41 KB, patch)
2011-03-29 19:09 PDT, Kent Tamura
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Tamura 2011-03-28 18:07:36 PDT
Validation message bubble is not testable for now because it disappears automatically in some seconds.
We need to have a way to test it.

a) Disable the timer if DumpRenderTree is running
  Does every port have a flag like Chromium's WebKit::layoutTestMode() ?

b) Add a LayoutTestController method, like layoutTestController.setValidationMessagePresentingDuration(int minusValueMeansInfinity)
...
Comment 1 Kent Tamura 2011-03-29 19:09:07 PDT
Created attachment 87451 [details]
Patch
Comment 2 Dimitri Glazkov (Google) 2011-03-29 19:12:40 PDT
Comment on attachment 87451 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=87451&action=review

> Source/WebCore/html/ValidationMessage.cpp:103
> +    int magnification = doc->page() ? doc->page()->settings()->validationMessageTimerMaginification() : -1;
> +    if (magnification <= 0)
> +        m_timer.clear();
> +    else {
> +        m_timer.set(new Timer<ValidationMessage>(this, &ValidationMessage::deleteBubbleTree));
> +        m_timer->startOneShot(max(5.0, static_cast<double>(m_message.length()) * magnification / 1000));
> +    }

Why do we need the concept of magnification? Can it just be N seconds or indefinite switch?
Comment 3 Kent Tamura 2011-03-29 19:28:21 PDT
Comment on attachment 87451 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=87451&action=review

>> Source/WebCore/html/ValidationMessage.cpp:103
>> +    }
> 
> Why do we need the concept of magnification? Can it just be N seconds or indefinite switch?

"Just N seconds" won't work well because a page author can specify very long validation messages and a user might be unable to read it in N seconds.

I was not confident that length() / 20.0 in the original code was always reasonable in any language and I'd like to provide a way to configure the magnification. But the indefinite switch may be enough.
Comment 4 Dimitri Glazkov (Google) 2011-03-29 19:30:49 PDT
Comment on attachment 87451 [details]
Patch

ok.
Comment 5 Kent Tamura 2011-03-29 21:14:59 PDT
Comment on attachment 87451 [details]
Patch

Clearing flags on attachment: 87451

Committed r82386: <http://trac.webkit.org/changeset/82386>
Comment 6 Kent Tamura 2011-03-29 21:15:05 PDT
All reviewed patches have been landed.  Closing bug.