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

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

Issue 23890025: WIP (Introduce WTF::NonNullPtr<T>.) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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
« no previous file with comments | « Source/core/svg/SVGViewSpec.cpp ('k') | Source/core/testing/Internals.cpp » ('j') | 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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 beginListChanged(elapsed()); 521 beginListChanged(elapsed());
522 else if (attrName == SVGNames::endAttr) 522 else if (attrName == SVGNames::endAttr)
523 endListChanged(elapsed()); 523 endListChanged(elapsed());
524 } 524 }
525 525
526 animationAttributeChanged(); 526 animationAttributeChanged();
527 } 527 }
528 528
529 inline Element* SVGSMILElement::eventBaseFor(const Condition& condition) 529 inline Element* SVGSMILElement::eventBaseFor(const Condition& condition)
530 { 530 {
531 return condition.m_baseID.isEmpty() ? targetElement() : treeScope().getEleme ntById(condition.m_baseID); 531 return condition.m_baseID.isEmpty() ? targetElement() : treeScope()->getElem entById(condition.m_baseID);
532 } 532 }
533 533
534 void SVGSMILElement::connectConditions() 534 void SVGSMILElement::connectConditions()
535 { 535 {
536 if (m_conditionsConnected) 536 if (m_conditionsConnected)
537 disconnectConditions(); 537 disconnectConditions();
538 m_conditionsConnected = true; 538 m_conditionsConnected = true;
539 for (unsigned n = 0; n < m_conditions.size(); ++n) { 539 for (unsigned n = 0; n < m_conditions.size(); ++n) {
540 Condition& condition = m_conditions[n]; 540 Condition& condition = m_conditions[n];
541 if (condition.m_type == Condition::EventBase) { 541 if (condition.m_type == Condition::EventBase) {
542 ASSERT(!condition.m_syncbase); 542 ASSERT(!condition.m_syncbase);
543 Element* eventBase = eventBaseFor(condition); 543 Element* eventBase = eventBaseFor(condition);
544 if (!eventBase) 544 if (!eventBase)
545 continue; 545 continue;
546 ASSERT(!condition.m_eventListener); 546 ASSERT(!condition.m_eventListener);
547 condition.m_eventListener = ConditionEventListener::create(this, &co ndition); 547 condition.m_eventListener = ConditionEventListener::create(this, &co ndition);
548 eventBase->addEventListener(condition.m_name, condition.m_eventListe ner, false); 548 eventBase->addEventListener(condition.m_name, condition.m_eventListe ner, false);
549 } else if (condition.m_type == Condition::Syncbase) { 549 } else if (condition.m_type == Condition::Syncbase) {
550 ASSERT(!condition.m_baseID.isEmpty()); 550 ASSERT(!condition.m_baseID.isEmpty());
551 condition.m_syncbase = treeScope().getElementById(condition.m_baseID ); 551 condition.m_syncbase = treeScope()->getElementById(condition.m_baseI D);
552 if (!isSMILElement(condition.m_syncbase.get())) { 552 if (!isSMILElement(condition.m_syncbase.get())) {
553 condition.m_syncbase = 0; 553 condition.m_syncbase = 0;
554 continue; 554 continue;
555 } 555 }
556 toSVGSMILElement(condition.m_syncbase.get())->addTimeDependent(this) ; 556 toSVGSMILElement(condition.m_syncbase.get())->addTimeDependent(this) ;
557 } 557 }
558 } 558 }
559 } 559 }
560 560
561 void SVGSMILElement::disconnectConditions() 561 void SVGSMILElement::disconnectConditions()
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
1241 if (eventType == "repeatn") { 1241 if (eventType == "repeatn") {
1242 unsigned repeatEventCount = m_repeatEventCountList.first(); 1242 unsigned repeatEventCount = m_repeatEventCountList.first();
1243 m_repeatEventCountList.remove(0); 1243 m_repeatEventCountList.remove(0);
1244 dispatchEvent(Event::create(String("repeat(" + String::number(repeatEven tCount) + ")"))); 1244 dispatchEvent(Event::create(String("repeat(" + String::number(repeatEven tCount) + ")")));
1245 } else { 1245 } else {
1246 dispatchEvent(Event::create(eventType)); 1246 dispatchEvent(Event::create(eventType));
1247 } 1247 }
1248 } 1248 }
1249 1249
1250 } 1250 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGViewSpec.cpp ('k') | Source/core/testing/Internals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698