[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:46:58 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit a79bc13e0bc49905a748de08b5da6dcf493bef4d
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jun 16 06:29:26 2004 +0000

            Reviewed by Dave.
    
    	<rdar://problem/3695907>: (can't enable selection inside parent where it is disabled via CSS)
    
            * khtml/css/cssparser.cpp:
            (CSSParser::parseValue):
            * khtml/css/cssstyleselector.cpp:
            (khtml::CSSStyleSelector::applyProperty):
            * khtml/rendering/render_object.cpp:
            (RenderObject::shouldSelect):
            * khtml/rendering/render_style.h:
            (khtml::):
            (khtml::RenderStyle::userSelect):
            (khtml::RenderStyle::setUserSelect):
            (khtml::RenderStyle::initialUserSelect):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6863 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 6666cb0..024267e 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,21 @@
+2004-06-15  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Dave.
+
+	<rdar://problem/3695907>: (can't enable selection inside parent where it is disabled via CSS)
+
+        * khtml/css/cssparser.cpp:
+        (CSSParser::parseValue): 
+        * khtml/css/cssstyleselector.cpp:
+        (khtml::CSSStyleSelector::applyProperty):
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::shouldSelect):
+        * khtml/rendering/render_style.h:
+        (khtml::):
+        (khtml::RenderStyle::userSelect):
+        (khtml::RenderStyle::setUserSelect):
+        (khtml::RenderStyle::initialUserSelect):
+
 2004-06-15  David Hyatt  <hyatt at apple.com>
 
 	Initial impl of the EllipsisBox.  This code just gets the box created and gets it placed vertically.  The next
diff --git a/WebCore/khtml/css/cssparser.cpp b/WebCore/khtml/css/cssparser.cpp
index 17fb7d6..17c047e 100644
--- a/WebCore/khtml/css/cssparser.cpp
+++ b/WebCore/khtml/css/cssparser.cpp
@@ -1101,8 +1101,8 @@ bool CSSParser::parseValue( int propId, bool important )
         if (id == CSS_VAL_READ_ONLY || id == CSS_VAL_READ_WRITE)
             valid_primitive = true;
         break;
-    case CSS_PROP__KHTML_USER_SELECT: // auto | none
-        if (id == CSS_VAL_AUTO || id == CSS_VAL_NONE)
+    case CSS_PROP__KHTML_USER_SELECT: // auto | none | text
+        if (id == CSS_VAL_AUTO || id == CSS_VAL_NONE || id == CSS_VAL_TEXT)
             valid_primitive = true;
         break;
     case CSS_PROP_TEXT_OVERFLOW: // clip | ellipsis
diff --git a/WebCore/khtml/css/cssstyleselector.cpp b/WebCore/khtml/css/cssstyleselector.cpp
index 3d88f3a..27acaff 100644
--- a/WebCore/khtml/css/cssstyleselector.cpp
+++ b/WebCore/khtml/css/cssstyleselector.cpp
@@ -3589,8 +3589,10 @@ void CSSStyleSelector::applyProperty( int id, DOM::CSSValueImpl *value )
             case CSS_VAL_NONE:
                 style->setUserDrag(DRAG_NONE);
                 break;
-            default:
+	    case CSS_VAL_ELEMENT:
                 style->setUserDrag(DRAG_ELEMENT);
+	    default:
+		return;
         }
         break;
     }
@@ -3605,8 +3607,20 @@ void CSSStyleSelector::applyProperty( int id, DOM::CSSValueImpl *value )
         HANDLE_INHERIT_AND_INITIAL(userSelect, UserSelect)      
         if (!primitiveValue || !primitiveValue->getIdent())
             return;
-        style->setUserSelect(primitiveValue->getIdent() == CSS_VAL_AUTO);
-        break;
+	switch (primitiveValue->getIdent()) {
+	    case CSS_VAL_AUTO:
+		style->setUserSelect(SELECT_AUTO);
+		break;
+	    case CSS_VAL_NONE:
+		style->setUserSelect(SELECT_NONE);
+		break;
+	    case CSS_VAL_TEXT:
+		style->setUserSelect(SELECT_TEXT);
+		break;
+	    default:
+		return;
+	}
+	break;
     }
     case CSS_PROP_TEXT_OVERFLOW: {
         // This property is supported by WinIE, and so we leave off the "-khtml-" in order to
diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp
index 6d460bf..c2fdedd 100644
--- a/WebCore/khtml/rendering/render_object.cpp
+++ b/WebCore/khtml/rendering/render_object.cpp
@@ -1372,10 +1372,14 @@ bool RenderObject::shouldSelect() const
 {
     const RenderObject* curr = this;
     DOM::NodeImpl *node = 0;
+    bool forcedOn = false;
 
     while (curr) {
-        if (!curr->style()->userSelect())
+        if (curr->style()->userSelect() == SELECT_TEXT)
+	    forcedOn = true;
+        if (!forcedOn && curr->style()->userSelect() == SELECT_NONE)
             return false;
+
 	if (!node)
 	    node = curr->element();
         curr = curr->parent();
diff --git a/WebCore/khtml/rendering/render_style.h b/WebCore/khtml/rendering/render_style.h
index fc87e41..001d553 100644
--- a/WebCore/khtml/rendering/render_style.h
+++ b/WebCore/khtml/rendering/render_style.h
@@ -531,6 +531,12 @@ enum EUserDrag {
     DRAG_AUTO, DRAG_NONE, DRAG_ELEMENT
 };
 
+// CSS3 User Select Values
+
+enum EUserSelect {
+    SELECT_AUTO, SELECT_NONE, SELECT_TEXT
+};
+
 // This struct is for rarely used non-inherited CSS3 properties.  By grouping them together,
 // we save space, and only allocate this object when someone actually uses
 // a non-inherited CSS3 property.
@@ -557,7 +563,7 @@ public:
     DataRef<StyleFlexibleBoxData> flexibleBox; // Flexible box properties 
     DataRef<StyleMarqueeData> marquee; // Marquee properties
     EUserDrag userDrag : 2; // Whether or not a drag can be initiated by this element.
-    bool userSelect : 1;  // Whether or not the element is selectable.
+    EUserSelect userSelect : 2;  // Whether or not the element is selectable.
     bool textOverflow : 1; // Whether or not lines that spill out should be truncated with "..."
 
 #ifndef KHTML_NO_XBL
@@ -1100,7 +1106,7 @@ public:
     EMarqueeDirection marqueeDirection() { return css3NonInheritedData->marquee->direction; }
     EUserModify userModify() const { return css3InheritedData->userModify; }
     EUserDrag userDrag() const { return css3NonInheritedData->userDrag; }
-    bool userSelect() const { return css3NonInheritedData->userSelect; }
+    EUserSelect userSelect() const { return css3NonInheritedData->userSelect; }
     bool textOverflow() const { return css3NonInheritedData->textOverflow; }
     // End CSS3 Getters
 
@@ -1280,7 +1286,7 @@ public:
     void setMarqueeLoopCount(int i) { SET_VAR(css3NonInheritedData.access()->marquee, loops, i); }
     void setUserModify(EUserModify u) { SET_VAR(css3InheritedData, userModify, u); }
     void setUserDrag(EUserDrag d) { SET_VAR(css3NonInheritedData, userDrag, d); }
-    void setUserSelect(bool b) { SET_VAR(css3NonInheritedData, userSelect, b); }
+    void setUserSelect(EUserSelect s) { SET_VAR(css3NonInheritedData, userSelect, s); }
     void setTextOverflow(bool b) { SET_VAR(css3NonInheritedData, textOverflow, b); }
     // End CSS3 Setters
    
@@ -1387,7 +1393,7 @@ public:
     static EMarqueeDirection initialMarqueeDirection() { return MAUTO; }
     static EUserModify initialUserModify() { return READ_ONLY; }
     static EUserDrag initialUserDrag() { return DRAG_AUTO; }
-    static bool initialUserSelect() { return true; }
+    static EUserSelect initialUserSelect() { return SELECT_AUTO; }
     static bool initialTextOverflow() { return false; }
 
 #if APPLE_CHANGES

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list