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

Side by Side Diff: Source/WebCore/testing/Internals.cpp

Issue 11635024: Merge 137939 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 8 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
« no previous file with comments | « Source/WebCore/testing/Internals.h ('k') | Source/WebCore/testing/Internals.idl » ('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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 #include "MallocStatistics.h" 66 #include "MallocStatistics.h"
67 #include "MockPagePopupDriver.h" 67 #include "MockPagePopupDriver.h"
68 #include "NodeRenderingContext.h" 68 #include "NodeRenderingContext.h"
69 #include "Page.h" 69 #include "Page.h"
70 #include "PrintContext.h" 70 #include "PrintContext.h"
71 #include "Range.h" 71 #include "Range.h"
72 #include "RenderObject.h" 72 #include "RenderObject.h"
73 #include "RenderTreeAsText.h" 73 #include "RenderTreeAsText.h"
74 #include "RuntimeEnabledFeatures.h" 74 #include "RuntimeEnabledFeatures.h"
75 #include "SchemeRegistry.h" 75 #include "SchemeRegistry.h"
76 #include "ScrollingCoordinator.h"
76 #include "SelectRuleFeatureSet.h" 77 #include "SelectRuleFeatureSet.h"
77 #include "SerializedScriptValue.h" 78 #include "SerializedScriptValue.h"
78 #include "Settings.h" 79 #include "Settings.h"
79 #include "ShadowRoot.h" 80 #include "ShadowRoot.h"
80 #include "SpellChecker.h" 81 #include "SpellChecker.h"
81 #include "StyleSheetContents.h" 82 #include "StyleSheetContents.h"
82 #include "TextIterator.h" 83 #include "TextIterator.h"
83 #include "TreeScope.h" 84 #include "TreeScope.h"
84 #include "ViewportArguments.h" 85 #include "ViewportArguments.h"
85 #include <wtf/text/StringBuffer.h> 86 #include <wtf/text/StringBuffer.h>
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1193 return document->wheelEventHandlerCount(); 1194 return document->wheelEventHandlerCount();
1194 } 1195 }
1195 1196
1196 unsigned Internals::touchEventHandlerCount(Document* document, ExceptionCode& ec ) 1197 unsigned Internals::touchEventHandlerCount(Document* document, ExceptionCode& ec )
1197 { 1198 {
1198 if (!document) { 1199 if (!document) {
1199 ec = INVALID_ACCESS_ERR; 1200 ec = INVALID_ACCESS_ERR;
1200 return 0; 1201 return 0;
1201 } 1202 }
1202 1203
1203 return document->touchEventHandlerCount(); 1204 const TouchEventTargetSet* touchHandlers = document->touchEventTargets();
1205 if (!touchHandlers)
1206 return 0;
1207
1208 unsigned count = 0;
1209 for (TouchEventTargetSet::const_iterator iter = touchHandlers->begin(); iter != touchHandlers->end(); ++iter)
1210 count += iter->value;
1211 return count;
1204 } 1212 }
1205 1213
1214 #if ENABLE(TOUCH_EVENT_TRACKING)
1215 PassRefPtr<ClientRectList> Internals::touchEventTargetClientRects(Document* docu ment, ExceptionCode& ec)
1216 {
1217 if (!document || !document->view() || !document->page()) {
1218 ec = INVALID_ACCESS_ERR;
1219 return 0;
1220 }
1221 if (!document->page()->scrollingCoordinator())
1222 return ClientRectList::create();
1223
1224 document->updateLayoutIgnorePendingStylesheets();
1225
1226 Vector<IntRect> absoluteRects;
1227 document->page()->scrollingCoordinator()->computeAbsoluteTouchEventTargetRec ts(document, absoluteRects);
1228 Vector<FloatQuad> absoluteQuads(absoluteRects.size());
1229
1230 for (size_t i = 0; i < absoluteRects.size(); ++i)
1231 absoluteQuads[i] = FloatQuad(absoluteRects[i]);
1232
1233 return ClientRectList::create(absoluteQuads);
1234 }
1235 #endif
1236
1206 PassRefPtr<NodeList> Internals::nodesFromRect(Document* document, int x, int y, unsigned topPadding, unsigned rightPadding, 1237 PassRefPtr<NodeList> Internals::nodesFromRect(Document* document, int x, int y, unsigned topPadding, unsigned rightPadding,
1207 unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allo wShadowContent, ExceptionCode& ec) const 1238 unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allo wShadowContent, ExceptionCode& ec) const
1208 { 1239 {
1209 if (!document || !document->frame() || !document->frame()->view()) { 1240 if (!document || !document->frame() || !document->frame()->view()) {
1210 ec = INVALID_ACCESS_ERR; 1241 ec = INVALID_ACCESS_ERR;
1211 return 0; 1242 return 0;
1212 } 1243 }
1213 1244
1214 return document->nodesFromRect(x, y, topPadding, rightPadding, bottomPadding , leftPadding, ignoreClipping, allowShadowContent); 1245 return document->nodesFromRect(x, y, topPadding, rightPadding, bottomPadding , leftPadding, ignoreClipping, allowShadowContent);
1215 } 1246 }
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
1775 return SerializedScriptValue::adopt(bytes); 1806 return SerializedScriptValue::adopt(bytes);
1776 #endif 1807 #endif
1777 } 1808 }
1778 1809
1779 void Internals::setUsesOverlayScrollbars(bool enabled) 1810 void Internals::setUsesOverlayScrollbars(bool enabled)
1780 { 1811 {
1781 WebCore::Settings::setUsesOverlayScrollbars(enabled); 1812 WebCore::Settings::setUsesOverlayScrollbars(enabled);
1782 } 1813 }
1783 1814
1784 } 1815 }
OLDNEW
« no previous file with comments | « Source/WebCore/testing/Internals.h ('k') | Source/WebCore/testing/Internals.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698