|
Lines 22-27
Source/WebCore/rendering/RenderTextControl.cpp_sec1
|
| 22 |
#include "config.h" |
22 |
#include "config.h" |
| 23 |
#include "RenderTextControl.h" |
23 |
#include "RenderTextControl.h" |
| 24 |
|
24 |
|
|
|
25 |
#include "CSSPrimitiveValueMappings.h" |
| 25 |
#include "HTMLTextFormControlElement.h" |
26 |
#include "HTMLTextFormControlElement.h" |
| 26 |
#include "HitTestResult.h" |
27 |
#include "HitTestResult.h" |
| 27 |
#include "RenderText.h" |
28 |
#include "RenderText.h" |
|
Lines 29-34
Source/WebCore/rendering/RenderTextControl.cpp_sec2
|
| 29 |
#include "RenderTheme.h" |
30 |
#include "RenderTheme.h" |
| 30 |
#include "ScrollbarTheme.h" |
31 |
#include "ScrollbarTheme.h" |
| 31 |
#include "StyleInheritedData.h" |
32 |
#include "StyleInheritedData.h" |
|
|
33 |
#include "StyleProperties.h" |
| 32 |
#include "TextControlInnerElements.h" |
34 |
#include "TextControlInnerElements.h" |
| 33 |
#include "VisiblePosition.h" |
35 |
#include "VisiblePosition.h" |
| 34 |
#include <wtf/unicode/CharacterNames.h> |
36 |
#include <wtf/unicode/CharacterNames.h> |
|
Lines 72-86
void RenderTextControl::styleDidChange(S
Source/WebCore/rendering/RenderTextControl.cpp_sec3
|
| 72 |
textFormControlElement().updatePlaceholderVisibility(false); |
74 |
textFormControlElement().updatePlaceholderVisibility(false); |
| 73 |
} |
75 |
} |
| 74 |
|
76 |
|
| 75 |
static inline bool updateUserModifyProperty(const HTMLTextFormControlElement& element, RenderStyle* style) |
|
|
| 76 |
{ |
| 77 |
bool isDisabled = element.isDisabledFormControl(); |
| 78 |
bool isReadOnlyControl = element.isReadOnly(); |
| 79 |
|
| 80 |
style->setUserModify((isReadOnlyControl || isDisabled) ? READ_ONLY : READ_WRITE_PLAINTEXT_ONLY); |
| 81 |
return isDisabled; |
| 82 |
} |
| 83 |
|
| 84 |
void RenderTextControl::adjustInnerTextStyle(const RenderStyle* startStyle, RenderStyle* textBlockStyle) const |
77 |
void RenderTextControl::adjustInnerTextStyle(const RenderStyle* startStyle, RenderStyle* textBlockStyle) const |
| 85 |
{ |
78 |
{ |
| 86 |
// The inner block, if present, always has its direction set to LTR, |
79 |
// The inner block, if present, always has its direction set to LTR, |
|
Lines 88-95
void RenderTextControl::adjustInnerTextS
Source/WebCore/rendering/RenderTextControl.cpp_sec4
|
| 88 |
textBlockStyle->setDirection(style().direction()); |
81 |
textBlockStyle->setDirection(style().direction()); |
| 89 |
textBlockStyle->setUnicodeBidi(style().unicodeBidi()); |
82 |
textBlockStyle->setUnicodeBidi(style().unicodeBidi()); |
| 90 |
|
83 |
|
| 91 |
bool disabled = updateUserModifyProperty(textFormControlElement(), textBlockStyle); |
84 |
HTMLTextFormControlElement& control = textFormControlElement(); |
| 92 |
if (disabled) |
85 |
if (HTMLElement* innerText = control.innerTextElement()) { |
|
|
86 |
if (const StyleProperties* properties = innerText->presentationAttributeStyle()) { |
| 87 |
RefPtr<CSSValue> value = properties->getPropertyCSSValue(CSSPropertyWebkitUserModify); |
| 88 |
if (value && value->isPrimitiveValue()) |
| 89 |
textBlockStyle->setUserModify(toCSSPrimitiveValue(*value)); |
| 90 |
} |
| 91 |
} |
| 92 |
|
| 93 |
if (control.isDisabledFormControl()) |
| 93 |
textBlockStyle->setColor(theme().disabledTextColor(textBlockStyle->visitedDependentColor(CSSPropertyColor), startStyle->visitedDependentColor(CSSPropertyBackgroundColor))); |
94 |
textBlockStyle->setColor(theme().disabledTextColor(textBlockStyle->visitedDependentColor(CSSPropertyColor), startStyle->visitedDependentColor(CSSPropertyBackgroundColor))); |
| 94 |
#if PLATFORM(IOS) |
95 |
#if PLATFORM(IOS) |
| 95 |
if (textBlockStyle->textSecurity() != TSNONE && !textBlockStyle->isLeftToRightDirection()) { |
96 |
if (textBlockStyle->textSecurity() != TSNONE && !textBlockStyle->isLeftToRightDirection()) { |
|
Lines 135-147
int RenderTextControl::textBlockLogicalW
Source/WebCore/rendering/RenderTextControl.cpp_sec5
|
| 135 |
return unitWidth; |
136 |
return unitWidth; |
| 136 |
} |
137 |
} |
| 137 |
|
138 |
|
| 138 |
void RenderTextControl::updateFromElement() |
|
|
| 139 |
{ |
| 140 |
TextControlInnerTextElement* innerText = innerTextElement(); |
| 141 |
if (innerText && innerText->renderer()) |
| 142 |
updateUserModifyProperty(textFormControlElement(), &innerText->renderer()->style()); |
| 143 |
} |
| 144 |
|
| 145 |
int RenderTextControl::scrollbarThickness() const |
139 |
int RenderTextControl::scrollbarThickness() const |
| 146 |
{ |
140 |
{ |
| 147 |
// FIXME: We should get the size of the scrollbar from the RenderTheme instead. |
141 |
// FIXME: We should get the size of the scrollbar from the RenderTheme instead. |