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) 2001 Peter Kelly (pmk@post.com) | 4 * (C) 2001 Peter Kelly (pmk@post.com) |
5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
6 * (C) 2007 David Smith (catfish.man@gmail.com) | 6 * (C) 2007 David Smith (catfish.man@gmail.com) |
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. |
8 * (C) 2007 Eric Seidel (eric@webkit.org) | 8 * (C) 2007 Eric Seidel (eric@webkit.org) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 3086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3097 return true; | 3097 return true; |
3098 } | 3098 } |
3099 return false; | 3099 return false; |
3100 } | 3100 } |
3101 | 3101 |
3102 static void reResolveURLsInInlineStyle(const Document& document, MutableStylePro
pertySet& style) | 3102 static void reResolveURLsInInlineStyle(const Document& document, MutableStylePro
pertySet& style) |
3103 { | 3103 { |
3104 for (unsigned i = 0; i < style.propertyCount(); ++i) { | 3104 for (unsigned i = 0; i < style.propertyCount(); ++i) { |
3105 StylePropertySet::PropertyReference property = style.propertyAt(i); | 3105 StylePropertySet::PropertyReference property = style.propertyAt(i); |
3106 // FIXME: Should handle all URL-based properties: CSSImageSetValue, CSSC
ursorImageValue, etc. | 3106 // FIXME: Should handle all URL-based properties: CSSImageSetValue, CSSC
ursorImageValue, etc. |
3107 if (property.value()->isImageValue()) | 3107 if (property.value()->isImageValue()) { |
3108 toCSSImageValue(property.value())->reResolveURL(document); | 3108 const CSSImageValue& image = toCSSImageValue(*property.value()); |
| 3109 String relativeUrl = image.relativeUrl(); |
| 3110 String absoluteUrl = image.url(); |
| 3111 if (document.completeURL(relativeUrl) == absoluteUrl) |
| 3112 continue; |
| 3113 style.removeProperty(property.id()); |
| 3114 style.setProperty(property.id(), CSSImageValue::create(relativeUrl,
absoluteUrl)); |
| 3115 } |
3109 } | 3116 } |
3110 } | 3117 } |
3111 | 3118 |
3112 void Element::didMoveToNewDocument(Document& oldDocument) | 3119 void Element::didMoveToNewDocument(Document& oldDocument) |
3113 { | 3120 { |
3114 Node::didMoveToNewDocument(oldDocument); | 3121 Node::didMoveToNewDocument(oldDocument); |
3115 | 3122 |
3116 // If the documents differ by quirks mode then they differ by case sensitivi
ty | 3123 // If the documents differ by quirks mode then they differ by case sensitivi
ty |
3117 // for class and id names so we need to go through the attribute change logi
c | 3124 // for class and id names so we need to go through the attribute change logi
c |
3118 // to pick up the new casing in the ElementData. | 3125 // to pick up the new casing in the ElementData. |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3497 { | 3504 { |
3498 #if ENABLE(OILPAN) | 3505 #if ENABLE(OILPAN) |
3499 if (hasRareData()) | 3506 if (hasRareData()) |
3500 visitor->trace(elementRareData()); | 3507 visitor->trace(elementRareData()); |
3501 visitor->trace(m_elementData); | 3508 visitor->trace(m_elementData); |
3502 #endif | 3509 #endif |
3503 ContainerNode::trace(visitor); | 3510 ContainerNode::trace(visitor); |
3504 } | 3511 } |
3505 | 3512 |
3506 } // namespace blink | 3513 } // namespace blink |
OLD | NEW |