| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 StyleSheetCandidate::Type StyleSheetCandidate::typeOf(Node& node) { | 102 StyleSheetCandidate::Type StyleSheetCandidate::typeOf(Node& node) { |
| 103 if (node.getNodeType() == Node::kProcessingInstructionNode) | 103 if (node.getNodeType() == Node::kProcessingInstructionNode) |
| 104 return Pi; | 104 return Pi; |
| 105 | 105 |
| 106 if (node.isHTMLElement()) { | 106 if (node.isHTMLElement()) { |
| 107 if (isHTMLLinkElement(node)) | 107 if (isHTMLLinkElement(node)) |
| 108 return HTMLLink; | 108 return HTMLLink; |
| 109 if (isHTMLStyleElement(node)) | 109 if (isHTMLStyleElement(node)) |
| 110 return HTMLStyle; | 110 return HTMLStyle; |
| 111 | 111 |
| 112 ASSERT_NOT_REACHED(); | 112 NOTREACHED(); |
| 113 return HTMLStyle; | 113 return HTMLStyle; |
| 114 } | 114 } |
| 115 | 115 |
| 116 if (isSVGStyleElement(node)) | 116 if (isSVGStyleElement(node)) |
| 117 return SVGStyle; | 117 return SVGStyle; |
| 118 | 118 |
| 119 ASSERT_NOT_REACHED(); | 119 NOTREACHED(); |
| 120 return HTMLStyle; | 120 return HTMLStyle; |
| 121 } | 121 } |
| 122 | 122 |
| 123 StyleSheet* StyleSheetCandidate::sheet() const { | 123 StyleSheet* StyleSheetCandidate::sheet() const { |
| 124 switch (m_type) { | 124 switch (m_type) { |
| 125 case HTMLLink: | 125 case HTMLLink: |
| 126 return toHTMLLinkElement(node()).sheet(); | 126 return toHTMLLinkElement(node()).sheet(); |
| 127 case HTMLStyle: | 127 case HTMLStyle: |
| 128 return toHTMLStyleElement(node()).sheet(); | 128 return toHTMLStyleElement(node()).sheet(); |
| 129 case SVGStyle: | 129 case SVGStyle: |
| 130 return toSVGStyleElement(node()).sheet(); | 130 return toSVGStyleElement(node()).sheet(); |
| 131 case Pi: | 131 case Pi: |
| 132 return toProcessingInstruction(node()).sheet(); | 132 return toProcessingInstruction(node()).sheet(); |
| 133 } | 133 } |
| 134 | 134 |
| 135 ASSERT_NOT_REACHED(); | 135 NOTREACHED(); |
| 136 return 0; | 136 return 0; |
| 137 } | 137 } |
| 138 | 138 |
| 139 } // namespace blink | 139 } // namespace blink |
| OLD | NEW |