OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
3 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 3 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 | 299 |
300 if (paintInfo.phase == PaintPhaseForeground) { | 300 if (paintInfo.phase == PaintPhaseForeground) { |
301 int index = m_indexOffset; | 301 int index = m_indexOffset; |
302 while (index < listItemsSize && index <= m_indexOffset + numVisibleItems
()) { | 302 while (index < listItemsSize && index <= m_indexOffset + numVisibleItems
()) { |
303 paintItemForeground(paintInfo, paintOffset, index); | 303 paintItemForeground(paintInfo, paintOffset, index); |
304 index++; | 304 index++; |
305 } | 305 } |
306 } | 306 } |
307 | 307 |
308 // Paint the children. | 308 // Paint the children. |
309 RenderBlock::paintObject(paintInfo, paintOffset); | 309 RenderBlockFlow::paintObject(paintInfo, paintOffset); |
310 | 310 |
311 switch (paintInfo.phase) { | 311 switch (paintInfo.phase) { |
312 // Depending on whether we have overlay scrollbars they | 312 // Depending on whether we have overlay scrollbars they |
313 // get rendered in the foreground or background phases | 313 // get rendered in the foreground or background phases |
314 case PaintPhaseForeground: | 314 case PaintPhaseForeground: |
315 if (m_vBar->isOverlayScrollbar()) | 315 if (m_vBar->isOverlayScrollbar()) |
316 paintScrollbar(paintInfo, paintOffset); | 316 paintScrollbar(paintInfo, paintOffset); |
317 break; | 317 break; |
318 case PaintPhaseBlockBackground: | 318 case PaintPhaseBlockBackground: |
319 if (!m_vBar->isOverlayScrollbar()) | 319 if (!m_vBar->isOverlayScrollbar()) |
320 paintScrollbar(paintInfo, paintOffset); | 320 paintScrollbar(paintInfo, paintOffset); |
321 break; | 321 break; |
322 case PaintPhaseChildBlockBackground: | 322 case PaintPhaseChildBlockBackground: |
323 case PaintPhaseChildBlockBackgrounds: { | 323 case PaintPhaseChildBlockBackgrounds: { |
324 int index = m_indexOffset; | 324 int index = m_indexOffset; |
325 while (index < listItemsSize && index <= m_indexOffset + numVisibleItems
()) { | 325 while (index < listItemsSize && index <= m_indexOffset + numVisibleItems
()) { |
326 paintItemBackground(paintInfo, paintOffset, index); | 326 paintItemBackground(paintInfo, paintOffset, index); |
327 index++; | 327 index++; |
328 } | 328 } |
329 break; | 329 break; |
330 } | 330 } |
331 default: | 331 default: |
332 break; | 332 break; |
333 } | 333 } |
334 } | 334 } |
335 | 335 |
336 void RenderListBox::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint&
additionalOffset, const RenderLayerModelObject* paintContainer) | 336 void RenderListBox::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint&
additionalOffset, const RenderLayerModelObject* paintContainer) |
337 { | 337 { |
338 if (!isSpatialNavigationEnabled(frame())) | 338 if (!isSpatialNavigationEnabled(frame())) |
339 return RenderBlock::addFocusRingRects(rects, additionalOffset, paintCont
ainer); | 339 return RenderBlockFlow::addFocusRingRects(rects, additionalOffset, paint
Container); |
340 | 340 |
341 HTMLSelectElement* select = selectElement(); | 341 HTMLSelectElement* select = selectElement(); |
342 | 342 |
343 // Focus the last selected item. | 343 // Focus the last selected item. |
344 int selectedItem = select->activeSelectionEndListIndex(); | 344 int selectedItem = select->activeSelectionEndListIndex(); |
345 if (selectedItem >= 0) { | 345 if (selectedItem >= 0) { |
346 rects.append(pixelSnappedIntRect(itemBoundingBoxRect(additionalOffset, s
electedItem))); | 346 rects.append(pixelSnappedIntRect(itemBoundingBoxRect(additionalOffset, s
electedItem))); |
347 return; | 347 return; |
348 } | 348 } |
349 | 349 |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 // Determine an index and scroll to it. | 711 // Determine an index and scroll to it. |
712 int index = newTop / itemHeight(); | 712 int index = newTop / itemHeight(); |
713 if (index < 0 || index >= numItems() || index == m_indexOffset) | 713 if (index < 0 || index >= numItems() || index == m_indexOffset) |
714 return; | 714 return; |
715 | 715 |
716 scrollToOffsetWithoutAnimation(VerticalScrollbar, index); | 716 scrollToOffsetWithoutAnimation(VerticalScrollbar, index); |
717 } | 717 } |
718 | 718 |
719 bool RenderListBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re
sult, const HitTestLocation& locationInContainer, const LayoutPoint& accumulated
Offset, HitTestAction hitTestAction) | 719 bool RenderListBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re
sult, const HitTestLocation& locationInContainer, const LayoutPoint& accumulated
Offset, HitTestAction hitTestAction) |
720 { | 720 { |
721 if (!RenderBlock::nodeAtPoint(request, result, locationInContainer, accumula
tedOffset, hitTestAction)) | 721 if (!RenderBlockFlow::nodeAtPoint(request, result, locationInContainer, accu
mulatedOffset, hitTestAction)) |
722 return false; | 722 return false; |
723 const Vector<HTMLElement*>& listItems = selectElement()->listItems(); | 723 const Vector<HTMLElement*>& listItems = selectElement()->listItems(); |
724 int size = numItems(); | 724 int size = numItems(); |
725 LayoutPoint adjustedLocation = accumulatedOffset + location(); | 725 LayoutPoint adjustedLocation = accumulatedOffset + location(); |
726 | 726 |
727 for (int i = 0; i < size; ++i) { | 727 for (int i = 0; i < size; ++i) { |
728 if (itemBoundingBoxRect(adjustedLocation, i).contains(locationInContaine
r.point())) { | 728 if (itemBoundingBoxRect(adjustedLocation, i).contains(locationInContaine
r.point())) { |
729 if (Element* node = listItems[i]) { | 729 if (Element* node = listItems[i]) { |
730 result.setInnerNode(node); | 730 result.setInnerNode(node); |
731 if (!result.innerNonSharedNode()) | 731 if (!result.innerNonSharedNode()) |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 | 957 |
958 if (m_vBar) | 958 if (m_vBar) |
959 m_vBar->styleChanged(); | 959 m_vBar->styleChanged(); |
960 | 960 |
961 // Force an update since we know the scrollbars have changed things. | 961 // Force an update since we know the scrollbars have changed things. |
962 if (document().hasAnnotatedRegions()) | 962 if (document().hasAnnotatedRegions()) |
963 document().setAnnotatedRegionsDirty(true); | 963 document().setAnnotatedRegionsDirty(true); |
964 } | 964 } |
965 | 965 |
966 } // namespace WebCore | 966 } // namespace WebCore |
OLD | NEW |