Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Simon Hausmann (hausmann@kde.org) | 4 * (C) 2000 Simon Hausmann (hausmann@kde.org) |
| 5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 6 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. | 6 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 if (name == vlinkAttr || name == alinkAttr || name == linkAttr) { | 87 if (name == vlinkAttr || name == alinkAttr || name == linkAttr) { |
| 88 if (value.isNull()) { | 88 if (value.isNull()) { |
| 89 if (name == linkAttr) | 89 if (name == linkAttr) |
| 90 document().textLinkColors().resetLinkColor(); | 90 document().textLinkColors().resetLinkColor(); |
| 91 else if (name == vlinkAttr) | 91 else if (name == vlinkAttr) |
| 92 document().textLinkColors().resetVisitedLinkColor(); | 92 document().textLinkColors().resetVisitedLinkColor(); |
| 93 else | 93 else |
| 94 document().textLinkColors().resetActiveLinkColor(); | 94 document().textLinkColors().resetActiveLinkColor(); |
| 95 } else { | 95 } else { |
| 96 Color color; | 96 Color color; |
| 97 if (CSSParser::parseColor(color, value, !document().inQuirksMode())) { | 97 String stringValue = value; |
| 98 if (name == linkAttr) | 98 if (!CSSParser::parseColor(color, value, !document().inQuirksMode()) |
|
simonp
2016/04/29 13:37:19
Maybe I'm missing something but shouldn't this be
Anton Obzhirov
2016/05/04 13:23:48
Yes, you are right, the value should be parsed usi
| |
| 99 document().textLinkColors().setLinkColor(color); | 99 && !HTMLElement::parseColorWithLegacyRules(stringValue, color)) { |
| 100 else if (name == vlinkAttr) | 100 return; |
| 101 document().textLinkColors().setVisitedLinkColor(color); | |
| 102 else | |
| 103 document().textLinkColors().setActiveLinkColor(color); | |
| 104 } | 101 } |
| 102 | |
| 103 if (name == linkAttr) | |
| 104 document().textLinkColors().setLinkColor(color); | |
| 105 else if (name == vlinkAttr) | |
| 106 document().textLinkColors().setVisitedLinkColor(color); | |
| 107 else | |
| 108 document().textLinkColors().setActiveLinkColor(color); | |
| 105 } | 109 } |
| 106 | 110 |
| 107 setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::cre ate(StyleChangeReason::LinkColorChange)); | 111 setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::cre ate(StyleChangeReason::LinkColorChange)); |
| 108 } else if (name == onloadAttr) { | 112 } else if (name == onloadAttr) { |
| 109 document().setWindowAttributeEventListener(EventTypeNames::load, createA ttributeEventListener(document().frame(), name, value, eventParameterName())); | 113 document().setWindowAttributeEventListener(EventTypeNames::load, createA ttributeEventListener(document().frame(), name, value, eventParameterName())); |
| 110 } else if (name == onbeforeunloadAttr) { | 114 } else if (name == onbeforeunloadAttr) { |
| 111 document().setWindowAttributeEventListener(EventTypeNames::beforeunload, createAttributeEventListener(document().frame(), name, value, eventParameterNam e())); | 115 document().setWindowAttributeEventListener(EventTypeNames::beforeunload, createAttributeEventListener(document().frame(), name, value, eventParameterNam e())); |
| 112 } else if (name == onunloadAttr) { | 116 } else if (name == onunloadAttr) { |
| 113 document().setWindowAttributeEventListener(EventTypeNames::unload, creat eAttributeEventListener(document().frame(), name, value, eventParameterName())); | 117 document().setWindowAttributeEventListener(EventTypeNames::unload, creat eAttributeEventListener(document().frame(), name, value, eventParameterName())); |
| 114 } else if (name == onpagehideAttr) { | 118 } else if (name == onpagehideAttr) { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 185 } | 189 } |
| 186 | 190 |
| 187 bool HTMLBodyElement::supportsFocus() const | 191 bool HTMLBodyElement::supportsFocus() const |
| 188 { | 192 { |
| 189 // This override is needed because the inherited method bails if the parent is editable. | 193 // This override is needed because the inherited method bails if the parent is editable. |
| 190 // The <body> should be focusable even if <html> is editable. | 194 // The <body> should be focusable even if <html> is editable. |
| 191 return hasEditableStyle() || HTMLElement::supportsFocus(); | 195 return hasEditableStyle() || HTMLElement::supportsFocus(); |
| 192 } | 196 } |
| 193 | 197 |
| 194 } // namespace blink | 198 } // namespace blink |
| OLD | NEW |