Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/HTMLAreaElement.h |
| diff --git a/third_party/WebKit/Source/core/html/HTMLAreaElement.h b/third_party/WebKit/Source/core/html/HTMLAreaElement.h |
| index 2fd276aefd03775f6ade306d474e726df01f6ab2..9d28248399daf24ea5fb7937f97d4cbc8f704ea2 100644 |
| --- a/third_party/WebKit/Source/core/html/HTMLAreaElement.h |
| +++ b/third_party/WebKit/Source/core/html/HTMLAreaElement.h |
| @@ -40,10 +40,16 @@ public: |
| bool isDefault() const { return m_shape == Default; } |
| - bool pointInArea(LayoutPoint, const LayoutSize& containerSize); |
| + // |containerObject| in the following functions is an object (normally a LayoutImage) |
| + // which references the containing image map of this area. There might be multiple |
| + // objects referencing the same map. For these functions, the effective geometry of |
| + // this map will be calculated based on the specified container object, e.g. the |
| + // rectangle of the default shape will be the border box rect of the container object, |
| + // and effective zoom factor of the container object will be applied on non-default shape. |
|
pdr.
2016/04/26 18:47:29
Excellent comment, thank you for writing it. Can y
Xianzhu
2016/04/26 19:25:02
Done.
|
| - LayoutRect computeRect(const LayoutObject*) const; |
| - Path computePath(const LayoutObject*) const; |
| + bool pointInArea(const LayoutPoint&, const LayoutObject* containerObject) const; |
| + LayoutRect computeAbsoluteRect(const LayoutObject* containerObject) const; |
| + Path getPath(const LayoutObject* containerObject) const; |
| // The parent map's image. |
| HTMLImageElement* imageElement() const; |
| @@ -60,12 +66,10 @@ private: |
| void setFocus(bool) override; |
| enum Shape { Default, Poly, Rect, Circle }; |
| - Path getRegion(const LayoutSize&) const; |
| - void invalidateCachedRegion(); |
| + void invalidateCachedPath(); |
| - OwnPtr<Path> m_region; |
| + mutable OwnPtr<Path> m_path; |
| Vector<double> m_coords; |
| - LayoutSize m_lastSize; |
| Shape m_shape; |
| }; |