| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. |
| 3 * Copyright (C) 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2012 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 * 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "core/events/EventPath.h" | 42 #include "core/events/EventPath.h" |
| 43 #include "core/frame/FrameView.h" | 43 #include "core/frame/FrameView.h" |
| 44 #include "core/frame/LocalFrame.h" | 44 #include "core/frame/LocalFrame.h" |
| 45 #include "core/html/HTMLAnchorElement.h" | 45 #include "core/html/HTMLAnchorElement.h" |
| 46 #include "core/html/HTMLFrameOwnerElement.h" | 46 #include "core/html/HTMLFrameOwnerElement.h" |
| 47 #include "core/html/HTMLMapElement.h" | 47 #include "core/html/HTMLMapElement.h" |
| 48 #include "core/layout/HitTestResult.h" | 48 #include "core/layout/HitTestResult.h" |
| 49 #include "core/layout/api/LayoutViewItem.h" | 49 #include "core/layout/api/LayoutViewItem.h" |
| 50 #include "core/page/FocusController.h" | 50 #include "core/page/FocusController.h" |
| 51 #include "core/page/Page.h" | 51 #include "core/page/Page.h" |
| 52 #include "core/svg/SVGTreeScopeResources.h" |
| 52 #include "wtf/Vector.h" | 53 #include "wtf/Vector.h" |
| 53 | 54 |
| 54 namespace blink { | 55 namespace blink { |
| 55 | 56 |
| 56 using namespace HTMLNames; | 57 using namespace HTMLNames; |
| 57 | 58 |
| 58 TreeScope::TreeScope(ContainerNode& rootNode, Document& document) | 59 TreeScope::TreeScope(ContainerNode& rootNode, Document& document) |
| 59 : m_rootNode(&rootNode), | 60 : m_rootNode(&rootNode), |
| 60 m_document(&document), | 61 m_document(&document), |
| 61 m_parentTreeScope(&document), | 62 m_parentTreeScope(&document), |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 291 |
| 291 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | | 292 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | |
| 292 HitTestRequest::ListBased | | 293 HitTestRequest::ListBased | |
| 293 HitTestRequest::PenetratingList); | 294 HitTestRequest::PenetratingList); |
| 294 HitTestResult result(request, hitPoint); | 295 HitTestResult result(request, hitPoint); |
| 295 document.layoutViewItem().hitTest(result); | 296 document.layoutViewItem().hitTest(result); |
| 296 | 297 |
| 297 return elementsFromHitTestResult(result); | 298 return elementsFromHitTestResult(result); |
| 298 } | 299 } |
| 299 | 300 |
| 301 SVGTreeScopeResources& TreeScope::ensureSVGTreeScopedResources() { |
| 302 if (!m_svgTreeScopedResources) |
| 303 m_svgTreeScopedResources = new SVGTreeScopeResources(this); |
| 304 return *m_svgTreeScopedResources; |
| 305 } |
| 306 |
| 300 DOMSelection* TreeScope::getSelection() const { | 307 DOMSelection* TreeScope::getSelection() const { |
| 301 if (!rootNode().document().frame()) | 308 if (!rootNode().document().frame()) |
| 302 return nullptr; | 309 return nullptr; |
| 303 | 310 |
| 304 if (m_selection) | 311 if (m_selection) |
| 305 return m_selection.get(); | 312 return m_selection.get(); |
| 306 | 313 |
| 307 // FIXME: The correct selection in Shadow DOM requires that Position can have | 314 // FIXME: The correct selection in Shadow DOM requires that Position can have |
| 308 // a ShadowRoot as a container. See | 315 // a ShadowRoot as a container. See |
| 309 // https://bugs.webkit.org/show_bug.cgi?id=82697 | 316 // https://bugs.webkit.org/show_bug.cgi?id=82697 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 DEFINE_TRACE(TreeScope) { | 525 DEFINE_TRACE(TreeScope) { |
| 519 visitor->trace(m_rootNode); | 526 visitor->trace(m_rootNode); |
| 520 visitor->trace(m_document); | 527 visitor->trace(m_document); |
| 521 visitor->trace(m_parentTreeScope); | 528 visitor->trace(m_parentTreeScope); |
| 522 visitor->trace(m_idTargetObserverRegistry); | 529 visitor->trace(m_idTargetObserverRegistry); |
| 523 visitor->trace(m_selection); | 530 visitor->trace(m_selection); |
| 524 visitor->trace(m_elementsById); | 531 visitor->trace(m_elementsById); |
| 525 visitor->trace(m_imageMapsByName); | 532 visitor->trace(m_imageMapsByName); |
| 526 visitor->trace(m_scopedStyleResolver); | 533 visitor->trace(m_scopedStyleResolver); |
| 527 visitor->trace(m_radioButtonGroupScope); | 534 visitor->trace(m_radioButtonGroupScope); |
| 535 visitor->trace(m_svgTreeScopedResources); |
| 528 } | 536 } |
| 529 | 537 |
| 530 } // namespace blink | 538 } // namespace blink |
| OLD | NEW |