getClientRects doesn't work with list box option elements
https://bugs.webkit.org/show_bug.cgi?id=175016
Reviewed by Darin Adler.
Source/WebCore:
Since HTMLOptionElement and HTMLOptGroupElement don't have a renderer, we are always returning an empty list
from getClientRects. This is working fine in both chromium and firefox, option elements return its own bounding
box and group elements return the bounding box of the group label and all its children items.
Test: fast/dom/HTMLSelectElement/listbox-items-client-rects.html
* dom/Element.cpp:
(WebCore::listBoxElementBoundingBox): Helper function to return the bounding box of a HTMLOptionElement or
HTMLOptGroupElement element.
(WebCore::Element::getClientRects): Use listBoxElementBoundingBox() in case of HTMLOptionElement or
HTMLOptGroupElement.
(WebCore::Element::boundingClientRect): Ditto.
LayoutTests:
Add new test to check list box option elements client rects.
* fast/dom/HTMLSelectElement/listbox-items-client-rects-expected.txt: Added.
* fast/dom/HTMLSelectElement/listbox-items-client-rects.html: Added.
* platform/ios-simulator-wk2/fast/dom/HTMLSelectElement/listbox-items-client-rects-expected.txt: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220313
268f45cc-cd09-0410-ab3c-
d52691b4dbfc