OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
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 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 | 288 |
289 unsigned Internals::updateStyleAndReturnAffectedElementCount(ExceptionState& exc
eptionState) const | 289 unsigned Internals::updateStyleAndReturnAffectedElementCount(ExceptionState& exc
eptionState) const |
290 { | 290 { |
291 Document* document = contextDocument(); | 291 Document* document = contextDocument(); |
292 if (!document) { | 292 if (!document) { |
293 exceptionState.throwDOMException(InvalidAccessError, "No context documen
t is available."); | 293 exceptionState.throwDOMException(InvalidAccessError, "No context documen
t is available."); |
294 return 0; | 294 return 0; |
295 } | 295 } |
296 | 296 |
297 unsigned beforeCount = document->styleEngine()->resolverAccessCount(); | 297 unsigned beforeCount = document->styleEngine()->resolverAccessCount(); |
298 document->updateStyleIfNeeded(); | 298 document->updateRenderTreeIfNeeded(); |
299 return document->styleEngine()->resolverAccessCount() - beforeCount; | 299 return document->styleEngine()->resolverAccessCount() - beforeCount; |
300 } | 300 } |
301 | 301 |
302 unsigned Internals::needsLayoutCount(ExceptionState& exceptionState) const | 302 unsigned Internals::needsLayoutCount(ExceptionState& exceptionState) const |
303 { | 303 { |
304 LocalFrame* contextFrame = frame(); | 304 LocalFrame* contextFrame = frame(); |
305 if (!contextFrame) { | 305 if (!contextFrame) { |
306 exceptionState.throwDOMException(InvalidAccessError, "No context frame i
s available."); | 306 exceptionState.throwDOMException(InvalidAccessError, "No context frame i
s available."); |
307 return 0; | 307 return 0; |
308 } | 308 } |
(...skipping 2136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2445 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma
xLength) | 2445 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma
xLength) |
2446 { | 2446 { |
2447 if (!node) | 2447 if (!node) |
2448 return String(); | 2448 return String(); |
2449 blink::WebPoint point(x, y); | 2449 blink::WebPoint point(x, y); |
2450 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo
rPoint(static_cast<IntPoint>(point))), maxLength); | 2450 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo
rPoint(static_cast<IntPoint>(point))), maxLength); |
2451 return surroundingText.content(); | 2451 return surroundingText.content(); |
2452 } | 2452 } |
2453 | 2453 |
2454 } | 2454 } |
OLD | NEW |