| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) | 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) |
| 3 * (C) 1997 Torben Weis (weis@kde.org) | 3 * (C) 1997 Torben Weis (weis@kde.org) |
| 4 * (C) 1998 Waldo Bastian (bastian@kde.org) | 4 * (C) 1998 Waldo Bastian (bastian@kde.org) |
| 5 * (C) 1999 Lars Knoll (knoll@kde.org) | 5 * (C) 1999 Lars Knoll (knoll@kde.org) |
| 6 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 6 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010, 2011 Apple Inc. All rights | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010, 2011 Apple Inc. All rights |
| 8 * reserved. | 8 * reserved. |
| 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 static bool GetBordersFromFrameAttributeValue(const AtomicString& value, | 270 static bool GetBordersFromFrameAttributeValue(const AtomicString& value, |
| 271 bool& border_top, | 271 bool& border_top, |
| 272 bool& border_right, | 272 bool& border_right, |
| 273 bool& border_bottom, | 273 bool& border_bottom, |
| 274 bool& border_left) { | 274 bool& border_left) { |
| 275 border_top = false; | 275 border_top = false; |
| 276 border_right = false; | 276 border_right = false; |
| 277 border_bottom = false; | 277 border_bottom = false; |
| 278 border_left = false; | 278 border_left = false; |
| 279 | 279 |
| 280 if (EqualIgnoringCase(value, "above")) | 280 if (DeprecatedEqualIgnoringCase(value, "above")) |
| 281 border_top = true; | 281 border_top = true; |
| 282 else if (EqualIgnoringCase(value, "below")) | 282 else if (DeprecatedEqualIgnoringCase(value, "below")) |
| 283 border_bottom = true; | 283 border_bottom = true; |
| 284 else if (EqualIgnoringCase(value, "hsides")) | 284 else if (DeprecatedEqualIgnoringCase(value, "hsides")) |
| 285 border_top = border_bottom = true; | 285 border_top = border_bottom = true; |
| 286 else if (EqualIgnoringCase(value, "vsides")) | 286 else if (DeprecatedEqualIgnoringCase(value, "vsides")) |
| 287 border_left = border_right = true; | 287 border_left = border_right = true; |
| 288 else if (EqualIgnoringCase(value, "lhs")) | 288 else if (DeprecatedEqualIgnoringCase(value, "lhs")) |
| 289 border_left = true; | 289 border_left = true; |
| 290 else if (EqualIgnoringCase(value, "rhs")) | 290 else if (DeprecatedEqualIgnoringCase(value, "rhs")) |
| 291 border_right = true; | 291 border_right = true; |
| 292 else if (EqualIgnoringCase(value, "box") || | 292 else if (DeprecatedEqualIgnoringCase(value, "box") || |
| 293 EqualIgnoringCase(value, "border")) | 293 DeprecatedEqualIgnoringCase(value, "border")) |
| 294 border_top = border_bottom = border_left = border_right = true; | 294 border_top = border_bottom = border_left = border_right = true; |
| 295 else if (!EqualIgnoringCase(value, "void")) | 295 else if (!DeprecatedEqualIgnoringCase(value, "void")) |
| 296 return false; | 296 return false; |
| 297 return true; | 297 return true; |
| 298 } | 298 } |
| 299 | 299 |
| 300 void HTMLTableElement::CollectStyleForPresentationAttribute( | 300 void HTMLTableElement::CollectStyleForPresentationAttribute( |
| 301 const QualifiedName& name, | 301 const QualifiedName& name, |
| 302 const AtomicString& value, | 302 const AtomicString& value, |
| 303 MutableStylePropertySet* style) { | 303 MutableStylePropertySet* style) { |
| 304 if (name == widthAttr) { | 304 if (name == widthAttr) { |
| 305 AddHTMLLengthToStyle(style, CSSPropertyWidth, value); | 305 AddHTMLLengthToStyle(style, CSSPropertyWidth, value); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 330 if (!value.IsEmpty()) | 330 if (!value.IsEmpty()) |
| 331 AddPropertyToPresentationAttributeStyle(style, CSSPropertyVerticalAlign, | 331 AddPropertyToPresentationAttributeStyle(style, CSSPropertyVerticalAlign, |
| 332 value); | 332 value); |
| 333 } else if (name == cellspacingAttr) { | 333 } else if (name == cellspacingAttr) { |
| 334 if (!value.IsEmpty()) { | 334 if (!value.IsEmpty()) { |
| 335 AddHTMLLengthToStyle(style, CSSPropertyBorderSpacing, value, | 335 AddHTMLLengthToStyle(style, CSSPropertyBorderSpacing, value, |
| 336 kDontAllowPercentageValues); | 336 kDontAllowPercentageValues); |
| 337 } | 337 } |
| 338 } else if (name == alignAttr) { | 338 } else if (name == alignAttr) { |
| 339 if (!value.IsEmpty()) { | 339 if (!value.IsEmpty()) { |
| 340 if (EqualIgnoringCase(value, "center")) { | 340 if (DeprecatedEqualIgnoringCase(value, "center")) { |
| 341 AddPropertyToPresentationAttributeStyle( | 341 AddPropertyToPresentationAttributeStyle( |
| 342 style, CSSPropertyWebkitMarginStart, CSSValueAuto); | 342 style, CSSPropertyWebkitMarginStart, CSSValueAuto); |
| 343 AddPropertyToPresentationAttributeStyle( | 343 AddPropertyToPresentationAttributeStyle( |
| 344 style, CSSPropertyWebkitMarginEnd, CSSValueAuto); | 344 style, CSSPropertyWebkitMarginEnd, CSSValueAuto); |
| 345 } else { | 345 } else { |
| 346 AddPropertyToPresentationAttributeStyle(style, CSSPropertyFloat, value); | 346 AddPropertyToPresentationAttributeStyle(style, CSSPropertyFloat, value); |
| 347 } | 347 } |
| 348 } | 348 } |
| 349 } else if (name == rulesAttr) { | 349 } else if (name == rulesAttr) { |
| 350 // The presence of a valid rules attribute causes border collapsing to be | 350 // The presence of a valid rules attribute causes border collapsing to be |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 } else if (name == frameAttr) { | 404 } else if (name == frameAttr) { |
| 405 // FIXME: This attribute is a mess. | 405 // FIXME: This attribute is a mess. |
| 406 bool border_top; | 406 bool border_top; |
| 407 bool border_right; | 407 bool border_right; |
| 408 bool border_bottom; | 408 bool border_bottom; |
| 409 bool border_left; | 409 bool border_left; |
| 410 frame_attr_ = GetBordersFromFrameAttributeValue( | 410 frame_attr_ = GetBordersFromFrameAttributeValue( |
| 411 params.new_value, border_top, border_right, border_bottom, border_left); | 411 params.new_value, border_top, border_right, border_bottom, border_left); |
| 412 } else if (name == rulesAttr) { | 412 } else if (name == rulesAttr) { |
| 413 rules_attr_ = kUnsetRules; | 413 rules_attr_ = kUnsetRules; |
| 414 if (EqualIgnoringCase(params.new_value, "none")) | 414 if (DeprecatedEqualIgnoringCase(params.new_value, "none")) |
| 415 rules_attr_ = kNoneRules; | 415 rules_attr_ = kNoneRules; |
| 416 else if (EqualIgnoringCase(params.new_value, "groups")) | 416 else if (DeprecatedEqualIgnoringCase(params.new_value, "groups")) |
| 417 rules_attr_ = kGroupsRules; | 417 rules_attr_ = kGroupsRules; |
| 418 else if (EqualIgnoringCase(params.new_value, "rows")) | 418 else if (DeprecatedEqualIgnoringCase(params.new_value, "rows")) |
| 419 rules_attr_ = kRowsRules; | 419 rules_attr_ = kRowsRules; |
| 420 else if (EqualIgnoringCase(params.new_value, "cols")) | 420 else if (DeprecatedEqualIgnoringCase(params.new_value, "cols")) |
| 421 rules_attr_ = kColsRules; | 421 rules_attr_ = kColsRules; |
| 422 else if (EqualIgnoringCase(params.new_value, "all")) | 422 else if (DeprecatedEqualIgnoringCase(params.new_value, "all")) |
| 423 rules_attr_ = kAllRules; | 423 rules_attr_ = kAllRules; |
| 424 } else if (params.name == cellpaddingAttr) { | 424 } else if (params.name == cellpaddingAttr) { |
| 425 if (!params.new_value.IsEmpty()) | 425 if (!params.new_value.IsEmpty()) |
| 426 padding_ = std::max(0, params.new_value.ToInt()); | 426 padding_ = std::max(0, params.new_value.ToInt()); |
| 427 else | 427 else |
| 428 padding_ = 1; | 428 padding_ = 1; |
| 429 } else if (params.name == colsAttr) { | 429 } else if (params.name == colsAttr) { |
| 430 // ### | 430 // ### |
| 431 } else { | 431 } else { |
| 432 HTMLElement::ParseAttribute(params); | 432 HTMLElement::ParseAttribute(params); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 const AtomicString& HTMLTableElement::Summary() const { | 610 const AtomicString& HTMLTableElement::Summary() const { |
| 611 return getAttribute(summaryAttr); | 611 return getAttribute(summaryAttr); |
| 612 } | 612 } |
| 613 | 613 |
| 614 DEFINE_TRACE(HTMLTableElement) { | 614 DEFINE_TRACE(HTMLTableElement) { |
| 615 visitor->Trace(shared_cell_style_); | 615 visitor->Trace(shared_cell_style_); |
| 616 HTMLElement::Trace(visitor); | 616 HTMLElement::Trace(visitor); |
| 617 } | 617 } |
| 618 | 618 |
| 619 } // namespace blink | 619 } // namespace blink |
| OLD | NEW |