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

Side by Side Diff: Source/core/frame/LocalDOMWindow.cpp

Issue 524523003: Revert of Remove webkitConvertPointFromPageToNode() and webkitConvertPointFromNodeToPage() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 3 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/LocalDOMWindow.h ('k') | Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
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 * 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 #include "core/frame/EventHandlerRegistry.h" 62 #include "core/frame/EventHandlerRegistry.h"
63 #include "core/frame/FrameConsole.h" 63 #include "core/frame/FrameConsole.h"
64 #include "core/frame/FrameHost.h" 64 #include "core/frame/FrameHost.h"
65 #include "core/frame/FrameView.h" 65 #include "core/frame/FrameView.h"
66 #include "core/frame/History.h" 66 #include "core/frame/History.h"
67 #include "core/frame/LocalFrame.h" 67 #include "core/frame/LocalFrame.h"
68 #include "core/frame/Location.h" 68 #include "core/frame/Location.h"
69 #include "core/frame/Navigator.h" 69 #include "core/frame/Navigator.h"
70 #include "core/frame/Screen.h" 70 #include "core/frame/Screen.h"
71 #include "core/frame/Settings.h" 71 #include "core/frame/Settings.h"
72 #include "core/frame/WebKitPoint.h"
72 #include "core/html/HTMLFrameOwnerElement.h" 73 #include "core/html/HTMLFrameOwnerElement.h"
73 #include "core/inspector/ConsoleMessage.h" 74 #include "core/inspector/ConsoleMessage.h"
74 #include "core/inspector/ConsoleMessageStorage.h" 75 #include "core/inspector/ConsoleMessageStorage.h"
75 #include "core/inspector/InspectorInstrumentation.h" 76 #include "core/inspector/InspectorInstrumentation.h"
76 #include "core/inspector/InspectorTraceEvents.h" 77 #include "core/inspector/InspectorTraceEvents.h"
77 #include "core/inspector/ScriptCallStack.h" 78 #include "core/inspector/ScriptCallStack.h"
78 #include "core/loader/DocumentLoader.h" 79 #include "core/loader/DocumentLoader.h"
79 #include "core/loader/FrameLoadRequest.h" 80 #include "core/loader/FrameLoadRequest.h"
80 #include "core/loader/FrameLoader.h" 81 #include "core/loader/FrameLoader.h"
81 #include "core/loader/FrameLoaderClient.h" 82 #include "core/loader/FrameLoaderClient.h"
(...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 unsigned colonStart = pseudoElement[0] == ':' ? (pseudoElement[1] == ':' ? 2 : 1) : 0; 1337 unsigned colonStart = pseudoElement[0] == ':' ? (pseudoElement[1] == ':' ? 2 : 1) : 0;
1337 CSSSelector::PseudoType pseudoType = CSSSelector::parsePseudoType(AtomicStri ng(pseudoElement.substring(colonStart))); 1338 CSSSelector::PseudoType pseudoType = CSSSelector::parsePseudoType(AtomicStri ng(pseudoElement.substring(colonStart)));
1338 if (pseudoType == CSSSelector::PseudoUnknown && !pseudoElement.isEmpty()) 1339 if (pseudoType == CSSSelector::PseudoUnknown && !pseudoElement.isEmpty())
1339 return nullptr; 1340 return nullptr;
1340 1341
1341 unsigned rulesToInclude = StyleResolver::AuthorCSSRules; 1342 unsigned rulesToInclude = StyleResolver::AuthorCSSRules;
1342 PseudoId pseudoId = CSSSelector::pseudoId(pseudoType); 1343 PseudoId pseudoId = CSSSelector::pseudoId(pseudoType);
1343 return m_frame->document()->ensureStyleResolver().pseudoCSSRulesForElement(e lement, pseudoId, rulesToInclude); 1344 return m_frame->document()->ensureStyleResolver().pseudoCSSRulesForElement(e lement, pseudoId, rulesToInclude);
1344 } 1345 }
1345 1346
1347 PassRefPtrWillBeRawPtr<WebKitPoint> LocalDOMWindow::webkitConvertPointFromNodeTo Page(Node* node, const WebKitPoint* p) const
1348 {
1349 if (!node || !p)
1350 return nullptr;
1351
1352 if (!document())
1353 return nullptr;
1354
1355 document()->updateLayoutIgnorePendingStylesheets();
1356
1357 FloatPoint pagePoint(p->x(), p->y());
1358 pagePoint = node->convertToPage(pagePoint);
1359 return WebKitPoint::create(pagePoint.x(), pagePoint.y());
1360 }
1361
1362 PassRefPtrWillBeRawPtr<WebKitPoint> LocalDOMWindow::webkitConvertPointFromPageTo Node(Node* node, const WebKitPoint* p) const
1363 {
1364 if (!node || !p)
1365 return nullptr;
1366
1367 if (!document())
1368 return nullptr;
1369
1370 document()->updateLayoutIgnorePendingStylesheets();
1371
1372 FloatPoint nodePoint(p->x(), p->y());
1373 nodePoint = node->convertFromPage(nodePoint);
1374 return WebKitPoint::create(nodePoint.x(), nodePoint.y());
1375 }
1376
1346 double LocalDOMWindow::devicePixelRatio() const 1377 double LocalDOMWindow::devicePixelRatio() const
1347 { 1378 {
1348 if (!m_frame) 1379 if (!m_frame)
1349 return 0.0; 1380 return 0.0;
1350 1381
1351 return m_frame->devicePixelRatio(); 1382 return m_frame->devicePixelRatio();
1352 } 1383 }
1353 1384
1354 static bool scrollBehaviorFromScrollOptions(const Dictionary& scrollOptions, Scr ollBehavior& scrollBehavior, ExceptionState& exceptionState) 1385 static bool scrollBehaviorFromScrollOptions(const Dictionary& scrollOptions, Scr ollBehavior& scrollBehavior, ExceptionState& exceptionState)
1355 { 1386 {
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
1916 visitor->trace(m_applicationCache); 1947 visitor->trace(m_applicationCache);
1917 visitor->trace(m_performance); 1948 visitor->trace(m_performance);
1918 visitor->trace(m_css); 1949 visitor->trace(m_css);
1919 visitor->trace(m_eventQueue); 1950 visitor->trace(m_eventQueue);
1920 WillBeHeapSupplementable<LocalDOMWindow>::trace(visitor); 1951 WillBeHeapSupplementable<LocalDOMWindow>::trace(visitor);
1921 EventTargetWithInlineData::trace(visitor); 1952 EventTargetWithInlineData::trace(visitor);
1922 LifecycleContext<LocalDOMWindow>::trace(visitor); 1953 LifecycleContext<LocalDOMWindow>::trace(visitor);
1923 } 1954 }
1924 1955
1925 } // namespace blink 1956 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/LocalDOMWindow.h ('k') | Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698