| 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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 #include "sky/engine/core/dom/Element.h" | 30 #include "sky/engine/core/dom/Element.h" |
| 31 #include "sky/engine/core/dom/StyleEngine.h" | 31 #include "sky/engine/core/dom/StyleEngine.h" |
| 32 #include "sky/engine/core/html/HTMLStyleElement.h" | 32 #include "sky/engine/core/html/HTMLStyleElement.h" |
| 33 #include "sky/engine/core/html/imports/HTMLImport.h" | 33 #include "sky/engine/core/html/imports/HTMLImport.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 bool StyleSheetCandidate::canBeActivated() const | 37 bool StyleSheetCandidate::canBeActivated() const |
| 38 { | 38 { |
| 39 StyleSheet* sheet = this->sheet(); | 39 // TODO(esprehn): Remove this. |
| 40 return sheet && sheet->isCSSStyleSheet(); | 40 CSSStyleSheet* sheet = this->sheet(); |
| 41 return sheet; |
| 41 } | 42 } |
| 42 | 43 |
| 43 StyleSheetCandidate::Type StyleSheetCandidate::typeOf(Node& node) | 44 StyleSheetCandidate::Type StyleSheetCandidate::typeOf(Node& node) |
| 44 { | 45 { |
| 45 if (node.isHTMLElement()) { | 46 if (node.isHTMLElement()) { |
| 46 if (isHTMLStyleElement(node)) | 47 if (isHTMLStyleElement(node)) |
| 47 return HTMLStyle; | 48 return HTMLStyle; |
| 48 | 49 |
| 49 ASSERT_NOT_REACHED(); | 50 ASSERT_NOT_REACHED(); |
| 50 return HTMLStyle; | 51 return HTMLStyle; |
| 51 } | 52 } |
| 52 | 53 |
| 53 ASSERT_NOT_REACHED(); | 54 ASSERT_NOT_REACHED(); |
| 54 return HTMLStyle; | 55 return HTMLStyle; |
| 55 } | 56 } |
| 56 | 57 |
| 57 StyleSheet* StyleSheetCandidate::sheet() const | 58 CSSStyleSheet* StyleSheetCandidate::sheet() const |
| 58 { | 59 { |
| 59 switch (m_type) { | 60 switch (m_type) { |
| 60 case HTMLStyle: | 61 case HTMLStyle: |
| 61 return toHTMLStyleElement(node()).sheet(); | 62 return toHTMLStyleElement(node()).sheet(); |
| 62 } | 63 } |
| 63 | 64 |
| 64 ASSERT_NOT_REACHED(); | 65 ASSERT_NOT_REACHED(); |
| 65 return 0; | 66 return 0; |
| 66 } | 67 } |
| 67 | 68 |
| 68 } | 69 } |
| OLD | NEW |