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

Side by Side Diff: Source/core/html/track/TextTrackCue.cpp

Issue 54463002: Make WebVTTParser::collectTimeStamp static (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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 | « no previous file | Source/core/html/track/WebVTTParser.h » ('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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 784
785 bool isPastNode = true; 785 bool isPastNode = true;
786 double currentTimestamp = previousTimestamp; 786 double currentTimestamp = previousTimestamp;
787 if (currentTimestamp > movieTime) 787 if (currentTimestamp > movieTime)
788 isPastNode = false; 788 isPastNode = false;
789 789
790 for (Node* child = root->firstChild(); child; child = NodeTraversal::next(ch ild, root)) { 790 for (Node* child = root->firstChild(); child; child = NodeTraversal::next(ch ild, root)) {
791 if (child->nodeName() == timestampTag) { 791 if (child->nodeName() == timestampTag) {
792 unsigned position = 0; 792 unsigned position = 0;
793 String timestamp = child->nodeValue(); 793 String timestamp = child->nodeValue();
794 double currentTimestamp = WebVTTParser::create(0, document())->colle ctTimeStamp(timestamp, &position); 794 double currentTimestamp = WebVTTParser::collectTimeStamp(timestamp, &position);
795 ASSERT(currentTimestamp != -1); 795 ASSERT(currentTimestamp != -1);
796 796
797 if (currentTimestamp > movieTime) 797 if (currentTimestamp > movieTime)
798 isPastNode = false; 798 isPastNode = false;
799 } 799 }
800 800
801 if (child->isWebVTTElement()) { 801 if (child->isWebVTTElement()) {
802 toWebVTTElement(child)->setIsPastNode(isPastNode); 802 toWebVTTElement(child)->setIsPastNode(isPastNode);
803 // Make an elemenet id match a cue id for style matching purposes. 803 // Make an elemenet id match a cue id for style matching purposes.
804 if (!m_id.isEmpty()) 804 if (!m_id.isEmpty())
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
1227 return false; 1227 return false;
1228 if (m_cueSize != cue.size()) 1228 if (m_cueSize != cue.size())
1229 return false; 1229 return false;
1230 if (align() != cue.align()) 1230 if (align() != cue.align())
1231 return false; 1231 return false;
1232 1232
1233 return true; 1233 return true;
1234 } 1234 }
1235 1235
1236 } // namespace WebCore 1236 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/track/WebVTTParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698