| OLD | NEW |
| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 if (!owner) | 261 if (!owner) |
| 262 return InsertionDone; | 262 return InsertionDone; |
| 263 | 263 |
| 264 m_timeContainer = owner->timeContainer(); | 264 m_timeContainer = owner->timeContainer(); |
| 265 ASSERT(m_timeContainer); | 265 ASSERT(m_timeContainer); |
| 266 m_timeContainer->setDocumentOrderIndexesDirty(); | 266 m_timeContainer->setDocumentOrderIndexesDirty(); |
| 267 | 267 |
| 268 // "If no attribute is present, the default begin value (an offset-value of 0) | 268 // "If no attribute is present, the default begin value (an offset-value of 0) |
| 269 // must be evaluated." | 269 // must be evaluated." |
| 270 if (!fastHasAttribute(SVGNames::beginAttr)) | 270 if (!fastHasAttribute(SVGNames::beginAttr)) |
| 271 m_beginTimes.append(SMILTimeWithOrigin()); | 271 m_beginTimes.push_back(SMILTimeWithOrigin()); |
| 272 | 272 |
| 273 if (m_isWaitingForFirstInterval) | 273 if (m_isWaitingForFirstInterval) |
| 274 resolveFirstInterval(); | 274 resolveFirstInterval(); |
| 275 | 275 |
| 276 if (m_timeContainer) | 276 if (m_timeContainer) |
| 277 m_timeContainer->notifyIntervalsChanged(); | 277 m_timeContainer->notifyIntervalsChanged(); |
| 278 | 278 |
| 279 buildPendingResource(); | 279 buildPendingResource(); |
| 280 | 280 |
| 281 return InsertionDone; | 281 return InsertionDone; |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 UseCounter::count(&document(), UseCounter::SVGSMILBeginOrEndSyncbaseValue); | 405 UseCounter::count(&document(), UseCounter::SVGSMILBeginOrEndSyncbaseValue); |
| 406 type = Condition::Syncbase; | 406 type = Condition::Syncbase; |
| 407 } else if (nameString.startsWith("accesskey(")) { | 407 } else if (nameString.startsWith("accesskey(")) { |
| 408 // FIXME: accesskey() support. | 408 // FIXME: accesskey() support. |
| 409 type = Condition::AccessKey; | 409 type = Condition::AccessKey; |
| 410 } else { | 410 } else { |
| 411 UseCounter::count(&document(), UseCounter::SVGSMILBeginOrEndEventValue); | 411 UseCounter::count(&document(), UseCounter::SVGSMILBeginOrEndEventValue); |
| 412 type = Condition::EventBase; | 412 type = Condition::EventBase; |
| 413 } | 413 } |
| 414 | 414 |
| 415 m_conditions.append( | 415 m_conditions.push_back( |
| 416 Condition::create(type, beginOrEnd, baseID, nameString, offset, repeat)); | 416 Condition::create(type, beginOrEnd, baseID, nameString, offset, repeat)); |
| 417 | 417 |
| 418 if (type == Condition::EventBase && beginOrEnd == End) | 418 if (type == Condition::EventBase && beginOrEnd == End) |
| 419 m_hasEndEventConditions = true; | 419 m_hasEndEventConditions = true; |
| 420 | 420 |
| 421 return true; | 421 return true; |
| 422 } | 422 } |
| 423 | 423 |
| 424 void SVGSMILElement::parseBeginOrEnd(const String& parseString, | 424 void SVGSMILElement::parseBeginOrEnd(const String& parseString, |
| 425 BeginOrEnd beginOrEnd) { | 425 BeginOrEnd beginOrEnd) { |
| 426 Vector<SMILTimeWithOrigin>& timeList = | 426 Vector<SMILTimeWithOrigin>& timeList = |
| 427 beginOrEnd == Begin ? m_beginTimes : m_endTimes; | 427 beginOrEnd == Begin ? m_beginTimes : m_endTimes; |
| 428 if (beginOrEnd == End) | 428 if (beginOrEnd == End) |
| 429 m_hasEndEventConditions = false; | 429 m_hasEndEventConditions = false; |
| 430 HashSet<SMILTime> existing; | 430 HashSet<SMILTime> existing; |
| 431 for (unsigned n = 0; n < timeList.size(); ++n) { | 431 for (unsigned n = 0; n < timeList.size(); ++n) { |
| 432 if (!timeList[n].time().isUnresolved()) | 432 if (!timeList[n].time().isUnresolved()) |
| 433 existing.add(timeList[n].time().value()); | 433 existing.add(timeList[n].time().value()); |
| 434 } | 434 } |
| 435 Vector<String> splitString; | 435 Vector<String> splitString; |
| 436 parseString.split(';', splitString); | 436 parseString.split(';', splitString); |
| 437 for (unsigned n = 0; n < splitString.size(); ++n) { | 437 for (unsigned n = 0; n < splitString.size(); ++n) { |
| 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.append( | 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 QualifiedName& name, |
| 449 const AtomicString& oldValue, | 449 const AtomicString& oldValue, |
| 450 const AtomicString& value) { | 450 const AtomicString& value) { |
| 451 if (name == SVGNames::beginAttr) { | 451 if (name == SVGNames::beginAttr) { |
| 452 if (!m_conditions.isEmpty()) { | 452 if (!m_conditions.isEmpty()) { |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 return m_cachedMin = (result.isUnresolved() || result < 0) ? 0 : result; | 707 return m_cachedMin = (result.isUnresolved() || result < 0) ? 0 : result; |
| 708 } | 708 } |
| 709 | 709 |
| 710 SMILTime SVGSMILElement::simpleDuration() const { | 710 SMILTime SVGSMILElement::simpleDuration() const { |
| 711 return std::min(dur(), SMILTime::indefinite()); | 711 return std::min(dur(), SMILTime::indefinite()); |
| 712 } | 712 } |
| 713 | 713 |
| 714 void SVGSMILElement::addBeginTime(SMILTime eventTime, | 714 void SVGSMILElement::addBeginTime(SMILTime eventTime, |
| 715 SMILTime beginTime, | 715 SMILTime beginTime, |
| 716 SMILTimeWithOrigin::Origin origin) { | 716 SMILTimeWithOrigin::Origin origin) { |
| 717 m_beginTimes.append(SMILTimeWithOrigin(beginTime, origin)); | 717 m_beginTimes.push_back(SMILTimeWithOrigin(beginTime, origin)); |
| 718 sortTimeList(m_beginTimes); | 718 sortTimeList(m_beginTimes); |
| 719 beginListChanged(eventTime); | 719 beginListChanged(eventTime); |
| 720 } | 720 } |
| 721 | 721 |
| 722 void SVGSMILElement::addEndTime(SMILTime eventTime, | 722 void SVGSMILElement::addEndTime(SMILTime eventTime, |
| 723 SMILTime endTime, | 723 SMILTime endTime, |
| 724 SMILTimeWithOrigin::Origin origin) { | 724 SMILTimeWithOrigin::Origin origin) { |
| 725 m_endTimes.append(SMILTimeWithOrigin(endTime, origin)); | 725 m_endTimes.push_back(SMILTimeWithOrigin(endTime, origin)); |
| 726 sortTimeList(m_endTimes); | 726 sortTimeList(m_endTimes); |
| 727 endListChanged(eventTime); | 727 endListChanged(eventTime); |
| 728 } | 728 } |
| 729 | 729 |
| 730 inline bool compareTimes(const SMILTimeWithOrigin& left, | 730 inline bool compareTimes(const SMILTimeWithOrigin& left, |
| 731 const SMILTimeWithOrigin& right) { | 731 const SMILTimeWithOrigin& right) { |
| 732 return left.time() < right.time(); | 732 return left.time() < right.time(); |
| 733 } | 733 } |
| 734 | 734 |
| 735 SMILTime SVGSMILElement::findInstanceTime(BeginOrEnd beginOrEnd, | 735 SMILTime SVGSMILElement::findInstanceTime(BeginOrEnd beginOrEnd, |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1243 return; | 1243 return; |
| 1244 addBeginTime(elapsed, elapsed); | 1244 addBeginTime(elapsed, elapsed); |
| 1245 } | 1245 } |
| 1246 | 1246 |
| 1247 void SVGSMILElement::endedActiveInterval() { | 1247 void SVGSMILElement::endedActiveInterval() { |
| 1248 clearTimesWithDynamicOrigins(m_beginTimes); | 1248 clearTimesWithDynamicOrigins(m_beginTimes); |
| 1249 clearTimesWithDynamicOrigins(m_endTimes); | 1249 clearTimesWithDynamicOrigins(m_endTimes); |
| 1250 } | 1250 } |
| 1251 | 1251 |
| 1252 void SVGSMILElement::scheduleRepeatEvents(unsigned count) { | 1252 void SVGSMILElement::scheduleRepeatEvents(unsigned count) { |
| 1253 m_repeatEventCountList.append(count); | 1253 m_repeatEventCountList.push_back(count); |
| 1254 scheduleEvent(EventTypeNames::repeatEvent); | 1254 scheduleEvent(EventTypeNames::repeatEvent); |
| 1255 scheduleEvent(AtomicString("repeatn")); | 1255 scheduleEvent(AtomicString("repeatn")); |
| 1256 } | 1256 } |
| 1257 | 1257 |
| 1258 void SVGSMILElement::scheduleEvent(const AtomicString& eventType) { | 1258 void SVGSMILElement::scheduleEvent(const AtomicString& eventType) { |
| 1259 TaskRunnerHelper::get(TaskType::DOMManipulation, &document()) | 1259 TaskRunnerHelper::get(TaskType::DOMManipulation, &document()) |
| 1260 ->postTask(BLINK_FROM_HERE, | 1260 ->postTask(BLINK_FROM_HERE, |
| 1261 WTF::bind(&SVGSMILElement::dispatchPendingEvent, | 1261 WTF::bind(&SVGSMILElement::dispatchPendingEvent, |
| 1262 wrapPersistent(this), eventType)); | 1262 wrapPersistent(this), eventType)); |
| 1263 } | 1263 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |