| 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 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 if (!supportsPlaceholder()) | 149 if (!supportsPlaceholder()) |
| 150 return; | 150 return; |
| 151 if (!placeholderElement() || placeholderValueChanged) | 151 if (!placeholderElement() || placeholderValueChanged) |
| 152 updatePlaceholderText(); | 152 updatePlaceholderText(); |
| 153 HTMLElement* placeholder = placeholderElement(); | 153 HTMLElement* placeholder = placeholderElement(); |
| 154 if (!placeholder) | 154 if (!placeholder) |
| 155 return; | 155 return; |
| 156 placeholder->setInlineStyleProperty(CSSPropertyVisibility, placeholderShould
BeVisible() ? CSSValueVisible : CSSValueHidden); | 156 placeholder->setInlineStyleProperty(CSSPropertyVisibility, placeholderShould
BeVisible() ? CSSValueVisible : CSSValueHidden); |
| 157 } | 157 } |
| 158 | 158 |
| 159 void HTMLTextFormControlElement::fixPlaceholderRenderer(HTMLElement* placeholder
, HTMLElement* siblingElement) | |
| 160 { | |
| 161 // FIXME: We should change the order of DOM nodes. But it makes an assertion | |
| 162 // failure in editing code. | |
| 163 if (!placeholder || !placeholder->renderer()) | |
| 164 return; | |
| 165 RenderObject* placeholderRenderer = placeholder->renderer(); | |
| 166 RenderObject* siblingRenderer = siblingElement->renderer(); | |
| 167 if (!siblingRenderer) | |
| 168 return; | |
| 169 if (placeholderRenderer->nextSibling() == siblingRenderer) | |
| 170 return; | |
| 171 RenderObject* parentRenderer = placeholderRenderer->parent(); | |
| 172 ASSERT(siblingRenderer->parent() == parentRenderer); | |
| 173 parentRenderer->removeChild(placeholderRenderer); | |
| 174 parentRenderer->addChild(placeholderRenderer, siblingRenderer); | |
| 175 } | |
| 176 | |
| 177 void HTMLTextFormControlElement::setSelectionStart(int start) | 159 void HTMLTextFormControlElement::setSelectionStart(int start) |
| 178 { | 160 { |
| 179 setSelectionRange(start, max(start, selectionEnd()), selectionDirection()); | 161 setSelectionRange(start, max(start, selectionEnd()), selectionDirection()); |
| 180 } | 162 } |
| 181 | 163 |
| 182 void HTMLTextFormControlElement::setSelectionEnd(int end) | 164 void HTMLTextFormControlElement::setSelectionEnd(int end) |
| 183 { | 165 { |
| 184 setSelectionRange(min(end, selectionStart()), end, selectionDirection()); | 166 setSelectionRange(min(end, selectionStart()), end, selectionDirection()); |
| 185 } | 167 } |
| 186 | 168 |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 bool isAuto; | 638 bool isAuto; |
| 657 TextDirection textDirection = static_cast<const HTMLElement*>(elemen
t)->directionalityIfhasDirAutoAttribute(isAuto); | 639 TextDirection textDirection = static_cast<const HTMLElement*>(elemen
t)->directionalityIfhasDirAutoAttribute(isAuto); |
| 658 return textDirection == RTL ? "rtl" : "ltr"; | 640 return textDirection == RTL ? "rtl" : "ltr"; |
| 659 } | 641 } |
| 660 } | 642 } |
| 661 | 643 |
| 662 return "ltr"; | 644 return "ltr"; |
| 663 } | 645 } |
| 664 | 646 |
| 665 } // namespace Webcore | 647 } // namespace Webcore |
| OLD | NEW |