| 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 2221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2232 { | 2232 { |
| 2233 return context->hitRegionsCount(); | 2233 return context->hitRegionsCount(); |
| 2234 } | 2234 } |
| 2235 | 2235 |
| 2236 ClientRect* Internals::boundsInViewportSpace(Element* element) | 2236 ClientRect* Internals::boundsInViewportSpace(Element* element) |
| 2237 { | 2237 { |
| 2238 ASSERT(element); | 2238 ASSERT(element); |
| 2239 return ClientRect::create(element->boundsInViewportSpace()); | 2239 return ClientRect::create(element->boundsInViewportSpace()); |
| 2240 } | 2240 } |
| 2241 | 2241 |
| 2242 String Internals::serializeNavigationMarkup() | |
| 2243 { | |
| 2244 Vector<Document::TransitionElementData> elementData; | |
| 2245 frame()->document()->getTransitionElementData(elementData); | |
| 2246 | |
| 2247 StringBuilder markup; | |
| 2248 for (const auto& element : elementData) | |
| 2249 markup.append(element.markup); | |
| 2250 | |
| 2251 return markup.toString(); | |
| 2252 } | |
| 2253 | |
| 2254 Vector<String> Internals::getTransitionElementIds() | |
| 2255 { | |
| 2256 Vector<Document::TransitionElementData> elementData; | |
| 2257 frame()->document()->getTransitionElementData(elementData); | |
| 2258 | |
| 2259 Vector<String> ids; | |
| 2260 for (size_t i = 0; i < elementData.size(); ++i) { | |
| 2261 for (size_t j = 0; j < elementData[i].elements.size(); ++j) | |
| 2262 ids.append(elementData[i].elements[j].id); | |
| 2263 } | |
| 2264 | |
| 2265 return ids; | |
| 2266 } | |
| 2267 | |
| 2268 ClientRectList* Internals::getTransitionElementRects() | |
| 2269 { | |
| 2270 Vector<Document::TransitionElementData> elementData; | |
| 2271 frame()->document()->getTransitionElementData(elementData); | |
| 2272 | |
| 2273 Vector<IntRect> rects; | |
| 2274 for (size_t i = 0; i < elementData.size(); ++i) { | |
| 2275 for (size_t j = 0; j < elementData[i].elements.size(); ++j) | |
| 2276 rects.append(elementData[i].elements[j].rect); | |
| 2277 } | |
| 2278 return ClientRectList::create(rects); | |
| 2279 } | |
| 2280 | |
| 2281 void Internals::hideAllTransitionElements() | |
| 2282 { | |
| 2283 Vector<Document::TransitionElementData> elementData; | |
| 2284 frame()->document()->getTransitionElementData(elementData); | |
| 2285 | |
| 2286 for (const auto& element : elementData) | |
| 2287 frame()->document()->hideTransitionElements(AtomicString(element.selecto
r)); | |
| 2288 } | |
| 2289 | |
| 2290 void Internals::showAllTransitionElements() | |
| 2291 { | |
| 2292 Vector<Document::TransitionElementData> elementData; | |
| 2293 frame()->document()->getTransitionElementData(elementData); | |
| 2294 | |
| 2295 for (const auto& element : elementData) | |
| 2296 frame()->document()->showTransitionElements(AtomicString(element.selecto
r)); | |
| 2297 } | |
| 2298 | |
| 2299 void Internals::setExitTransitionStylesheetsEnabled(bool enabled) | |
| 2300 { | |
| 2301 frame()->document()->styleEngine().setExitTransitionStylesheetsEnabled(enabl
ed); | |
| 2302 } | |
| 2303 | |
| 2304 void Internals::forcePluginPlaceholder(HTMLElement* element, PassRefPtrWillBeRaw
Ptr<DocumentFragment> fragment, ExceptionState& exceptionState) | 2242 void Internals::forcePluginPlaceholder(HTMLElement* element, PassRefPtrWillBeRaw
Ptr<DocumentFragment> fragment, ExceptionState& exceptionState) |
| 2305 { | 2243 { |
| 2306 if (!element->isPluginElement()) { | 2244 if (!element->isPluginElement()) { |
| 2307 exceptionState.throwDOMException(InvalidNodeTypeError, "The element prov
ided is not a plugin."); | 2245 exceptionState.throwDOMException(InvalidNodeTypeError, "The element prov
ided is not a plugin."); |
| 2308 return; | 2246 return; |
| 2309 } | 2247 } |
| 2310 toHTMLPlugInElement(element)->setPlaceholder(DocumentFragmentPluginPlacehold
er::create(fragment)); | 2248 toHTMLPlugInElement(element)->setPlaceholder(DocumentFragmentPluginPlacehold
er::create(fragment)); |
| 2311 } | 2249 } |
| 2312 | 2250 |
| 2313 void Internals::forcePluginPlaceholder(HTMLElement* element, const PluginPlaceho
lderOptions& options, ExceptionState& exceptionState) | 2251 void Internals::forcePluginPlaceholder(HTMLElement* element, const PluginPlaceho
lderOptions& options, ExceptionState& exceptionState) |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2363 | 2301 |
| 2364 ClientRectList* Internals::focusRingRects(Element* element) | 2302 ClientRectList* Internals::focusRingRects(Element* element) |
| 2365 { | 2303 { |
| 2366 Vector<LayoutRect> rects; | 2304 Vector<LayoutRect> rects; |
| 2367 if (element && element->layoutObject()) | 2305 if (element && element->layoutObject()) |
| 2368 element->layoutObject()->addFocusRingRects(rects, LayoutPoint()); | 2306 element->layoutObject()->addFocusRingRects(rects, LayoutPoint()); |
| 2369 return ClientRectList::create(rects); | 2307 return ClientRectList::create(rects); |
| 2370 } | 2308 } |
| 2371 | 2309 |
| 2372 } // namespace blink | 2310 } // namespace blink |
| OLD | NEW |