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

Side by Side Diff: third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp

Issue 2623513005: Introduce Element::AttributeModificationParams (Closed)
Patch Set: 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
« no previous file with comments | « third_party/WebKit/Source/core/svg/animation/SVGSMILElement.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 SMILTime value = parseClockValue(splitString[n]); 438 SMILTime value = parseClockValue(splitString[n]);
439 if (value.isUnresolved()) 439 if (value.isUnresolved())
440 parseCondition(splitString[n], beginOrEnd); 440 parseCondition(splitString[n], beginOrEnd);
441 else if (!existing.contains(value.value())) 441 else if (!existing.contains(value.value()))
442 timeList.push_back( 442 timeList.push_back(
443 SMILTimeWithOrigin(value, SMILTimeWithOrigin::ParserOrigin)); 443 SMILTimeWithOrigin(value, SMILTimeWithOrigin::ParserOrigin));
444 } 444 }
445 sortTimeList(timeList); 445 sortTimeList(timeList);
446 } 446 }
447 447
448 void SVGSMILElement::parseAttribute(const QualifiedName& name, 448 void SVGSMILElement::parseAttribute(const AttributeModificationParams& params) {
449 const AtomicString& oldValue, 449 const QualifiedName& name = params.name;
450 const AtomicString& value) { 450 const AtomicString& value = params.newValue;
451 if (name == SVGNames::beginAttr) { 451 if (name == SVGNames::beginAttr) {
452 if (!m_conditions.isEmpty()) { 452 if (!m_conditions.isEmpty()) {
453 clearConditions(); 453 clearConditions();
454 parseBeginOrEnd(fastGetAttribute(SVGNames::endAttr), End); 454 parseBeginOrEnd(fastGetAttribute(SVGNames::endAttr), End);
455 } 455 }
456 parseBeginOrEnd(value.getString(), Begin); 456 parseBeginOrEnd(value.getString(), Begin);
457 if (isConnected()) 457 if (isConnected())
458 connectSyncBaseConditions(); 458 connectSyncBaseConditions();
459 } else if (name == SVGNames::endAttr) { 459 } else if (name == SVGNames::endAttr) {
460 if (!m_conditions.isEmpty()) { 460 if (!m_conditions.isEmpty()) {
461 clearConditions(); 461 clearConditions();
462 parseBeginOrEnd(fastGetAttribute(SVGNames::beginAttr), Begin); 462 parseBeginOrEnd(fastGetAttribute(SVGNames::beginAttr), Begin);
463 } 463 }
464 parseBeginOrEnd(value.getString(), End); 464 parseBeginOrEnd(value.getString(), End);
465 if (isConnected()) 465 if (isConnected())
466 connectSyncBaseConditions(); 466 connectSyncBaseConditions();
467 } else if (name == SVGNames::onbeginAttr) { 467 } else if (name == SVGNames::onbeginAttr) {
468 setAttributeEventListener( 468 setAttributeEventListener(
469 EventTypeNames::beginEvent, 469 EventTypeNames::beginEvent,
470 createAttributeEventListener(this, name, value, eventParameterName())); 470 createAttributeEventListener(this, name, value, eventParameterName()));
471 } else if (name == SVGNames::onendAttr) { 471 } else if (name == SVGNames::onendAttr) {
472 setAttributeEventListener( 472 setAttributeEventListener(
473 EventTypeNames::endEvent, 473 EventTypeNames::endEvent,
474 createAttributeEventListener(this, name, value, eventParameterName())); 474 createAttributeEventListener(this, name, value, eventParameterName()));
475 } else if (name == SVGNames::onrepeatAttr) { 475 } else if (name == SVGNames::onrepeatAttr) {
476 setAttributeEventListener( 476 setAttributeEventListener(
477 EventTypeNames::repeatEvent, 477 EventTypeNames::repeatEvent,
478 createAttributeEventListener(this, name, value, eventParameterName())); 478 createAttributeEventListener(this, name, value, eventParameterName()));
479 } else { 479 } else {
480 SVGElement::parseAttribute(name, oldValue, value); 480 SVGElement::parseAttribute(params);
481 } 481 }
482 } 482 }
483 483
484 void SVGSMILElement::svgAttributeChanged(const QualifiedName& attrName) { 484 void SVGSMILElement::svgAttributeChanged(const QualifiedName& attrName) {
485 if (attrName == SVGNames::durAttr) { 485 if (attrName == SVGNames::durAttr) {
486 m_cachedDur = invalidCachedTime; 486 m_cachedDur = invalidCachedTime;
487 } else if (attrName == SVGNames::repeatDurAttr) { 487 } else if (attrName == SVGNames::repeatDurAttr) {
488 m_cachedRepeatDur = invalidCachedTime; 488 m_cachedRepeatDur = invalidCachedTime;
489 } else if (attrName == SVGNames::repeatCountAttr) { 489 } else if (attrName == SVGNames::repeatCountAttr) {
490 m_cachedRepeatCount = invalidCachedTime; 490 m_cachedRepeatCount = invalidCachedTime;
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 DEFINE_TRACE(SVGSMILElement) { 1309 DEFINE_TRACE(SVGSMILElement) {
1310 visitor->trace(m_targetElement); 1310 visitor->trace(m_targetElement);
1311 visitor->trace(m_timeContainer); 1311 visitor->trace(m_timeContainer);
1312 visitor->trace(m_conditions); 1312 visitor->trace(m_conditions);
1313 visitor->trace(m_syncBaseDependents); 1313 visitor->trace(m_syncBaseDependents);
1314 SVGElement::trace(visitor); 1314 SVGElement::trace(visitor);
1315 SVGTests::trace(visitor); 1315 SVGTests::trace(visitor);
1316 } 1316 }
1317 1317
1318 } // namespace blink 1318 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/animation/SVGSMILElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698