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

Side by Side Diff: third_party/WebKit/Source/core/dom/TreeScope.cpp

Issue 2633143002: SVG objects with same idrefs conflict when under different shadow root (Closed)
Patch Set: Tests Created 3 years, 11 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
OLDNEW
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "core/frame/FrameView.h" 45 #include "core/frame/FrameView.h"
46 #include "core/frame/LocalFrame.h" 46 #include "core/frame/LocalFrame.h"
47 #include "core/html/HTMLAnchorElement.h" 47 #include "core/html/HTMLAnchorElement.h"
48 #include "core/html/HTMLFrameOwnerElement.h" 48 #include "core/html/HTMLFrameOwnerElement.h"
49 #include "core/html/HTMLMapElement.h" 49 #include "core/html/HTMLMapElement.h"
50 #include "core/inspector/ConsoleMessage.h" 50 #include "core/inspector/ConsoleMessage.h"
51 #include "core/layout/HitTestResult.h" 51 #include "core/layout/HitTestResult.h"
52 #include "core/layout/api/LayoutViewItem.h" 52 #include "core/layout/api/LayoutViewItem.h"
53 #include "core/page/FocusController.h" 53 #include "core/page/FocusController.h"
54 #include "core/page/Page.h" 54 #include "core/page/Page.h"
55 #include "core/svg/SVGTreeScopeResources.h"
55 #include "wtf/Vector.h" 56 #include "wtf/Vector.h"
56 57
57 namespace blink { 58 namespace blink {
58 59
59 using namespace HTMLNames; 60 using namespace HTMLNames;
60 61
61 namespace { 62 namespace {
62 63
63 void addSingletonDeprecationMessageForImageMap(const LocalFrame* frame, 64 void addSingletonDeprecationMessageForImageMap(const LocalFrame* frame,
64 UseCounter::Feature feature, 65 UseCounter::Feature feature,
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 332
332 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | 333 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active |
333 HitTestRequest::ListBased | 334 HitTestRequest::ListBased |
334 HitTestRequest::PenetratingList); 335 HitTestRequest::PenetratingList);
335 HitTestResult result(request, hitPoint); 336 HitTestResult result(request, hitPoint);
336 document.layoutViewItem().hitTest(result); 337 document.layoutViewItem().hitTest(result);
337 338
338 return elementsFromHitTestResult(result); 339 return elementsFromHitTestResult(result);
339 } 340 }
340 341
342 const SVGTreeScopeResources* TreeScope::svgExtensions() {
343 return m_svgTreeScopedResources;
344 }
345
346 SVGTreeScopeResources& TreeScope::accessSVGTreeScopedResources() {
347 if (!m_svgTreeScopedResources)
348 m_svgTreeScopedResources = new SVGTreeScopeResources(this);
349 return *m_svgTreeScopedResources;
350 }
351
341 DOMSelection* TreeScope::getSelection() const { 352 DOMSelection* TreeScope::getSelection() const {
342 if (!rootNode().document().frame()) 353 if (!rootNode().document().frame())
343 return nullptr; 354 return nullptr;
344 355
345 if (m_selection) 356 if (m_selection)
346 return m_selection.get(); 357 return m_selection.get();
347 358
348 // FIXME: The correct selection in Shadow DOM requires that Position can have 359 // FIXME: The correct selection in Shadow DOM requires that Position can have
349 // a ShadowRoot as a container. See 360 // a ShadowRoot as a container. See
350 // https://bugs.webkit.org/show_bug.cgi?id=82697 361 // https://bugs.webkit.org/show_bug.cgi?id=82697
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 DEFINE_TRACE(TreeScope) { 570 DEFINE_TRACE(TreeScope) {
560 visitor->trace(m_rootNode); 571 visitor->trace(m_rootNode);
561 visitor->trace(m_document); 572 visitor->trace(m_document);
562 visitor->trace(m_parentTreeScope); 573 visitor->trace(m_parentTreeScope);
563 visitor->trace(m_idTargetObserverRegistry); 574 visitor->trace(m_idTargetObserverRegistry);
564 visitor->trace(m_selection); 575 visitor->trace(m_selection);
565 visitor->trace(m_elementsById); 576 visitor->trace(m_elementsById);
566 visitor->trace(m_imageMapsByName); 577 visitor->trace(m_imageMapsByName);
567 visitor->trace(m_scopedStyleResolver); 578 visitor->trace(m_scopedStyleResolver);
568 visitor->trace(m_radioButtonGroupScope); 579 visitor->trace(m_radioButtonGroupScope);
580 visitor->trace(m_svgTreeScopedResources);
569 } 581 }
570 582
571 } // namespace blink 583 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698