| 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, 2010 Apple Inc. All rights reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 { | 57 { |
| 58 if (name == widthAttr) | 58 if (name == widthAttr) |
| 59 addHTMLLengthToStyle(style, CSSPropertyWidth, value); | 59 addHTMLLengthToStyle(style, CSSPropertyWidth, value); |
| 60 else | 60 else |
| 61 HTMLTablePartElement::collectStyleForPresentationAttribute(name, value,
style); | 61 HTMLTablePartElement::collectStyleForPresentationAttribute(name, value,
style); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void HTMLTableColElement::parseAttribute(const QualifiedName& name, const Atomic
String& value) | 64 void HTMLTableColElement::parseAttribute(const QualifiedName& name, const Atomic
String& value) |
| 65 { | 65 { |
| 66 if (name == spanAttr) { | 66 if (name == spanAttr) { |
| 67 m_span = !value.isNull() ? value.toInt() : 1; | 67 int newSpan = value.toInt(); |
| 68 // If the value of span is not a valid non-negative integer greater than
zero, |
| 69 // set it to 1. |
| 70 m_span = newSpan ? newSpan : 1; |
| 68 if (renderer() && renderer()->isRenderTableCol()) | 71 if (renderer() && renderer()->isRenderTableCol()) |
| 69 renderer()->updateFromElement(); | 72 renderer()->updateFromElement(); |
| 70 } else if (name == widthAttr) { | 73 } else if (name == widthAttr) { |
| 71 if (!value.isEmpty()) { | 74 if (!value.isEmpty()) { |
| 72 if (renderer() && renderer()->isRenderTableCol()) { | 75 if (renderer() && renderer()->isRenderTableCol()) { |
| 73 RenderTableCol* col = toRenderTableCol(renderer()); | 76 RenderTableCol* col = toRenderTableCol(renderer()); |
| 74 int newWidth = width().toInt(); | 77 int newWidth = width().toInt(); |
| 75 if (newWidth != col->width()) | 78 if (newWidth != col->width()) |
| 76 col->setNeedsLayoutAndPrefWidthsRecalc(); | 79 col->setNeedsLayoutAndPrefWidthsRecalc(); |
| 77 } | 80 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 93 { | 96 { |
| 94 setIntegralAttribute(spanAttr, n); | 97 setIntegralAttribute(spanAttr, n); |
| 95 } | 98 } |
| 96 | 99 |
| 97 const AtomicString& HTMLTableColElement::width() const | 100 const AtomicString& HTMLTableColElement::width() const |
| 98 { | 101 { |
| 99 return getAttribute(widthAttr); | 102 return getAttribute(widthAttr); |
| 100 } | 103 } |
| 101 | 104 |
| 102 } | 105 } |
| OLD | NEW |