OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> |
3 * Copyright (C) 2004, 2005, 2007, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2007, 2008 Rob Buis <buis@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 if (!extensions->hasPendingResources(resourceId)) | 382 if (!extensions->hasPendingResources(resourceId)) |
383 return; | 383 return; |
384 | 384 |
385 OwnPtr<SVGDocumentExtensions::SVGPendingElements> clients(extensions->remove
PendingResource(resourceId)); | 385 OwnPtr<SVGDocumentExtensions::SVGPendingElements> clients(extensions->remove
PendingResource(resourceId)); |
386 ASSERT(!clients->isEmpty()); | 386 ASSERT(!clients->isEmpty()); |
387 | 387 |
388 const SVGDocumentExtensions::SVGPendingElements::const_iterator end = client
s->end(); | 388 const SVGDocumentExtensions::SVGPendingElements::const_iterator end = client
s->end(); |
389 for (SVGDocumentExtensions::SVGPendingElements::const_iterator it = clients-
>begin(); it != end; ++it) { | 389 for (SVGDocumentExtensions::SVGPendingElements::const_iterator it = clients-
>begin(); it != end; ++it) { |
390 ASSERT((*it)->hasPendingResources()); | 390 ASSERT((*it)->hasPendingResources()); |
391 (*it)->buildPendingResource(); | 391 (*it)->buildPendingResource(); |
392 (*it)->setHasPendingResources(false); | 392 (*it)->clearHasPendingResourcesIfPossible(); |
393 } | 393 } |
394 } | 394 } |
395 | 395 |
396 void SVGStyledElement::removedFromDocument() | 396 void SVGStyledElement::removedFromDocument() |
397 { | 397 { |
398 updateRelativeLengthsInformation(false, this); | 398 updateRelativeLengthsInformation(false, this); |
399 SVGElement::removedFromDocument(); | 399 SVGElement::removedFromDocument(); |
400 | 400 |
401 Document* document = this->document(); | 401 Document* document = this->document(); |
402 if (!needsPendingResourceHandling() || !document) | 402 if (!needsPendingResourceHandling() || !document) |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 { | 448 { |
449 if (hasRareSVGData()) | 449 if (hasRareSVGData()) |
450 rareSVGData()->setInstanceUpdatesBlocked(value); | 450 rareSVGData()->setInstanceUpdatesBlocked(value); |
451 } | 451 } |
452 | 452 |
453 bool SVGStyledElement::hasPendingResources() const | 453 bool SVGStyledElement::hasPendingResources() const |
454 { | 454 { |
455 return hasRareSVGData() && rareSVGData()->hasPendingResources(); | 455 return hasRareSVGData() && rareSVGData()->hasPendingResources(); |
456 } | 456 } |
457 | 457 |
458 void SVGStyledElement::setHasPendingResources(bool value) | 458 void SVGStyledElement::setHasPendingResources() |
459 { | 459 { |
460 ensureRareSVGData()->setHasPendingResources(value); | 460 ensureRareSVGData()->setHasPendingResources(true); |
| 461 } |
| 462 |
| 463 void SVGStyledElement::clearHasPendingResourcesIfPossible() |
| 464 { |
| 465 if (!document()->accessSVGExtensions()->isElementInPendingResources(this)) |
| 466 ensureRareSVGData()->setHasPendingResources(false); |
461 } | 467 } |
462 | 468 |
463 AffineTransform SVGStyledElement::localCoordinateSpaceTransform(SVGLocatable::CT
MScope) const | 469 AffineTransform SVGStyledElement::localCoordinateSpaceTransform(SVGLocatable::CT
MScope) const |
464 { | 470 { |
465 // To be overriden by SVGStyledLocatableElement/SVGStyledTransformableElemen
t (or as special case SVGTextElement) | 471 // To be overriden by SVGStyledLocatableElement/SVGStyledTransformableElemen
t (or as special case SVGTextElement) |
466 ASSERT_NOT_REACHED(); | 472 ASSERT_NOT_REACHED(); |
467 return AffineTransform(); | 473 return AffineTransform(); |
468 } | 474 } |
469 | 475 |
470 void SVGStyledElement::updateRelativeLengthsInformation(bool hasRelativeLengths,
SVGStyledElement* element) | 476 void SVGStyledElement::updateRelativeLengthsInformation(bool hasRelativeLengths,
SVGStyledElement* element) |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 } | 521 } |
516 | 522 |
517 bool SVGStyledElement::isKeyboardFocusable(KeyboardEvent*) const | 523 bool SVGStyledElement::isKeyboardFocusable(KeyboardEvent*) const |
518 { | 524 { |
519 return isMouseFocusable(); | 525 return isMouseFocusable(); |
520 } | 526 } |
521 | 527 |
522 } | 528 } |
523 | 529 |
524 #endif // ENABLE(SVG) | 530 #endif // ENABLE(SVG) |
OLD | NEW |