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 // FIXME: provide default value if !value or value is initial value | 385 if (value && value->isInitialValue()) |
386 if (value && !value->isInitialValue()) { | 386 continue; |
387 if (!res.isNull()) | 387 if (!value) |
388 res += " "; | 388 return String(); |
389 res += value->cssText(); | 389 if (!res.isNull()) |
390 } | 390 res += " "; |
| 391 res += value->cssText(); |
391 } | 392 } |
392 } | 393 } |
393 return res; | 394 return res; |
394 } | 395 } |
395 | 396 |
396 // only returns a non-null value if all properties have the same, non-null value | 397 // only returns a non-null value if all properties have the same, non-null value |
397 String StylePropertySet::getCommonValue(const CSSPropertyLonghand& longhand) con
st | 398 String StylePropertySet::getCommonValue(const CSSPropertyLonghand& longhand) con
st |
398 { | 399 { |
399 String res; | 400 String res; |
400 for (unsigned i = 0; i < longhand.length(); ++i) { | 401 for (unsigned i = 0; i < longhand.length(); ++i) { |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
993 propertySetCSSOMWrapperMap().get(this)->clearParentElement(); | 994 propertySetCSSOMWrapperMap().get(this)->clearParentElement(); |
994 } | 995 } |
995 | 996 |
996 class SameSizeAsStylePropertySet : public RefCounted<SameSizeAsStylePropertySet>
{ | 997 class SameSizeAsStylePropertySet : public RefCounted<SameSizeAsStylePropertySet>
{ |
997 Vector<CSSProperty, 4> properties; | 998 Vector<CSSProperty, 4> properties; |
998 unsigned bitfield; | 999 unsigned bitfield; |
999 }; | 1000 }; |
1000 COMPILE_ASSERT(sizeof(StylePropertySet) == sizeof(SameSizeAsStylePropertySet), s
tyle_property_set_should_stay_small); | 1001 COMPILE_ASSERT(sizeof(StylePropertySet) == sizeof(SameSizeAsStylePropertySet), s
tyle_property_set_should_stay_small); |
1001 | 1002 |
1002 } // namespace WebCore | 1003 } // namespace WebCore |
OLD | NEW |