Changeset 86224 in webkit


Ignore:
Timestamp:
May 11, 2011 2:11:36 AM (13 years ago)
Author:
tkent@chromium.org
Message:

2011-05-11 Kent Tamura <tkent@chromium.org>

Reviewed by Hajime Morita.

The position of validation message bubble is wrong for non text fields.
https://bugs.webkit.org/show_bug.cgi?id=60341

  • fast/forms/resources/common.js: Added. Helper functions for fast/forms.
  • fast/forms/validation-message-on-checkbox-expected.txt: Added.
  • fast/forms/validation-message-on-checkbox.html: Added.
  • fast/forms/validation-message-on-listbox-expected.txt: Added.
  • fast/forms/validation-message-on-listbox.html: Added.
  • fast/forms/validation-message-on-menulist-expected.txt: Added.
  • fast/forms/validation-message-on-menulist.html: Added.
  • fast/forms/validation-message-on-radio-expected.txt: Added.
  • fast/forms/validation-message-on-radio.html: Added.
  • fast/forms/validation-message-on-textarea-expected.txt: Added.
  • fast/forms/validation-message-on-textarea.html: Added.
  • platform/chromium/test_expectations.txt:
  • platform/gtk/Skipped:
  • platform/mac/fast/forms/validation-message-appearance-expected.png: Updated.
  • platform/mac/fast/forms/validation-message-appearance-expected.txt: Updated.
  • platform/qt/Skipped:
  • platform/win/Skipped:

2011-05-11 Kent Tamura <tkent@chromium.org>

Reviewed by Hajime Morita.

The position of validation message bubble is wrong for non text fields.
https://bugs.webkit.org/show_bug.cgi?id=60341

Tests: fast/forms/validation-message-on-checkbox.html

fast/forms/validation-message-on-listbox.html
fast/forms/validation-message-on-menulist.html
fast/forms/validation-message-on-radio.html
fast/forms/validation-message-on-textarea.html

  • css/html.css: (::-webkit-validation-bubble-message): Add white-space:normal in order not to inherit white-space:pre for <select>.
  • html/ValidationMessage.cpp: (WebCore::adjustBubblePosition): Adjust the bubble position.
    • The top of the bubble should be same as the bottom of the target control.
    • The left of the bubble should be same as the left of the target control. But If the left+32 is larger than the center of the target control, left+32 should be at the center of the target control. But the left position should not be less than 0.

(WebCore::ValidationMessage::buildBubbleTree): Call adjustBubblePosition().

Location:
trunk
Files:
11 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r86221 r86224  
     12011-05-11  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Hajime Morita.
     4
     5        The position of validation message bubble is wrong for non text fields.
     6        https://bugs.webkit.org/show_bug.cgi?id=60341
     7
     8        * fast/forms/resources/common.js: Added. Helper functions for fast/forms.
     9        * fast/forms/validation-message-on-checkbox-expected.txt: Added.
     10        * fast/forms/validation-message-on-checkbox.html: Added.
     11        * fast/forms/validation-message-on-listbox-expected.txt: Added.
     12        * fast/forms/validation-message-on-listbox.html: Added.
     13        * fast/forms/validation-message-on-menulist-expected.txt: Added.
     14        * fast/forms/validation-message-on-menulist.html: Added.
     15        * fast/forms/validation-message-on-radio-expected.txt: Added.
     16        * fast/forms/validation-message-on-radio.html: Added.
     17        * fast/forms/validation-message-on-textarea-expected.txt: Added.
     18        * fast/forms/validation-message-on-textarea.html: Added.
     19        * platform/chromium/test_expectations.txt:
     20        * platform/gtk/Skipped:
     21        * platform/mac/fast/forms/validation-message-appearance-expected.png: Updated.
     22        * platform/mac/fast/forms/validation-message-appearance-expected.txt: Updated.
     23        * platform/qt/Skipped:
     24        * platform/win/Skipped:
     25
    1262011-05-10  Yury Semikhatsky  <yurys@chromium.org>
    227
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r86204 r86224  
    39753975BUGWK59768 WIN LINUX GPU : canvas/philip/tests/2d.shadow.alpha.5.html = TEXT
    39763976
    3977 // just needs new baselines?
     3977// Need rebaseline.
     3978BUGWK60341 : fast/forms/validation-message-appearance.html = FAIL
    39783979
    39793980// flakiness on the deps bots (noted r~83476)
  • trunk/LayoutTests/platform/gtk/Skipped

    r86204 r86224  
    11401140editing/pasteboard/files-during-page-drags.html
    11411141
    1142 # The feature was disabled due to a compatibility issue.
    1143 # https://bugs.webkit.org/show_bug.cgi?id=40520
     1142# Need to call Settings::setInteractiveFormValidationEnabled(true).
    11441143fast/forms/interactive-validation-prevented.html
    11451144fast/forms/interactive-validation-attach-assertion.html
     
    11471146fast/forms/interactive-validation-select-crash.html
    11481147fast/forms/interactive-validation-crash-by-style-override.html
     1148# Need to call Settings::setValidationMessageTimerMagnification(-1) in DRT.
    11491149fast/forms/validation-message-appearance.html
     1150fast/forms/validation-message-on-checkbox.html
     1151fast/forms/validation-message-on-listbox.html
     1152fast/forms/validation-message-on-menulist.html
     1153fast/forms/validation-message-on-radio.html
     1154fast/forms/validation-message-on-textarea.html
    11501155
    11511156# Tests that seem to be Mac only, assume that smart drag-and-drop
  • trunk/LayoutTests/platform/mac/fast/forms/validation-message-appearance-expected.txt

    r82386 r86224  
    1515layer at (13,13) size 119x13
    1616  RenderBlock {DIV} at (3,3) size 119x13
    17 layer at (13,26) size 220x100
    18   RenderBlock (positioned) zI: 2147483647 {DIV} at (13,26) size 220x100
    19 layer at (13,26) size 220x16 scrollHeight 26
     17layer at (10,29) size 220x100
     18  RenderBlock (positioned) zI: 2147483647 {DIV} at (10,29) size 220x100
     19layer at (10,29) size 220x16 scrollHeight 26
    2020  RenderBlock {DIV} at (0,0) size 220x16
    21 layer at (13,38) size 220x84
     21layer at (10,41) size 220x84
    2222  RenderBlock (relative positioned) zI: 2147483644 {DIV} at (0,16) size 220x84 [border: (2px solid #440000)]
    2323    RenderInline {B} at (0,0) size 93x16
     
    3131      text run at (10,42) width 177: "Should not be identical with"
    3232      text run at (10,58) width 139: "the current password."
    33 layer at (45,26) size 18x18 backgroundClip at (13,26) size 220x16 clip at (13,26) size 220x16 outlineClip at (13,26) size 220x16
     33layer at (42,29) size 18x18 backgroundClip at (10,29) size 220x16 clip at (10,29) size 220x16 outlineClip at (10,29) size 220x16
    3434  RenderBlock (relative positioned) zI: 2147483645 {DIV} at (0,0) size 18x18 [bgcolor=#F8ECEC] [border: (2px solid #440000) none (2px solid #440000)]
    3535caret: position 0 of child 0 {DIV} of child 1 {INPUT} of child 0 {FORM} of body
  • trunk/LayoutTests/platform/qt/Skipped

    r86204 r86224  
    21712171http/tests/xmlhttprequest/remember-bad-password.html
    21722172
    2173 # The feature was disabled due to a compatibility issue.
    2174 # https://bugs.webkit.org/show_bug.cgi?id=40520
     2173# Need to call Settings::setInteractiveFormValidationEnabled(true).
    21752174fast/forms/interactive-validation-prevented.html
    21762175fast/forms/interactive-validation-attach-assertion.html
     
    21782177fast/forms/interactive-validation-select-crash.html
    21792178fast/forms/interactive-validation-crash-by-style-override.html
     2179# Need to call Settings::setValidationMessageTimerMagnification(-1) in DRT.
    21802180fast/forms/validation-message-appearance.html
     2181fast/forms/validation-message-on-checkbox.html
     2182fast/forms/validation-message-on-listbox.html
     2183fast/forms/validation-message-on-menulist.html
     2184fast/forms/validation-message-on-radio.html
     2185fast/forms/validation-message-on-textarea.html
    21812186
    21822187# [Qt] REGRESSION(63862): animations/play-state.html fails intermittently
  • trunk/LayoutTests/platform/win/Skipped

    r86047 r86224  
    10811081printing/setPrinting.html
    10821082
    1083 # The feature was disabled due to a compatibility issue.
    1084 # https://bugs.webkit.org/show_bug.cgi?id=40520
     1083# Need to call Settings::setInteractiveFormValidationEnabled(true).
    10851084fast/forms/interactive-validation-prevented.html
    10861085fast/forms/interactive-validation-attach-assertion.html
     
    10881087fast/forms/interactive-validation-select-crash.html
    10891088fast/forms/interactive-validation-crash-by-style-override.html
     1089# Need to call Settings::setValidationMessageTimerMagnification(-1) in DRT.
    10901090fast/forms/validation-message-appearance.html
     1091fast/forms/validation-message-on-checkbox.html
     1092fast/forms/validation-message-on-listbox.html
     1093fast/forms/validation-message-on-menulist.html
     1094fast/forms/validation-message-on-radio.html
     1095fast/forms/validation-message-on-textarea.html
    10911096
    10921097# Web Timing is not enabled.
  • trunk/Source/WebCore/ChangeLog

    r86222 r86224  
     12011-05-11  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Hajime Morita.
     4
     5        The position of validation message bubble is wrong for non text fields.
     6        https://bugs.webkit.org/show_bug.cgi?id=60341
     7
     8        Tests: fast/forms/validation-message-on-checkbox.html
     9               fast/forms/validation-message-on-listbox.html
     10               fast/forms/validation-message-on-menulist.html
     11               fast/forms/validation-message-on-radio.html
     12               fast/forms/validation-message-on-textarea.html
     13
     14        * css/html.css:
     15        (::-webkit-validation-bubble-message):
     16          Add white-space:normal in order not to inherit white-space:pre for <select>.
     17        * html/ValidationMessage.cpp:
     18        (WebCore::adjustBubblePosition):
     19          Adjust the bubble position.
     20          - The top of the bubble should be same as the bottom of the target control.
     21          - The left of the bubble should be same as the left of the target control.
     22            But If the left+32 is larger than the center of the target control,
     23            left+32 should be at the center of the target control.
     24            But the left position should not be less than 0.
     25        (WebCore::ValidationMessage::buildBubbleTree): Call adjustBubblePosition().
     26
    1272011-05-11  Emil A Eklund  <eae@chromium.org>
    228
  • trunk/Source/WebCore/css/html.css

    r84991 r86224  
    649649        inset 2px 2px 1px white;
    650650    line-height: normal;
     651    white-space: normal;
    651652    z-index: 2147483644;
    652653}
  • trunk/Source/WebCore/html/ValidationMessage.cpp

    r84850 r86224  
    122122};
    123123
     124static void adjustBubblePosition(const IntRect& hostRect, HTMLElement* bubble)
     125{
     126    ASSERT(bubble);
     127    if (hostRect.isEmpty())
     128        return;
     129    bubble->getInlineStyleDecl()->setProperty(CSSPropertyTop, static_cast<double>(hostRect.y() + hostRect.height()), CSSPrimitiveValue::CSS_PX);
     130    // The 'left' value of ::-webkit-validation-bubble-arrow.
     131    const int bubbleArrowTopOffset = 32;
     132    double bubbleX = hostRect.x();
     133    if (hostRect.width() / 2 < bubbleArrowTopOffset)
     134        bubbleX = max(hostRect.x() + hostRect.width() / 2 - bubbleArrowTopOffset, 0);
     135    bubble->getInlineStyleDecl()->setProperty(CSSPropertyLeft, bubbleX, CSSPrimitiveValue::CSS_PX);
     136}
     137
    124138void ValidationMessage::buildBubbleTree(Timer<ValidationMessage>*)
    125139{
     
    130144    // contains non-absolute or non-fixed renderers as children.
    131145    m_bubble->getInlineStyleDecl()->setProperty(CSSPropertyPosition, CSSValueAbsolute);
     146    adjustBubblePosition(host->getRect(), m_bubble.get());
    132147    ExceptionCode ec = 0;
    133148    host->ensureShadowRoot()->appendChild(m_bubble.get(), ec);
     
    142157
    143158    // FIXME: Use transition to show the bubble.
    144 
    145     // We don't need to adjust the bubble location. The default position is enough.
    146159}
    147160
Note: See TracChangeset for help on using the changeset viewer.