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 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. |
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. |
(...skipping 4334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4345 | 4345 |
4346 bool Document::inDesignMode() const | 4346 bool Document::inDesignMode() const |
4347 { | 4347 { |
4348 for (const Document* d = this; d; d = d->parentDocument()) { | 4348 for (const Document* d = this; d; d = d->parentDocument()) { |
4349 if (d->m_designMode != inherit) | 4349 if (d->m_designMode != inherit) |
4350 return d->m_designMode; | 4350 return d->m_designMode; |
4351 } | 4351 } |
4352 return false; | 4352 return false; |
4353 } | 4353 } |
4354 | 4354 |
| 4355 String Document::designMode() const |
| 4356 { |
| 4357 return inDesignMode() ? "on" : "off"; |
| 4358 } |
| 4359 |
| 4360 void Document::setDesignMode(const String& value) |
| 4361 { |
| 4362 InheritedBool mode; |
| 4363 if (equalIgnoringCase(value, "on")) |
| 4364 mode = on; |
| 4365 else if (equalIgnoringCase(value, "off")) |
| 4366 mode = off; |
| 4367 else |
| 4368 mode = inherit; |
| 4369 setDesignMode(mode); |
| 4370 } |
| 4371 |
4355 Document* Document::parentDocument() const | 4372 Document* Document::parentDocument() const |
4356 { | 4373 { |
4357 if (!m_frame) | 4374 if (!m_frame) |
4358 return 0; | 4375 return 0; |
4359 LocalFrame* parent = m_frame->tree().parent(); | 4376 LocalFrame* parent = m_frame->tree().parent(); |
4360 if (!parent) | 4377 if (!parent) |
4361 return 0; | 4378 return 0; |
4362 return parent->document(); | 4379 return parent->document(); |
4363 } | 4380 } |
4364 | 4381 |
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5538 (*it)->invalidateCache(attrName); | 5555 (*it)->invalidateCache(attrName); |
5539 } | 5556 } |
5540 | 5557 |
5541 void Document::trace(Visitor* visitor) | 5558 void Document::trace(Visitor* visitor) |
5542 { | 5559 { |
5543 Supplementable<Document>::trace(visitor); | 5560 Supplementable<Document>::trace(visitor); |
5544 ContainerNode::trace(visitor); | 5561 ContainerNode::trace(visitor); |
5545 } | 5562 } |
5546 | 5563 |
5547 } // namespace WebCore | 5564 } // namespace WebCore |
OLD | NEW |