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 11 matching lines...) Expand all Loading... |
22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 */ | 28 */ |
29 | 29 |
30 #include "core/layout/LayoutListBox.h" | 30 #include "core/layout/LayoutListBox.h" |
31 | 31 |
32 #include "core/HTMLNames.h" | |
33 #include "core/css/CSSFontSelector.h" | |
34 #include "core/css/resolver/StyleResolver.h" | |
35 #include "core/dom/AXObjectCache.h" | |
36 #include "core/dom/Document.h" | |
37 #include "core/dom/ElementTraversal.h" | 32 #include "core/dom/ElementTraversal.h" |
38 #include "core/dom/NodeComputedStyle.h" | |
39 #include "core/dom/StyleEngine.h" | |
40 #include "core/editing/FrameSelection.h" | |
41 #include "core/frame/FrameView.h" | |
42 #include "core/frame/LocalFrame.h" | |
43 #include "core/html/HTMLDivElement.h" | 33 #include "core/html/HTMLDivElement.h" |
44 #include "core/html/HTMLOptGroupElement.h" | 34 #include "core/html/HTMLOptGroupElement.h" |
45 #include "core/html/HTMLOptionElement.h" | 35 #include "core/html/HTMLOptionElement.h" |
46 #include "core/html/HTMLSelectElement.h" | 36 #include "core/html/HTMLSelectElement.h" |
47 #include "core/input/EventHandler.h" | |
48 #include "core/layout/HitTestResult.h" | |
49 #include "core/layout/LayoutText.h" | |
50 #include "core/layout/LayoutTheme.h" | |
51 #include "core/layout/TextRunConstructor.h" | |
52 #include "core/page/FocusController.h" | |
53 #include "core/page/Page.h" | |
54 #include "core/page/SpatialNavigation.h" | |
55 #include "core/paint/PaintLayer.h" | 37 #include "core/paint/PaintLayer.h" |
56 #include "platform/fonts/FontCache.h" | |
57 #include "platform/graphics/GraphicsContext.h" | |
58 #include "platform/text/BidiTextRun.h" | |
59 #include <math.h> | |
60 | 38 |
61 namespace blink { | 39 namespace blink { |
62 | 40 |
63 using namespace HTMLNames; | |
64 | |
65 // Default size when the multiple attribute is present but size attribute is abs
ent. | 41 // Default size when the multiple attribute is present but size attribute is abs
ent. |
66 const int defaultSize = 4; | 42 const int defaultSize = 4; |
67 | 43 |
68 const int defaultPaddingBottom = 1; | 44 const int defaultPaddingBottom = 1; |
69 | 45 |
70 LayoutListBox::LayoutListBox(Element* element) | 46 LayoutListBox::LayoutListBox(Element* element) |
71 : LayoutBlockFlow(element) | 47 : LayoutBlockFlow(element) |
72 { | 48 { |
73 ASSERT(element); | 49 ASSERT(element); |
74 ASSERT(element->isHTMLElement()); | 50 ASSERT(element->isHTMLElement()); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 void LayoutListBox::scrollToRect(const LayoutRect& rect) | 121 void LayoutListBox::scrollToRect(const LayoutRect& rect) |
146 { | 122 { |
147 if (hasOverflowClip()) { | 123 if (hasOverflowClip()) { |
148 ASSERT(layer()); | 124 ASSERT(layer()); |
149 ASSERT(layer()->getScrollableArea()); | 125 ASSERT(layer()->getScrollableArea()); |
150 layer()->getScrollableArea()->scrollIntoView(rect, ScrollAlignment::alig
nToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded); | 126 layer()->getScrollableArea()->scrollIntoView(rect, ScrollAlignment::alig
nToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded); |
151 } | 127 } |
152 } | 128 } |
153 | 129 |
154 } // namespace blink | 130 } // namespace blink |
OLD | NEW |