Chromium Code Reviews| 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(); |
|
kenneth.r.christiansen
2014/03/11 13:59:16
I would add a comment here
// Use 1 if number is
| |
| 68 m_span = newSpan ? newSpan : 1; | |
| 68 if (renderer() && renderer()->isRenderTableCol()) | 69 if (renderer() && renderer()->isRenderTableCol()) |
| 69 renderer()->updateFromElement(); | 70 renderer()->updateFromElement(); |
| 70 } else if (name == widthAttr) { | 71 } else if (name == widthAttr) { |
| 71 if (!value.isEmpty()) { | 72 if (!value.isEmpty()) { |
| 72 if (renderer() && renderer()->isRenderTableCol()) { | 73 if (renderer() && renderer()->isRenderTableCol()) { |
| 73 RenderTableCol* col = toRenderTableCol(renderer()); | 74 RenderTableCol* col = toRenderTableCol(renderer()); |
| 74 int newWidth = width().toInt(); | 75 int newWidth = width().toInt(); |
| 75 if (newWidth != col->width()) | 76 if (newWidth != col->width()) |
| 76 col->setNeedsLayoutAndPrefWidthsRecalc(); | 77 col->setNeedsLayoutAndPrefWidthsRecalc(); |
| 77 } | 78 } |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 93 { | 94 { |
| 94 setIntegralAttribute(spanAttr, n); | 95 setIntegralAttribute(spanAttr, n); |
| 95 } | 96 } |
| 96 | 97 |
| 97 const AtomicString& HTMLTableColElement::width() const | 98 const AtomicString& HTMLTableColElement::width() const |
| 98 { | 99 { |
| 99 return getAttribute(widthAttr); | 100 return getAttribute(widthAttr); |
| 100 } | 101 } |
| 101 | 102 |
| 102 } | 103 } |
| OLD | NEW |