Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Side by Side Diff: Source/core/html/HTMLElement.cpp

Issue 23581008: Revert r154797: "Move isValid/isCurrentColor from Color to StyleColor" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
6 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 6 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
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 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 if (attributeValue.isEmpty()) 1056 if (attributeValue.isEmpty())
1057 return; 1057 return;
1058 1058
1059 String colorString = attributeValue.stripWhiteSpace(); 1059 String colorString = attributeValue.stripWhiteSpace();
1060 1060
1061 // "transparent" doesn't apply a color either. 1061 // "transparent" doesn't apply a color either.
1062 if (equalIgnoringCase(colorString, "transparent")) 1062 if (equalIgnoringCase(colorString, "transparent"))
1063 return; 1063 return;
1064 1064
1065 // If the string is a named CSS color or a 3/6-digit hex color, use that. 1065 // If the string is a named CSS color or a 3/6-digit hex color, use that.
1066 StyleColor parsedColor(colorString); 1066 Color parsedColor(colorString);
1067 if (!parsedColor.isValid()) 1067 if (!parsedColor.isValid())
1068 parsedColor = parseColorStringWithCrazyLegacyRules(colorString); 1068 parsedColor.setRGB(parseColorStringWithCrazyLegacyRules(colorString));
1069 1069
1070 style->setProperty(propertyID, cssValuePool().createColorValue(parsedColor.r gb())); 1070 style->setProperty(propertyID, cssValuePool().createColorValue(parsedColor.r gb()));
1071 } 1071 }
1072 1072
1073 void HTMLElement::defaultEventHandler(Event* event) 1073 void HTMLElement::defaultEventHandler(Event* event)
1074 { 1074 {
1075 if (event->type() == eventNames().keypressEvent && event->isKeyboardEvent()) { 1075 if (event->type() == eventNames().keypressEvent && event->isKeyboardEvent()) {
1076 handleKeypressEvent(toKeyboardEvent(event)); 1076 handleKeypressEvent(toKeyboardEvent(event));
1077 if (event->defaultHandled()) 1077 if (event->defaultHandled())
1078 return; 1078 return;
(...skipping 23 matching lines...) Expand all
1102 #ifndef NDEBUG 1102 #ifndef NDEBUG
1103 1103
1104 // For use in the debugger 1104 // For use in the debugger
1105 void dumpInnerHTML(WebCore::HTMLElement*); 1105 void dumpInnerHTML(WebCore::HTMLElement*);
1106 1106
1107 void dumpInnerHTML(WebCore::HTMLElement* element) 1107 void dumpInnerHTML(WebCore::HTMLElement* element)
1108 { 1108 {
1109 printf("%s\n", element->innerHTML().ascii().data()); 1109 printf("%s\n", element->innerHTML().ascii().data());
1110 } 1110 }
1111 #endif 1111 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698