Changeset 124416 in webkit
- Timestamp:
- Aug 2, 2012 12:14:49 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r124415 r124416 1 2012-08-02 Yoshifumi Inoue <yosin@chromium.org> 2 3 REGRESSION(r102741): [Forms] In selects, when disabled, browser skips first option if not in optgroup, then selects first option in optgroup 4 https://bugs.webkit.org/show_bug.cgi?id=92833 5 6 Reviewed by Kent Tamura. 7 8 This patch updates test expectation of fast/forms/basic-selects.html 9 for Chromium-Linux and disables it for Chromium-Mac and Chromium-Win. 10 11 Note: We need to rebaseline for all ports expect for Chromium-Linux. 12 13 * platform/chromium-linux/fast/forms/basic-selects-expected.png: Changed for default selected option for disabled select element, "foo" to "bar" of second select element of "Line-height should be ignored" line. 14 * platform/chromium-linux/fast/forms/basic-selects-expected.txt: 15 * platform/chromium/TestExpectations: Disabled fast/forms/basic-selects.html for Chromium-Mac and Chromium-Win. 16 1 17 2012-08-02 Alexander Pavlov <apavlov@chromium.org> 2 18 -
trunk/LayoutTests/platform/chromium-linux/fast/forms/basic-selects-expected.txt
r117821 r124416 47 47 RenderMenuList {SELECT} at (237,83) size 43x20 [color=#808080] [bgcolor=#DDDDDD] [border: (1px solid #808080)] 48 48 RenderBlock (anonymous) at (1,1) size 41x18 49 RenderText at (4,1) size 1 7x1650 text run at (4,1) width 1 7: "foo"49 RenderText at (4,1) size 18x16 50 text run at (4,1) width 18: "bar" 51 51 RenderText {#text} at (282,83) size 8x19 52 52 text run at (282,83) width 8: "b" -
trunk/LayoutTests/platform/chromium/TestExpectations
r124415 r124416 3486 3486 BUGCR139493 DEBUG : media/track/track-cues-sorted-before-dispatch.html = PASS CRASH 3487 3487 3488 // Need rebaseline 3489 BUGWK92833 MAC WIN : fast/forms/basic-selects.html = IMAGE+TEXT PASS 3490 3488 3491 // Supposedly started failing between CR r140760 and CR r141216. The failures 3489 3492 // look like they involve antialiasing; the fact that the test clearly expects -
trunk/Source/WebCore/ChangeLog
r124413 r124416 1 2012-08-02 Yoshifumi Inoue <yosin@chromium.org> 2 3 REGRESSION(r102741): [Forms] In selects, when disabled, browser skips first option if not in optgroup, then selects first option in optgroup 4 https://bugs.webkit.org/show_bug.cgi?id=92833 5 6 Reviewed by Kent Tamura. 7 8 This patch changes implementation of HTMLOptionElement::disabled() to 9 follow the "disabled" concept of option element in HTML5 specification[1], 10 the option element is disabled if option element has "disabled" 11 attribute or parent optgroup element has "disabled" attribute. Before 12 this patch, HTMLOptionElement::disabled() checks presenting "disabled" 13 attribute in option element itself and any parent element. 14 15 Before this patch, HTMLSelectElement::recalcListItems() didn't considers 16 non-disabled option as default selected option if select element is 17 disabled because HTMLOptionElement::disabled() returned true if select 18 element is disabled. 19 20 After this patch, HTMLOptionElement::disabled() is independent from 21 select element. HTMLSelectElement::recalcListItems() considers 22 non-disabled option as default selected option. 23 24 [1] http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#concept-option-disabled 25 26 Tests: fast/forms/basic-selects.html: Fixed expectation to right thing. 27 28 * css/html.css: 29 (select[disabled]>option): Added to render option elements in disabled 30 select element to disabled color as before this patch. 31 * html/HTMLOptionElement.cpp: 32 (WebCore::HTMLOptionElement::disabled): Changed to check parent element 33 is optgroup. 34 * html/HTMLSelectElement.cpp: 35 (WebCore::HTMLSelectElement::listBoxDefaultEventHandler): On mouse up 36 and down, don't update selection if select element is disabled. 37 * rendering/RenderListBox.cpp: 38 (WebCore::RenderListBox::paintItemForeground): Added checking select 39 element is disabled. Before this patch, it was done by HTMLOptionElement::disabled(). 40 1 41 2012-08-01 Sheriff Bot <webkit.review.bot@gmail.com> 2 42 -
trunk/Source/WebCore/css/html.css
r124407 r124416 692 692 input[type="button"]:disabled, input[type="submit"]:disabled, input[type="reset"]:disabled, 693 693 input[type="file"]:disabled::-webkit-file-upload-button, button:disabled, 694 select:disabled, keygen:disabled, optgroup:disabled, option:disabled { 694 select:disabled, keygen:disabled, optgroup:disabled, option:disabled, 695 select[disabled]>option { 695 696 color: GrayText 696 697 } -
trunk/Source/WebCore/html/HTMLOptionElement.cpp
r123283 r124416 330 330 bool HTMLOptionElement::disabled() const 331 331 { 332 return ownElementDisabled() || (parentNode() && parentNode()->isHTMLElement() && static_cast<HTMLElement*>(parentNode())->disabled()); 332 if (ownElementDisabled()) 333 return true; 334 335 if (!parentNode() || !parentNode()->isHTMLElement()) 336 return false; 337 338 HTMLElement* parentElement = static_cast<HTMLElement*>(parentNode()); 339 return parentElement->hasTagName(optgroupTag) && parentElement->disabled(); 333 340 } 334 341 -
trunk/Source/WebCore/html/HTMLSelectElement.cpp
r122115 r124416 1293 1293 int listIndex = toRenderListBox(renderer())->listIndexAtOffset(toSize(localOffset)); 1294 1294 if (listIndex >= 0) { 1295 if (!disabled()) { 1295 1296 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) 1296 updateSelectedState(listIndex, mouseEvent->metaKey(), mouseEvent->shiftKey());1297 updateSelectedState(listIndex, mouseEvent->metaKey(), mouseEvent->shiftKey()); 1297 1298 #else 1298 updateSelectedState(listIndex, mouseEvent->ctrlKey(), mouseEvent->shiftKey());1299 updateSelectedState(listIndex, mouseEvent->ctrlKey(), mouseEvent->shiftKey()); 1299 1300 #endif 1301 } 1300 1302 if (Frame* frame = document()->frame()) 1301 1303 frame->eventHandler()->setMouseDownMayStartAutoscroll(); … … 1311 1313 int listIndex = toRenderListBox(renderer())->listIndexAtOffset(toSize(localOffset)); 1312 1314 if (listIndex >= 0) { 1313 if (m_multiple) { 1314 setActiveSelectionEndIndex(listIndex); 1315 updateListBoxSelection(false); 1316 } else { 1317 setActiveSelectionAnchorIndex(listIndex); 1318 setActiveSelectionEndIndex(listIndex); 1319 updateListBoxSelection(true); 1315 if (!disabled()) { 1316 if (m_multiple) { 1317 setActiveSelectionEndIndex(listIndex); 1318 updateListBoxSelection(false); 1319 } else { 1320 setActiveSelectionAnchorIndex(listIndex); 1321 setActiveSelectionEndIndex(listIndex); 1322 updateListBoxSelection(true); 1323 } 1320 1324 } 1321 1325 event->setDefaultHandled(); -
trunk/Source/WebCore/rendering/RenderListBox.cpp
r124389 r124416 379 379 FontCachePurgePreventer fontCachePurgePreventer; 380 380 381 const Vector<HTMLElement*>& listItems = toHTMLSelectElement(node())->listItems(); 381 HTMLSelectElement* selectElement = toHTMLSelectElement(node()); 382 383 const Vector<HTMLElement*>& listItems = selectElement->listItems(); 382 384 HTMLElement* element = listItems[listIndex]; 383 385 … … 402 404 textColor = theme()->activeListBoxSelectionForegroundColor(); 403 405 // Honor the foreground color for disabled items 404 else if (!element->disabled() )406 else if (!element->disabled() && !selectElement->disabled()) 405 407 textColor = theme()->inactiveListBoxSelectionForegroundColor(); 406 408 }
Note: See TracChangeset
for help on using the changeset viewer.