[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:11:42 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 1e9224c66df67f92cad92b880d6e29027bf39935
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Nov 14 08:09:19 2003 +0000
Reviewed by Dave.
- fixed 3472875 -- REGRESSION (109-110): insertion point does not blink in a nonempty textarea
- fixed 3484002 -- disabling, then enabling a read-only <textarea> will make it editable
* kwq/KWQTextArea.mm:
(-[KWQTextArea setText:]): Call updateTextColor after setting the text.
(-[KWQTextArea setEditable:]): Don't set the NSTextView editable property directly,
because we don't want to make a disabled text view editable right away, but we need
to later if it's enabled.
(-[KWQTextArea isEditable]): Don't get the NSTextView editable property directly,
because it can be appropriate to return YES even if the text view happens to be disabled.
(-[KWQTextAreaTextView initWithFrame:textContainer:]): Initialize editableIfEnabled to YES.
(-[KWQTextAreaTextView setEnabled:]): Don't set the editable state to true if
editableIfEnabled is NO. The old code would make a read-only field editable if you
changed it to be enabled. Also update the color of the text here.
(-[KWQTextAreaTextView setEditableIfEnabled:]): Store the editableIfEnabled state in a
field, and then alter the state of the editable flag to match if we're currently enabled.
(-[KWQTextAreaTextView isEditableIfEnabled]): Return the editableIfEnabled state.
(-[KWQTextAreaTextView updateTextColor]): Update the color of the text. This was done in
drawRect: before, which was the cause of the lack of insertion point.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5491 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index e27abe1..46fc00c 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -2,6 +2,30 @@
Reviewed by Dave.
+ - fixed 3472875 -- REGRESSION (109-110): insertion point does not blink in a nonempty textarea
+ - fixed 3484002 -- disabling, then enabling a read-only <textarea> will make it editable
+
+ * kwq/KWQTextArea.mm:
+ (-[KWQTextArea setText:]): Call updateTextColor after setting the text.
+ (-[KWQTextArea setEditable:]): Don't set the NSTextView editable property directly,
+ because we don't want to make a disabled text view editable right away, but we need
+ to later if it's enabled.
+ (-[KWQTextArea isEditable]): Don't get the NSTextView editable property directly,
+ because it can be appropriate to return YES even if the text view happens to be disabled.
+ (-[KWQTextAreaTextView initWithFrame:textContainer:]): Initialize editableIfEnabled to YES.
+ (-[KWQTextAreaTextView setEnabled:]): Don't set the editable state to true if
+ editableIfEnabled is NO. The old code would make a read-only field editable if you
+ changed it to be enabled. Also update the color of the text here.
+ (-[KWQTextAreaTextView setEditableIfEnabled:]): Store the editableIfEnabled state in a
+ field, and then alter the state of the editable flag to match if we're currently enabled.
+ (-[KWQTextAreaTextView isEditableIfEnabled]): Return the editableIfEnabled state.
+ (-[KWQTextAreaTextView updateTextColor]): Update the color of the text. This was done in
+ drawRect: before, which was the cause of the lack of insertion point.
+
+2003-11-13 Darin Adler <darin at apple.com>
+
+ Reviewed by Dave.
+
- fixed 3474330 -- tooltips do not work for <area> elements
* kwq/WebCoreBridge.mm: (-[WebCoreBridge elementAtPoint:]): When looking for a title, start
diff --git a/WebCore/kwq/KWQTextArea.mm b/WebCore/kwq/KWQTextArea.mm
index 34375a5..423372b 100644
--- a/WebCore/kwq/KWQTextArea.mm
+++ b/WebCore/kwq/KWQTextArea.mm
@@ -63,10 +63,19 @@
{
QTextEdit *widget;
BOOL disabled;
+ BOOL editableIfEnabled;
}
+
- (void)setWidget:(QTextEdit *)widget;
+
- (void)setEnabled:(BOOL)flag;
- (BOOL)isEnabled;
+
+- (void)setEditableIfEnabled:(BOOL)flag;
+- (BOOL)isEditableIfEnabled;
+
+- (void)updateTextColor;
+
@end
@implementation KWQTextArea
@@ -206,9 +215,8 @@ const float LargeNumberForText = 1.0e7;
- (void)setText:(NSString *)s
{
- //NSLog(@"extraLineFragmentTextContainer before setString: is %@", [[textView layoutManager] extraLineFragmentTextContainer]);
[textView setString:s];
- //NSLog(@"extraLineFragmentTextContainer after setString: is %@", [[textView layoutManager] extraLineFragmentTextContainer]);
+ [textView updateTextColor];
}
- (NSString *)text
@@ -265,12 +273,12 @@ const float LargeNumberForText = 1.0e7;
- (void)setEditable:(BOOL)flag
{
- [textView setEditable:flag];
+ [textView setEditableIfEnabled:flag];
}
- (BOOL)isEditable
{
- return [textView isEditable];
+ return [textView isEditableIfEnabled];
}
- (void)setEnabled:(BOOL)flag
@@ -395,12 +403,10 @@ static NSRange RangeOfParagraph(NSString *text, int paragraph)
- (void)setFont:(NSFont *)font
{
- //NSLog(@"extraLineFragmentTextContainer before setFont: is %@", [[textView layoutManager] extraLineFragmentTextContainer]);
[font retain];
[_font release];
_font = font;
[textView setFont:font];
- //NSLog(@"extraLineFragmentTextContainer after setFont: is %@", [[textView layoutManager] extraLineFragmentTextContainer]);
}
- (BOOL)becomeFirstResponder
@@ -582,6 +588,8 @@ static NSString *WebContinuousSpellCheckingEnabled = @"WebContinuousSpellCheckin
[super setContinuousSpellCheckingEnabled:
[[self class] _isContinuousSpellCheckingEnabledForNewTextAreas]];
+ editableIfEnabled = YES;
+
return self;
}
@@ -716,8 +724,15 @@ static NSString *WebContinuousSpellCheckingEnabled = @"WebContinuousSpellCheckin
- (void)setEnabled:(BOOL)flag
{
+ if (disabled == !flag) {
+ return;
+ }
+
disabled = !flag;
- [self setEditable:flag];
+ if (editableIfEnabled) {
+ [self setEditable:!disabled];
+ }
+ [self updateTextColor];
}
- (BOOL)isEnabled
@@ -725,12 +740,24 @@ static NSString *WebContinuousSpellCheckingEnabled = @"WebContinuousSpellCheckin
return !disabled;
}
-- (void)drawRect:(NSRect)rect
+- (void)setEditableIfEnabled:(BOOL)flag
+{
+ editableIfEnabled = flag;
+ if (!disabled) {
+ [self setEditable:editableIfEnabled];
+ }
+}
+
+- (BOOL)isEditableIfEnabled
{
- // do a hack to make the text view look like it's disabled
+ return editableIfEnabled;
+}
+
+- (void)updateTextColor
+{
+ // Make the text look disabled by changing its color.
NSColor *color = disabled ? [NSColor disabledControlTextColor] : [NSColor controlTextColor];
[[self textStorage] setForegroundColor:color];
- [super drawRect:rect];
}
@end
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list