| OLD | NEW |
| 1 /* | 1 /* |
| 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. |
| 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. | 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 } | 375 } |
| 376 return res; | 376 return res; |
| 377 } | 377 } |
| 378 | 378 |
| 379 String StylePropertySet::getShorthandValue(const CSSPropertyLonghand& longhand)
const | 379 String StylePropertySet::getShorthandValue(const CSSPropertyLonghand& longhand)
const |
| 380 { | 380 { |
| 381 String res; | 381 String res; |
| 382 for (unsigned i = 0; i < longhand.length(); ++i) { | 382 for (unsigned i = 0; i < longhand.length(); ++i) { |
| 383 if (!isPropertyImplicit(longhand.properties()[i])) { | 383 if (!isPropertyImplicit(longhand.properties()[i])) { |
| 384 RefPtr<CSSValue> value = getPropertyCSSValue(longhand.properties()[i
]); | 384 RefPtr<CSSValue> value = getPropertyCSSValue(longhand.properties()[i
]); |
| 385 if (value && value->isInitialValue()) | 385 // FIXME: provide default value if !value or value is initial value |
| 386 continue; | 386 if (value && !value->isInitialValue()) { |
| 387 if (!value) | 387 if (!res.isNull()) |
| 388 return String(); | 388 res += " "; |
| 389 if (!res.isNull()) | 389 res += value->cssText(); |
| 390 res += " "; | 390 } |
| 391 res += value->cssText(); | |
| 392 } | 391 } |
| 393 } | 392 } |
| 394 return res; | 393 return res; |
| 395 } | 394 } |
| 396 | 395 |
| 397 // only returns a non-null value if all properties have the same, non-null value | 396 // only returns a non-null value if all properties have the same, non-null value |
| 398 String StylePropertySet::getCommonValue(const CSSPropertyLonghand& longhand) con
st | 397 String StylePropertySet::getCommonValue(const CSSPropertyLonghand& longhand) con
st |
| 399 { | 398 { |
| 400 String res; | 399 String res; |
| 401 for (unsigned i = 0; i < longhand.length(); ++i) { | 400 for (unsigned i = 0; i < longhand.length(); ++i) { |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 propertySetCSSOMWrapperMap().get(this)->clearParentElement(); | 993 propertySetCSSOMWrapperMap().get(this)->clearParentElement(); |
| 995 } | 994 } |
| 996 | 995 |
| 997 class SameSizeAsStylePropertySet : public RefCounted<SameSizeAsStylePropertySet>
{ | 996 class SameSizeAsStylePropertySet : public RefCounted<SameSizeAsStylePropertySet>
{ |
| 998 Vector<CSSProperty, 4> properties; | 997 Vector<CSSProperty, 4> properties; |
| 999 unsigned bitfield; | 998 unsigned bitfield; |
| 1000 }; | 999 }; |
| 1001 COMPILE_ASSERT(sizeof(StylePropertySet) == sizeof(SameSizeAsStylePropertySet), s
tyle_property_set_should_stay_small); | 1000 COMPILE_ASSERT(sizeof(StylePropertySet) == sizeof(SameSizeAsStylePropertySet), s
tyle_property_set_should_stay_small); |
| 1002 | 1001 |
| 1003 } // namespace WebCore | 1002 } // namespace WebCore |
| OLD | NEW |