| 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 (!HTMLElement::parseColorWithLegacyRules(stringValue, color)) |
| 99 document().textLinkColors().setLinkColor(color); | 99 return; |
| 100 else if (name == vlinkAttr) | 100 |
| 101 document().textLinkColors().setVisitedLinkColor(color); | 101 if (name == linkAttr) |
| 102 else | 102 document().textLinkColors().setLinkColor(color); |
| 103 document().textLinkColors().setActiveLinkColor(color); | 103 else if (name == vlinkAttr) |
| 104 } | 104 document().textLinkColors().setVisitedLinkColor(color); |
| 105 else |
| 106 document().textLinkColors().setActiveLinkColor(color); |
| 105 } | 107 } |
| 106 | 108 |
| 107 setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::cre
ate(StyleChangeReason::LinkColorChange)); | 109 setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::cre
ate(StyleChangeReason::LinkColorChange)); |
| 108 } else if (name == onloadAttr) { | 110 } else if (name == onloadAttr) { |
| 109 document().setWindowAttributeEventListener(EventTypeNames::load, createA
ttributeEventListener(document().frame(), name, value, eventParameterName())); | 111 document().setWindowAttributeEventListener(EventTypeNames::load, createA
ttributeEventListener(document().frame(), name, value, eventParameterName())); |
| 110 } else if (name == onbeforeunloadAttr) { | 112 } else if (name == onbeforeunloadAttr) { |
| 111 document().setWindowAttributeEventListener(EventTypeNames::beforeunload,
createAttributeEventListener(document().frame(), name, value, eventParameterNam
e())); | 113 document().setWindowAttributeEventListener(EventTypeNames::beforeunload,
createAttributeEventListener(document().frame(), name, value, eventParameterNam
e())); |
| 112 } else if (name == onunloadAttr) { | 114 } else if (name == onunloadAttr) { |
| 113 document().setWindowAttributeEventListener(EventTypeNames::unload, creat
eAttributeEventListener(document().frame(), name, value, eventParameterName())); | 115 document().setWindowAttributeEventListener(EventTypeNames::unload, creat
eAttributeEventListener(document().frame(), name, value, eventParameterName())); |
| 114 } else if (name == onpagehideAttr) { | 116 } else if (name == onpagehideAttr) { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 } | 187 } |
| 186 | 188 |
| 187 bool HTMLBodyElement::supportsFocus() const | 189 bool HTMLBodyElement::supportsFocus() const |
| 188 { | 190 { |
| 189 // This override is needed because the inherited method bails if the parent
is editable. | 191 // 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. | 192 // The <body> should be focusable even if <html> is editable. |
| 191 return hasEditableStyle() || HTMLElement::supportsFocus(); | 193 return hasEditableStyle() || HTMLElement::supportsFocus(); |
| 192 } | 194 } |
| 193 | 195 |
| 194 } // namespace blink | 196 } // namespace blink |
| OLD | NEW |