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

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

Issue 23886003: Have HTMLElements / SVGElements constructors take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Another Android build fix 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/html/track/TextTrackCue.cpp ('k') | Source/core/page/DragController.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) 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2013 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 18 matching lines...) Expand all
29 #include "CSSPropertyNames.h" 29 #include "CSSPropertyNames.h"
30 #include "CSSValueKeywords.h" 30 #include "CSSValueKeywords.h"
31 #include "bindings/v8/ExceptionStatePlaceholder.h" 31 #include "bindings/v8/ExceptionStatePlaceholder.h"
32 #include "core/html/HTMLDivElement.h" 32 #include "core/html/HTMLDivElement.h"
33 #include "core/html/track/TextTrackCue.h" 33 #include "core/html/track/TextTrackCue.h"
34 34
35 namespace WebCore { 35 namespace WebCore {
36 36
37 class TextTrackCueGenericBoxElement FINAL : public TextTrackCueBox { 37 class TextTrackCueGenericBoxElement FINAL : public TextTrackCueBox {
38 public: 38 public:
39 static PassRefPtr<TextTrackCueGenericBoxElement> create(Document* document, TextTrackCueGeneric* cue) 39 static PassRefPtr<TextTrackCueGenericBoxElement> create(Document& document, TextTrackCueGeneric* cue)
40 { 40 {
41 return adoptRef(new TextTrackCueGenericBoxElement(document, cue)); 41 return adoptRef(new TextTrackCueGenericBoxElement(document, cue));
42 } 42 }
43 43
44 virtual void applyCSSProperties(const IntSize&) OVERRIDE; 44 virtual void applyCSSProperties(const IntSize&) OVERRIDE;
45 45
46 private: 46 private:
47 TextTrackCueGenericBoxElement(Document*, TextTrackCue*); 47 TextTrackCueGenericBoxElement(Document&, TextTrackCue*);
48 }; 48 };
49 49
50 TextTrackCueGenericBoxElement::TextTrackCueGenericBoxElement(Document* document, TextTrackCue* cue) 50 TextTrackCueGenericBoxElement::TextTrackCueGenericBoxElement(Document& document, TextTrackCue* cue)
51 : TextTrackCueBox(document, cue) 51 : TextTrackCueBox(document, cue)
52 { 52 {
53 } 53 }
54 54
55 void TextTrackCueGenericBoxElement::applyCSSProperties(const IntSize& videoSize) 55 void TextTrackCueGenericBoxElement::applyCSSProperties(const IntSize& videoSize)
56 { 56 {
57 setInlineStyleProperty(CSSPropertyPosition, CSSValueAbsolute); 57 setInlineStyleProperty(CSSPropertyPosition, CSSValueAbsolute);
58 setInlineStyleProperty(CSSPropertyUnicodeBidi, CSSValueWebkitPlaintext); 58 setInlineStyleProperty(CSSPropertyUnicodeBidi, CSSValueWebkitPlaintext);
59 59
60 TextTrackCueGeneric* cue = static_cast<TextTrackCueGeneric*>(getCue()); 60 TextTrackCueGeneric* cue = static_cast<TextTrackCueGeneric*>(getCue());
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 TextTrackCueGeneric::TextTrackCueGeneric(ScriptExecutionContext* context, double start, double end, const String& content) 106 TextTrackCueGeneric::TextTrackCueGeneric(ScriptExecutionContext* context, double start, double end, const String& content)
107 : TextTrackCue(context, start, end, content) 107 : TextTrackCue(context, start, end, content)
108 , m_baseFontSizeRelativeToVideoHeight(0) 108 , m_baseFontSizeRelativeToVideoHeight(0)
109 , m_fontSizeMultiplier(0) 109 , m_fontSizeMultiplier(0)
110 , m_defaultPosition(true) 110 , m_defaultPosition(true)
111 { 111 {
112 } 112 }
113 113
114 PassRefPtr<TextTrackCueBox> TextTrackCueGeneric::createDisplayTree() 114 PassRefPtr<TextTrackCueBox> TextTrackCueGeneric::createDisplayTree()
115 { 115 {
116 return TextTrackCueGenericBoxElement::create(ownerDocument(), this); 116 ASSERT(ownerDocument());
117 return TextTrackCueGenericBoxElement::create(*ownerDocument(), this);
117 } 118 }
118 119
119 void TextTrackCueGeneric::setLine(int line, ExceptionState& es) 120 void TextTrackCueGeneric::setLine(int line, ExceptionState& es)
120 { 121 {
121 m_defaultPosition = false; 122 m_defaultPosition = false;
122 TextTrackCue::setLine(line, es); 123 TextTrackCue::setLine(line, es);
123 } 124 }
124 125
125 void TextTrackCueGeneric::setPosition(int position, ExceptionState& es) 126 void TextTrackCueGeneric::setPosition(int position, ExceptionState& es)
126 { 127 {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 if (m_foregroundColor != other->foregroundColor()) 159 if (m_foregroundColor != other->foregroundColor())
159 return false; 160 return false;
160 if (m_backgroundColor != other->backgroundColor()) 161 if (m_backgroundColor != other->backgroundColor())
161 return false; 162 return false;
162 163
163 return TextTrackCue::operator==(cue); 164 return TextTrackCue::operator==(cue);
164 } 165 }
165 166
166 } // namespace WebCore 167 } // namespace WebCore
167 168
OLDNEW
« no previous file with comments | « Source/core/html/track/TextTrackCue.cpp ('k') | Source/core/page/DragController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698