OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "core/dom/Document.h" | 34 #include "core/dom/Document.h" |
35 #include "core/dom/Event.h" | 35 #include "core/dom/Event.h" |
36 #include "core/dom/EventNames.h" | 36 #include "core/dom/EventNames.h" |
37 #include "core/dom/NamedNodesCollection.h" | 37 #include "core/dom/NamedNodesCollection.h" |
38 #include "core/dom/NodeRenderingContext.h" | 38 #include "core/dom/NodeRenderingContext.h" |
39 #include "core/dom/NodeTraversal.h" | 39 #include "core/dom/NodeTraversal.h" |
40 #include "core/html/FormController.h" | 40 #include "core/html/FormController.h" |
41 #include "core/html/HTMLCollection.h" | 41 #include "core/html/HTMLCollection.h" |
42 #include "core/html/HTMLImageElement.h" | 42 #include "core/html/HTMLImageElement.h" |
43 #include "core/html/HTMLInputElement.h" | 43 #include "core/html/HTMLInputElement.h" |
| 44 #include "core/html/HTMLTableElement.h" |
44 #include "core/loader/FormState.h" | 45 #include "core/loader/FormState.h" |
45 #include "core/loader/FrameLoader.h" | 46 #include "core/loader/FrameLoader.h" |
46 #include "core/loader/FrameLoaderClient.h" | 47 #include "core/loader/FrameLoaderClient.h" |
47 #include "core/page/Frame.h" | 48 #include "core/page/Frame.h" |
48 #include "core/page/UseCounter.h" | 49 #include "core/page/UseCounter.h" |
49 #include "core/rendering/RenderTextControl.h" | 50 #include "core/rendering/RenderTextControl.h" |
50 | 51 |
51 using namespace std; | 52 using namespace std; |
52 | 53 |
53 namespace WebCore { | 54 namespace WebCore { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 } | 98 } |
98 | 99 |
99 bool HTMLFormElement::rendererIsNeeded(const NodeRenderingContext& context) | 100 bool HTMLFormElement::rendererIsNeeded(const NodeRenderingContext& context) |
100 { | 101 { |
101 if (!m_wasDemoted) | 102 if (!m_wasDemoted) |
102 return HTMLElement::rendererIsNeeded(context); | 103 return HTMLElement::rendererIsNeeded(context); |
103 | 104 |
104 ContainerNode* node = parentNode(); | 105 ContainerNode* node = parentNode(); |
105 RenderObject* parentRenderer = node->renderer(); | 106 RenderObject* parentRenderer = node->renderer(); |
106 // FIXME: Shouldn't we also check for table caption (see |formIsTablePart| b
elow). | 107 // FIXME: Shouldn't we also check for table caption (see |formIsTablePart| b
elow). |
107 bool parentIsTableElementPart = (parentRenderer->isTable() && node->hasTagNa
me(tableTag)) | 108 bool parentIsTableElementPart = (parentRenderer->isTable() && isHTMLTableEle
ment(node)) |
108 || (parentRenderer->isTableRow() && node->hasTagName(trTag)) | 109 || (parentRenderer->isTableRow() && node->hasTagName(trTag)) |
109 || (parentRenderer->isTableSection() && node->hasTagName(tbodyTag)) | 110 || (parentRenderer->isTableSection() && node->hasTagName(tbodyTag)) |
110 || (parentRenderer->isRenderTableCol() && node->hasTagName(colTag)) | 111 || (parentRenderer->isRenderTableCol() && node->hasTagName(colTag)) |
111 || (parentRenderer->isTableCell() && node->hasTagName(trTag)); | 112 || (parentRenderer->isTableCell() && node->hasTagName(trTag)); |
112 | 113 |
113 if (!parentIsTableElementPart) | 114 if (!parentIsTableElementPart) |
114 return true; | 115 return true; |
115 | 116 |
116 EDisplay display = context.style()->display(); | 117 EDisplay display = context.style()->display(); |
117 bool formIsTablePart = display == TABLE || display == INLINE_TABLE || displa
y == TABLE_ROW_GROUP | 118 bool formIsTablePart = display == TABLE || display == INLINE_TABLE || displa
y == TABLE_ROW_GROUP |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 } | 735 } |
735 | 736 |
736 void HTMLFormElement::setDemoted(bool demoted) | 737 void HTMLFormElement::setDemoted(bool demoted) |
737 { | 738 { |
738 if (demoted) | 739 if (demoted) |
739 UseCounter::count(document(), UseCounter::DemotedFormElement); | 740 UseCounter::count(document(), UseCounter::DemotedFormElement); |
740 m_wasDemoted = demoted; | 741 m_wasDemoted = demoted; |
741 } | 742 } |
742 | 743 |
743 } // namespace | 744 } // namespace |
OLD | NEW |