Changeset 59645 in webkit
- Timestamp:
- May 17, 2010 8:57:06 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r59638 r59645 1 2010-05-17 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 ':valid' CSS selector should not be applied to some form controls 6 https://bugs.webkit.org/show_bug.cgi?id=39162 7 8 Add test cases for 9 - <input type=submit> 10 - <input type=image> 11 - <progress> 12 - <meter> 13 14 * fast/css/pseudo-valid-unapplied-expected.txt: 15 * fast/css/pseudo-valid-unapplied.html: 16 1 17 2010-05-17 Adam Barth <abarth@webkit.org> 2 18 -
trunk/LayoutTests/fast/css/pseudo-valid-unapplied-expected.txt
r59153 r59645 9 9 PASS getBackgroundColor('input-reset') is normalColor 10 10 PASS getBackgroundColor('input-hidden') is normalColor 11 PASS getBackgroundColor('input-submit') is normalColor 12 PASS getBackgroundColor('input-image') is normalColor 11 13 PASS getBackgroundColor('fieldset') is normalColor 12 14 PASS getBackgroundColor('object') is normalColor 13 15 PASS getBackgroundColor('button') is normalColor 16 PASS getBackgroundColor('progress') is normalColor 17 PASS getBackgroundColor('meter') is normalColor 14 18 PASS successfullyParsed is true 15 19 -
trunk/LayoutTests/fast/css/pseudo-valid-unapplied.html
r59153 r59645 11 11 object { background: lime; } 12 12 button { background: lime; } 13 progress { background: lime; } 14 meter { background: lime; } 13 15 </style> 14 16 </head> … … 21 23 <input name="input-reset" type="reset" value="Lorem ipsum"/> 22 24 <input name="input-hidden" type="hidden" value="Lorem ipsum"/> 25 <input name="input-submit" type="submit"> 26 <input name="input-image" type="image"> 23 27 <fieldset name="fieldset"></fieldset> 24 28 <object name="object"></object> 25 29 <button name="button">Lorem ipsum</button> 30 <progress id="progress" value=50 max=100>50</progress> 31 <meter id="meter" value=50 max=100>50</meter> 26 32 </form> 27 33 <div id="console"></div> … … 29 35 description("This test performs a check for the :valid CSS selector on various input elements and other elements where it shouldn't be applied."); 30 36 31 function getBackgroundColor(elementName) { 32 var element = document.getElementsByName(elementName)[0]; 37 function getBackgroundColor(nameOrId) { 38 var list = document.getElementsByName(nameOrId); 39 var element = list.length > 0 ? list[0] : document.getElementById(nameOrId); 33 40 return document.defaultView.getComputedStyle(element, null).getPropertyValue('background-color') 34 41 } … … 40 47 "input-reset", 41 48 "input-hidden", 49 "input-submit", 50 "input-image", 42 51 "fieldset", 43 52 "object", 44 53 "button", 54 "progress", 55 "meter", 45 56 ]; 46 57 -
trunk/WebCore/ChangeLog
r59644 r59645 1 2010-05-17 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 ':valid' CSS selector should not be applied to some form controls 6 https://bugs.webkit.org/show_bug.cgi?id=39162 7 8 * html/HTMLElement.cpp: 9 (WebCore::inlineTagList): Always includes progressTag. This change is 10 needed in a case of no ENABLE_PROGRESS_TAG. Without this change and 11 ENABLE_PROGRESS_TAG, <progress> tags disappear. 12 * html/HTMLInputElement.cpp: 13 (WebCore::HTMLInputElement::recalcWillValidate): 14 Return false for SUBMIT and IMAGE. 15 * html/HTMLProgressElement.h: 16 (WebCore::HTMLProgressElement::recalcWillValidate): 17 Return false. This change is needed in a case of ENABLE_PROGRESS_TAG. 18 1 19 2010-05-17 Adam Barth <abarth@webkit.org> 2 20 -
trunk/WebCore/html/HTMLElement.cpp
r59541 r59645 859 859 tagList.add(rtTag.localName().impl()); 860 860 tagList.add(rubyTag.localName().impl()); 861 #if ENABLE(PROGRESS_TAG)862 861 tagList.add(progressTag.localName().impl()); 863 #endif864 862 tagList.add(meterTag.localName().impl()); 865 863 } -
trunk/WebCore/html/HTMLInputElement.cpp
r59472 r59645 2635 2635 bool HTMLInputElement::recalcWillValidate() const 2636 2636 { 2637 return HTMLFormControlElementWithState::recalcWillValidate() 2638 && inputType() != HIDDEN && inputType() != BUTTON && inputType() != RESET; 2637 switch (inputType()) { 2638 case CHECKBOX: 2639 case COLOR: 2640 case DATE: 2641 case DATETIME: 2642 case DATETIMELOCAL: 2643 case EMAIL: 2644 case FILE: 2645 case ISINDEX: 2646 case MONTH: 2647 case NUMBER: 2648 case PASSWORD: 2649 case RADIO: 2650 case RANGE: 2651 case SEARCH: 2652 case TELEPHONE: 2653 case TEXT: 2654 case TIME: 2655 case URL: 2656 case WEEK: 2657 return HTMLFormControlElementWithState::recalcWillValidate(); 2658 case BUTTON: 2659 case HIDDEN: 2660 case IMAGE: 2661 case RESET: 2662 case SUBMIT: 2663 return false; 2664 } 2665 ASSERT_NOT_REACHED(); 2666 return false; 2639 2667 } 2640 2668 -
trunk/WebCore/html/HTMLProgressElement.h
r58687 r59645 42 42 HTMLProgressElement(const QualifiedName&, Document*, HTMLFormElement*); 43 43 44 virtual bool recalcWillValidate() const { return false; } 44 45 virtual bool isOptionalFormControl() const { return true; } 45 46
Note: See TracChangeset
for help on using the changeset viewer.