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

Side by Side Diff: Source/core/svg/SVGDocumentExtensions.cpp

Issue 656913006: Remove SVG fonts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update tests for landing Created 6 years, 2 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Apple Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Inc. All rights reserved.
3 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) 2007 Rob Buis <buis@kde.org> 4 * Copyright (C) 2007 Rob Buis <buis@kde.org>
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 10 matching lines...) Expand all
21 21
22 #include "config.h" 22 #include "config.h"
23 #include "core/svg/SVGDocumentExtensions.h" 23 #include "core/svg/SVGDocumentExtensions.h"
24 24
25 #include "core/XLinkNames.h" 25 #include "core/XLinkNames.h"
26 #include "core/dom/Document.h" 26 #include "core/dom/Document.h"
27 #include "core/inspector/ConsoleMessage.h" 27 #include "core/inspector/ConsoleMessage.h"
28 #include "core/rendering/RenderView.h" 28 #include "core/rendering/RenderView.h"
29 #include "core/rendering/svg/SVGResourcesCache.h" 29 #include "core/rendering/svg/SVGResourcesCache.h"
30 #include "core/svg/SVGElementRareData.h" 30 #include "core/svg/SVGElementRareData.h"
31 #include "core/svg/SVGFontFaceElement.h"
32 #include "core/svg/SVGSVGElement.h" 31 #include "core/svg/SVGSVGElement.h"
33 #include "core/svg/SVGViewSpec.h" 32 #include "core/svg/SVGViewSpec.h"
34 #include "core/svg/SVGZoomAndPan.h" 33 #include "core/svg/SVGZoomAndPan.h"
35 #include "core/svg/animation/SMILTimeContainer.h" 34 #include "core/svg/animation/SMILTimeContainer.h"
36 #include "wtf/TemporaryChange.h" 35 #include "wtf/TemporaryChange.h"
37 #include "wtf/text/AtomicString.h" 36 #include "wtf/text/AtomicString.h"
38 37
39 namespace blink { 38 namespace blink {
40 39
41 SVGDocumentExtensions::SVGDocumentExtensions(Document* document) 40 SVGDocumentExtensions::SVGDocumentExtensions(Document* document)
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 ASSERT(!m_inRelativeLengthSVGRootsInvalidation); 330 ASSERT(!m_inRelativeLengthSVGRootsInvalidation);
332 #if ENABLE(ASSERT) 331 #if ENABLE(ASSERT)
333 TemporaryChange<bool> inRelativeLengthSVGRootsChange(m_inRelativeLengthSVGRo otsInvalidation, true); 332 TemporaryChange<bool> inRelativeLengthSVGRootsChange(m_inRelativeLengthSVGRo otsInvalidation, true);
334 #endif 333 #endif
335 334
336 WillBeHeapHashSet<RawPtrWillBeMember<SVGSVGElement> >::iterator end = m_rela tiveLengthSVGRoots.end(); 335 WillBeHeapHashSet<RawPtrWillBeMember<SVGSVGElement> >::iterator end = m_rela tiveLengthSVGRoots.end();
337 for (WillBeHeapHashSet<RawPtrWillBeMember<SVGSVGElement> >::iterator it = m_ relativeLengthSVGRoots.begin(); it != end; ++it) 336 for (WillBeHeapHashSet<RawPtrWillBeMember<SVGSVGElement> >::iterator it = m_ relativeLengthSVGRoots.begin(); it != end; ++it)
338 (*it)->invalidateRelativeLengthClients(scope); 337 (*it)->invalidateRelativeLengthClients(scope);
339 } 338 }
340 339
341 #if ENABLE(SVG_FONTS)
342 void SVGDocumentExtensions::registerSVGFontFaceElement(SVGFontFaceElement* eleme nt)
343 {
344 m_svgFontFaceElements.add(element);
345 }
346
347 void SVGDocumentExtensions::unregisterSVGFontFaceElement(SVGFontFaceElement* ele ment)
348 {
349 ASSERT(m_svgFontFaceElements.contains(element));
350 m_svgFontFaceElements.remove(element);
351 }
352
353 void SVGDocumentExtensions::registerPendingSVGFontFaceElementsForRemoval(PassRef PtrWillBeRawPtr<SVGFontFaceElement> font)
354 {
355 m_pendingSVGFontFaceElementsForRemoval.add(font);
356 }
357
358 void SVGDocumentExtensions::removePendingSVGFontFaceElementsForRemoval()
359 {
360 m_pendingSVGFontFaceElementsForRemoval.clear();
361 }
362
363 #endif
364
365 bool SVGDocumentExtensions::zoomAndPanEnabled() const 340 bool SVGDocumentExtensions::zoomAndPanEnabled() const
366 { 341 {
367 if (SVGSVGElement* svg = rootElement(*m_document)) { 342 if (SVGSVGElement* svg = rootElement(*m_document)) {
368 if (svg->useCurrentView()) { 343 if (svg->useCurrentView()) {
369 if (svg->currentView()) 344 if (svg->currentView())
370 return svg->currentView()->zoomAndPan() == SVGZoomAndPanMagnify; 345 return svg->currentView()->zoomAndPan() == SVGZoomAndPanMagnify;
371 } else { 346 } else {
372 return svg->zoomAndPan() == SVGZoomAndPanMagnify; 347 return svg->zoomAndPan() == SVGZoomAndPanMagnify;
373 } 348 }
374 } 349 }
(...skipping 23 matching lines...) Expand all
398 { 373 {
399 ASSERT(m_document); 374 ASSERT(m_document);
400 return rootElement(*m_document); 375 return rootElement(*m_document);
401 } 376 }
402 377
403 void SVGDocumentExtensions::trace(Visitor* visitor) 378 void SVGDocumentExtensions::trace(Visitor* visitor)
404 { 379 {
405 #if ENABLE(OILPAN) 380 #if ENABLE(OILPAN)
406 visitor->trace(m_document); 381 visitor->trace(m_document);
407 visitor->trace(m_timeContainers); 382 visitor->trace(m_timeContainers);
408 #if ENABLE(SVG_FONTS)
409 visitor->trace(m_svgFontFaceElements);
410 visitor->trace(m_pendingSVGFontFaceElementsForRemoval);
411 #endif
412 visitor->trace(m_relativeLengthSVGRoots); 383 visitor->trace(m_relativeLengthSVGRoots);
413 visitor->trace(m_pendingResources); 384 visitor->trace(m_pendingResources);
414 visitor->trace(m_pendingResourcesForRemoval); 385 visitor->trace(m_pendingResourcesForRemoval);
415 #endif 386 #endif
416 } 387 }
417 388
418 } 389 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698