OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 { | 104 { |
105 ShapePathBuilder builder(view, renderer, shapeOutsideInfo); | 105 ShapePathBuilder builder(view, renderer, shapeOutsideInfo); |
106 builder.appendPath(path); | 106 builder.appendPath(path); |
107 return builder.path(); | 107 return builder.path(); |
108 } | 108 } |
109 | 109 |
110 protected: | 110 protected: |
111 virtual FloatPoint translatePoint(const FloatPoint& point) | 111 virtual FloatPoint translatePoint(const FloatPoint& point) |
112 { | 112 { |
113 FloatPoint rendererPoint = m_shapeOutsideInfo.shapeToRendererPoint(point ); | 113 FloatPoint rendererPoint = m_shapeOutsideInfo.shapeToRendererPoint(point ); |
114 return m_view.contentsToRootView(roundedIntPoint(m_renderer.localToAbsol ute(rendererPoint))); | 114 return m_view.contentsToRootFrame(roundedIntPoint(m_renderer.localToAbso lute(rendererPoint))); |
115 } | 115 } |
116 | 116 |
117 private: | 117 private: |
118 FrameView& m_view; | 118 FrameView& m_view; |
119 LayoutObject& m_renderer; | 119 LayoutObject& m_renderer; |
120 const ShapeOutsideInfo& m_shapeOutsideInfo; | 120 const ShapeOutsideInfo& m_shapeOutsideInfo; |
121 }; | 121 }; |
122 | 122 |
123 class InspectorOverlayChromeClient final: public EmptyChromeClient { | 123 class InspectorOverlayChromeClient final: public EmptyChromeClient { |
124 public: | 124 public: |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
232 | 232 |
233 private: | 233 private: |
234 bool m_showRulers; | 234 bool m_showRulers; |
235 bool m_showExtensionLines; | 235 bool m_showExtensionLines; |
236 RefPtr<JSONObject> m_elementInfo; | 236 RefPtr<JSONObject> m_elementInfo; |
237 RefPtr<JSONArray> m_highlightPaths; | 237 RefPtr<JSONArray> m_highlightPaths; |
238 }; | 238 }; |
239 | 239 |
240 static void contentsQuadToScreen(const FrameView* view, FloatQuad& quad) | 240 static void contentsQuadToScreen(const FrameView* view, FloatQuad& quad) |
241 { | 241 { |
242 quad.setP1(view->contentsToRootView(roundedIntPoint(quad.p1()))); | 242 // TODO: These look like they should be RootFrame, dgozman to confirm |
dgozman
2015/02/18 14:05:58
Situation here depends on whether WebPageOverlay i
bokan
2015/02/18 14:10:45
The WebPageOverlay is the highlights and size anno
| |
243 quad.setP2(view->contentsToRootView(roundedIntPoint(quad.p2()))); | 243 quad.setP1(view->contentsToRootFrame(roundedIntPoint(quad.p1()))); |
244 quad.setP3(view->contentsToRootView(roundedIntPoint(quad.p3()))); | 244 quad.setP2(view->contentsToRootFrame(roundedIntPoint(quad.p2()))); |
245 quad.setP4(view->contentsToRootView(roundedIntPoint(quad.p4()))); | 245 quad.setP3(view->contentsToRootFrame(roundedIntPoint(quad.p3()))); |
246 quad.setP4(view->contentsToRootFrame(roundedIntPoint(quad.p4()))); | |
246 } | 247 } |
247 | 248 |
248 static bool buildNodeQuads(LayoutObject* renderer, FloatQuad* content, FloatQuad * padding, FloatQuad* border, FloatQuad* margin) | 249 static bool buildNodeQuads(LayoutObject* renderer, FloatQuad* content, FloatQuad * padding, FloatQuad* border, FloatQuad* margin) |
249 { | 250 { |
250 FrameView* containingView = renderer->frameView(); | 251 FrameView* containingView = renderer->frameView(); |
251 if (!containingView) | 252 if (!containingView) |
252 return false; | 253 return false; |
253 if (!renderer->isBox() && !renderer->isRenderInline()) | 254 if (!renderer->isBox() && !renderer->isRenderInline()) |
254 return false; | 255 return false; |
255 | 256 |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
823 { | 824 { |
824 LayoutObject* renderer = node->renderer(); | 825 LayoutObject* renderer = node->renderer(); |
825 FrameView* view = node->document().view(); | 826 FrameView* view = node->document().view(); |
826 if (!renderer || !view) | 827 if (!renderer || !view) |
827 return false; | 828 return false; |
828 | 829 |
829 FloatQuad content, padding, border, margin; | 830 FloatQuad content, padding, border, margin; |
830 if (!buildNodeQuads(node->renderer(), &content, &padding, &border, &margin)) | 831 if (!buildNodeQuads(node->renderer(), &content, &padding, &border, &margin)) |
831 return false; | 832 return false; |
832 | 833 |
833 IntRect boundingBox = pixelSnappedIntRect(view->contentsToRootView(renderer- >absoluteBoundingBoxRect())); | 834 IntRect boundingBox = pixelSnappedIntRect(view->contentsToRootFrame(renderer ->absoluteBoundingBoxRect())); |
834 RenderBoxModelObject* modelObject = renderer->isBoxModelObject() ? toRenderB oxModelObject(renderer) : nullptr; | 835 RenderBoxModelObject* modelObject = renderer->isBoxModelObject() ? toRenderB oxModelObject(renderer) : nullptr; |
835 | 836 |
836 model = TypeBuilder::DOM::BoxModel::create() | 837 model = TypeBuilder::DOM::BoxModel::create() |
837 .setContent(buildArrayForQuad(content)) | 838 .setContent(buildArrayForQuad(content)) |
838 .setPadding(buildArrayForQuad(padding)) | 839 .setPadding(buildArrayForQuad(padding)) |
839 .setBorder(buildArrayForQuad(border)) | 840 .setBorder(buildArrayForQuad(border)) |
840 .setMargin(buildArrayForQuad(margin)) | 841 .setMargin(buildArrayForQuad(margin)) |
841 .setWidth(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnappedO ffsetWidth(), modelObject) : boundingBox.width()) | 842 .setWidth(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnappedO ffsetWidth(), modelObject) : boundingBox.width()) |
842 .setHeight(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnapped OffsetHeight(), modelObject) : boundingBox.height()); | 843 .setHeight(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnapped OffsetHeight(), modelObject) : boundingBox.height()); |
843 | 844 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
889 hideHighlight(); | 890 hideHighlight(); |
890 } | 891 } |
891 | 892 |
892 void InspectorOverlay::startedRecordingProfile() | 893 void InspectorOverlay::startedRecordingProfile() |
893 { | 894 { |
894 if (!m_activeProfilerCount++) | 895 if (!m_activeProfilerCount++) |
895 freePage(); | 896 freePage(); |
896 } | 897 } |
897 | 898 |
898 } // namespace blink | 899 } // namespace blink |
OLD | NEW |