Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: third_party/WebKit/Source/web/WebElement.cpp

Issue 1516723003: [Element / Autofill] Add boundsInViewportFloat() to fix <input> popup misalignment. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refator to use boundsInViewportFloat() eventually, but keep boundsInViewportInt(). Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 20 matching lines...) Expand all
31 #include "config.h" 31 #include "config.h"
32 #include "public/web/WebElement.h" 32 #include "public/web/WebElement.h"
33 33
34 #include "bindings/core/v8/ExceptionState.h" 34 #include "bindings/core/v8/ExceptionState.h"
35 #include "core/HTMLNames.h" 35 #include "core/HTMLNames.h"
36 #include "core/dom/Element.h" 36 #include "core/dom/Element.h"
37 #include "core/dom/Fullscreen.h" 37 #include "core/dom/Fullscreen.h"
38 #include "core/dom/custom/CustomElementProcessingStack.h" 38 #include "core/dom/custom/CustomElementProcessingStack.h"
39 #include "core/html/HTMLTextFormControlElement.h" 39 #include "core/html/HTMLTextFormControlElement.h"
40 #include "platform/graphics/Image.h" 40 #include "platform/graphics/Image.h"
41 #include "public/platform/WebFloatRect.h"
41 #include "public/platform/WebRect.h" 42 #include "public/platform/WebRect.h"
42 #include "wtf/PassRefPtr.h" 43 #include "wtf/PassRefPtr.h"
43 #include "wtf/text/AtomicString.h" 44 #include "wtf/text/AtomicString.h"
44 #include "wtf/text/WTFString.h" 45 #include "wtf/text/WTFString.h"
45 46
46 namespace blink { 47 namespace blink {
47 48
48 using namespace HTMLNames; 49 using namespace HTMLNames;
49 50
50 bool WebElement::isFormControlElement() const 51 bool WebElement::isFormControlElement() const
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 { 140 {
140 Element* element = unwrap<Element>(); 141 Element* element = unwrap<Element>();
141 Fullscreen::from(element->document()).requestFullscreen(*element, Fullscreen ::PrefixedRequest); 142 Fullscreen::from(element->document()).requestFullscreen(*element, Fullscreen ::PrefixedRequest);
142 } 143 }
143 144
144 bool WebElement::hasNonEmptyLayoutSize() const 145 bool WebElement::hasNonEmptyLayoutSize() const
145 { 146 {
146 return constUnwrap<Element>()->hasNonEmptyLayoutSize(); 147 return constUnwrap<Element>()->hasNonEmptyLayoutSize();
147 } 148 }
148 149
149 WebRect WebElement::boundsInViewport() 150 WebRect WebElement::boundsInViewportInt()
150 { 151 {
151 return unwrap<Element>()->boundsInViewport(); 152 return unwrap<Element>()->boundsInViewportInt();
153 }
154
155 WebFloatRect WebElement::boundsInViewportFloat()
156 {
157 return unwrap<Element>()->boundsInViewportFloat();
152 } 158 }
153 159
154 WebImage WebElement::imageContents() 160 WebImage WebElement::imageContents()
155 { 161 {
156 if (isNull()) 162 if (isNull())
157 return WebImage(); 163 return WebImage();
158 164
159 return WebImage(unwrap<Element>()->imageContents()); 165 return WebImage(unwrap<Element>()->imageContents());
160 } 166 }
161 167
162 WebElement::WebElement(const PassRefPtrWillBeRawPtr<Element>& elem) 168 WebElement::WebElement(const PassRefPtrWillBeRawPtr<Element>& elem)
163 : WebNode(elem) 169 : WebNode(elem)
164 { 170 {
165 } 171 }
166 172
167 DEFINE_WEB_NODE_TYPE_CASTS(WebElement, isElementNode()); 173 DEFINE_WEB_NODE_TYPE_CASTS(WebElement, isElementNode());
168 174
169 WebElement& WebElement::operator=(const PassRefPtrWillBeRawPtr<Element>& elem) 175 WebElement& WebElement::operator=(const PassRefPtrWillBeRawPtr<Element>& elem)
170 { 176 {
171 m_private = elem; 177 m_private = elem;
172 return *this; 178 return *this;
173 } 179 }
174 180
175 WebElement::operator PassRefPtrWillBeRawPtr<Element>() const 181 WebElement::operator PassRefPtrWillBeRawPtr<Element>() const
176 { 182 {
177 return toElement(m_private.get()); 183 return toElement(m_private.get());
178 } 184 }
179 185
180 } // namespace blink 186 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/Scrollbar.cpp ('k') | third_party/WebKit/public/web/WebElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698