OLD | NEW |
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 case VTTNodeTypeUnderline: | 52 case VTTNodeTypeUnderline: |
53 return uTag; | 53 return uTag; |
54 case VTTNodeTypeRuby: | 54 case VTTNodeTypeRuby: |
55 return rubyTag; | 55 return rubyTag; |
56 case VTTNodeTypeRubyText: | 56 case VTTNodeTypeRubyText: |
57 return rtTag; | 57 return rtTag; |
58 case VTTNodeTypeVoice: | 58 case VTTNodeTypeVoice: |
59 return vTag; | 59 return vTag; |
60 case VTTNodeTypeNone: | 60 case VTTNodeTypeNone: |
61 default: | 61 default: |
62 ASSERT_NOT_REACHED(); | 62 NOTREACHED(); |
63 return cTag; // Make the compiler happy. | 63 return cTag; // Make the compiler happy. |
64 } | 64 } |
65 } | 65 } |
66 | 66 |
67 VTTElement::VTTElement(VTTNodeType nodeType, Document* document) | 67 VTTElement::VTTElement(VTTNodeType nodeType, Document* document) |
68 : Element(nodeTypeToTagName(nodeType), document, CreateElement) | 68 : Element(nodeTypeToTagName(nodeType), document, CreateElement) |
69 , m_isPastNode(0) | 69 , m_isPastNode(0) |
70 , m_webVTTNodeType(nodeType) | 70 , m_webVTTNodeType(nodeType) |
71 { | 71 { |
72 } | 72 } |
(...skipping 30 matching lines...) Expand all Loading... |
103 case VTTNodeTypeUnderline: | 103 case VTTNodeTypeUnderline: |
104 htmlElement = HTMLElementFactory::createHTMLElement(HTMLNames::uTag.loca
lName(), document); | 104 htmlElement = HTMLElementFactory::createHTMLElement(HTMLNames::uTag.loca
lName(), document); |
105 break; | 105 break; |
106 case VTTNodeTypeRuby: | 106 case VTTNodeTypeRuby: |
107 htmlElement = HTMLElementFactory::createHTMLElement(HTMLNames::rubyTag.l
ocalName(), document); | 107 htmlElement = HTMLElementFactory::createHTMLElement(HTMLNames::rubyTag.l
ocalName(), document); |
108 break; | 108 break; |
109 case VTTNodeTypeRubyText: | 109 case VTTNodeTypeRubyText: |
110 htmlElement = HTMLElementFactory::createHTMLElement(HTMLNames::rtTag.loc
alName(), document); | 110 htmlElement = HTMLElementFactory::createHTMLElement(HTMLNames::rtTag.loc
alName(), document); |
111 break; | 111 break; |
112 default: | 112 default: |
113 ASSERT_NOT_REACHED(); | 113 NOTREACHED(); |
114 } | 114 } |
115 | 115 |
116 htmlElement->setAttribute(HTMLNames::classAttr, getAttribute(HTMLNames::clas
sAttr)); | 116 htmlElement->setAttribute(HTMLNames::classAttr, getAttribute(HTMLNames::clas
sAttr)); |
117 return htmlElement; | 117 return htmlElement; |
118 } | 118 } |
119 | 119 |
120 void VTTElement::setIsPastNode(bool isPastNode) | 120 void VTTElement::setIsPastNode(bool isPastNode) |
121 { | 121 { |
122 if (!!m_isPastNode == isPastNode) | 122 if (!!m_isPastNode == isPastNode) |
123 return; | 123 return; |
124 | 124 |
125 m_isPastNode = isPastNode; | 125 m_isPastNode = isPastNode; |
126 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::createWit
hExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Past)); | 126 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::createWit
hExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Past)); |
127 } | 127 } |
128 | 128 |
129 } // namespace blink | 129 } // namespace blink |
OLD | NEW |