[webkit-changes] cvs commit: WebCore/khtml/rendering render_style.cpp render_style.h

David hyatt at opensource.apple.com
Mon Jul 18 17:02:09 PDT 2005


hyatt       05/07/18 17:02:08

  Modified:    .        ChangeLog
               khtml/css cssparser.cpp cssproperties.in
                        cssstyleselector.cpp cssvalues.in
               khtml/rendering render_style.cpp render_style.h
  Log:
  	Add support for -khtml-appearance in preparation for
  	the addition of RenderTheme to the tree for form controls.
  
  	Make clean is required after this check-in, since there is
  	some sort of bizarre bug with XCode dependencies on the
  	property generation script.
  
          Reviewed by darin
  
          * khtml/css/cssparser.cpp:
          (CSSParser::parseValue):
          * khtml/css/cssproperties.in:
          * khtml/css/cssstyleselector.cpp:
          (khtml::CSSStyleSelector::applyProperty):
          * khtml/css/cssvalues.in:
          * khtml/rendering/render_style.cpp:
          (m_appearance):
          (StyleCSS3NonInheritedData::operator==):
          (RenderStyle::diff):
          * khtml/rendering/render_style.h:
          (khtml::):
          (khtml::RenderStyle::appearance):
          (khtml::RenderStyle::setAppearance):
          (khtml::RenderStyle::initialAppearance):
  
  Revision  Changes    Path
  1.4438    +27 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4437
  retrieving revision 1.4438
  diff -u -r1.4437 -r1.4438
  --- ChangeLog	18 Jul 2005 23:21:15 -0000	1.4437
  +++ ChangeLog	19 Jul 2005 00:02:02 -0000	1.4438
  @@ -1,3 +1,30 @@
  +2005-07-18  David Hyatt  <hyatt at apple.com>
  +
  +	Add support for -khtml-appearance in preparation for
  +	the addition of RenderTheme to the tree for form controls.
  +
  +	Make clean is required after this check-in, since there is
  +	some sort of bizarre bug with XCode dependencies on the
  +	property generation script.
  +	
  +        Reviewed by darin
  +
  +        * khtml/css/cssparser.cpp:
  +        (CSSParser::parseValue):
  +        * khtml/css/cssproperties.in:
  +        * khtml/css/cssstyleselector.cpp:
  +        (khtml::CSSStyleSelector::applyProperty):
  +        * khtml/css/cssvalues.in:
  +        * khtml/rendering/render_style.cpp:
  +        (m_appearance):
  +        (StyleCSS3NonInheritedData::operator==):
  +        (RenderStyle::diff):
  +        * khtml/rendering/render_style.h:
  +        (khtml::):
  +        (khtml::RenderStyle::appearance):
  +        (khtml::RenderStyle::setAppearance):
  +        (khtml::RenderStyle::initialAppearance):
  +
   2005-07-18  David Harrison  <harrison at apple.com>
   
           Reviewed by Justin.
  
  
  
  1.101     +5 -0      WebCore/khtml/css/cssparser.cpp
  
  Index: cssparser.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/css/cssparser.cpp,v
  retrieving revision 1.100
  retrieving revision 1.101
  diff -u -r1.100 -r1.101
  --- cssparser.cpp	18 Jul 2005 21:44:13 -0000	1.100
  +++ cssparser.cpp	19 Jul 2005 00:02:07 -0000	1.101
  @@ -943,6 +943,11 @@
   	break;
   
       /* CSS3 properties */
  +    case CSS_PROP__KHTML_APPEARANCE:
  +	if ((id >= CSS_VAL_CHECKBOX && id <= CSS_VAL_TEXTFIELD) || id == CSS_VAL_NONE)
  +	    valid_primitive = true;
  +	break;
  +
       case CSS_PROP__KHTML_BINDING:
   #ifndef KHTML_NO_XBL
           if (id == CSS_VAL_NONE)
  
  
  
  1.34      +1 -0      WebCore/khtml/css/cssproperties.in
  
  Index: cssproperties.in
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/css/cssproperties.in,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- cssproperties.in	12 May 2005 17:11:21 -0000	1.33
  +++ cssproperties.in	19 Jul 2005 00:02:07 -0000	1.34
  @@ -7,6 +7,7 @@
   # Microsoft extensions are documented here:
   # http://msdn.microsoft.com/workshop/author/css/reference/attributes.asp
   #
  +-khtml-appearance
   background-color
   background-image
   background-repeat
  
  
  
  1.192     +11 -0     WebCore/khtml/css/cssstyleselector.cpp
  
  Index: cssstyleselector.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/css/cssstyleselector.cpp,v
  retrieving revision 1.191
  retrieving revision 1.192
  diff -u -r1.191 -r1.192
  --- cssstyleselector.cpp	18 Jul 2005 21:52:15 -0000	1.191
  +++ cssstyleselector.cpp	19 Jul 2005 00:02:07 -0000	1.192
  @@ -3373,6 +3373,17 @@
           break;
   
       // CSS3 Properties
  +    case CSS_PROP__KHTML_APPEARANCE: {
  +        HANDLE_INHERIT_AND_INITIAL(appearance, Appearance)
  +        if (!primitiveValue) break;
  +        int id = primitiveValue->getIdent();
  +        EAppearance appearance;
  +        if (id == CSS_VAL_NONE)
  +            appearance = NoAppearance;
  +        else
  +            appearance = EAppearance(id - CSS_VAL_CHECKBOX);
  +        style->setAppearance(appearance);
  +    }
       case CSS_PROP__KHTML_BINDING: {
   #ifndef KHTML_NO_XBL
           if (isInitial || (primitiveValue && primitiveValue->getIdent() == CSS_VAL_NONE)) {
  
  
  
  1.30      +32 -0     WebCore/khtml/css/cssvalues.in
  
  Index: cssvalues.in
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/css/cssvalues.in,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- cssvalues.in	20 Feb 2005 02:24:40 -0000	1.29
  +++ cssvalues.in	19 Jul 2005 00:02:07 -0000	1.30
  @@ -430,3 +430,35 @@
   #
   after-white-space
   
  +#
  +# CSS_PROP__KHTML_APPEARANCE
  +#
  +checkbox
  +radio
  +button
  +button-bevel
  +listbox
  +listitem
  +menulist
  +menulist-button
  +menulist-text
  +menulist-textfield
  +scrollbarbutton-up
  +scrollbarbutton-down
  +scrollbarbutton-left
  +scrollbarbutton-right
  +scrollbartrack-horizontal
  +scrollbartrack-vertical
  +scrollbarthumb-horizontal
  +scrollbarthumb-vertical
  +scrollbargripper-horizontal
  +scrollbargripper-vertical
  +slider-horizontal
  +slider-vertical
  +sliderthumb-horizontal
  +sliderthumb-vertical
  +caret
  +searchfield
  +searchfield-results
  +searchfield-close
  +textfield
  
  
  
  1.68      +7 -3      WebCore/khtml/rendering/render_style.cpp
  
  Index: render_style.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_style.cpp,v
  retrieving revision 1.67
  retrieving revision 1.68
  diff -u -r1.67 -r1.68
  --- render_style.cpp	9 Jul 2005 20:19:18 -0000	1.67
  +++ render_style.cpp	19 Jul 2005 00:02:08 -0000	1.68
  @@ -311,7 +311,8 @@
   userSelect(RenderStyle::initialUserSelect()),
   textOverflow(RenderStyle::initialTextOverflow()),
   marginTopCollapse(MCOLLAPSE),
  -marginBottomCollapse(MCOLLAPSE)
  +marginBottomCollapse(MCOLLAPSE),
  +m_appearance(RenderStyle::initialAppearance())
   #ifndef KHTML_NO_XBL
   , bindingURI(0)
   #endif
  @@ -325,7 +326,8 @@
   #endif
   opacity(o.opacity), flexibleBox(o.flexibleBox), marquee(o.marquee),
   userDrag(o.userDrag), userSelect(o.userSelect), textOverflow(o.textOverflow),
  -marginTopCollapse(o.marginTopCollapse), marginBottomCollapse(o.marginBottomCollapse)
  +marginTopCollapse(o.marginTopCollapse), marginBottomCollapse(o.marginBottomCollapse),
  +m_appearance(o.m_appearance)
   {
   #ifndef KHTML_NO_XBL
       bindingURI = o.bindingURI ? o.bindingURI->copy() : 0;
  @@ -355,7 +357,8 @@
   {
       return opacity == o.opacity && flexibleBox == o.flexibleBox && marquee == o.marquee &&
              userDrag == o.userDrag && userSelect == o.userSelect && textOverflow == o.textOverflow &&
  -           marginTopCollapse == o.marginTopCollapse && marginBottomCollapse == o.marginBottomCollapse
  +           marginTopCollapse == o.marginTopCollapse && marginBottomCollapse == o.marginBottomCollapse &&
  +           m_appearance == o.m_appearance
   #ifndef KHTML_NO_XBL
              && bindingsEquivalent(o)
   #endif
  @@ -681,6 +684,7 @@
            box->vertical_align != other->box->vertical_align ||
            !(surround->margin == other->surround->margin) ||
            !(surround->padding == other->surround->padding) ||
  +         css3NonInheritedData->m_appearance != other->css3NonInheritedData->m_appearance ||
            css3NonInheritedData->marginTopCollapse != other->css3NonInheritedData->marginTopCollapse ||
            css3NonInheritedData->marginBottomCollapse != other->css3NonInheritedData->marginBottomCollapse ||
            *css3NonInheritedData->flexibleBox.get() != *other->css3NonInheritedData->flexibleBox.get() ||
  
  
  
  1.85      +19 -0     WebCore/khtml/rendering/render_style.h
  
  Index: render_style.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_style.h,v
  retrieving revision 1.84
  retrieving revision 1.85
  diff -u -r1.84 -r1.85
  --- render_style.h	12 Jul 2005 20:26:41 -0000	1.84
  +++ render_style.h	19 Jul 2005 00:02:08 -0000	1.85
  @@ -675,6 +675,20 @@
       BCNORMAL, MATCH
   };
   
  +enum EAppearance {
  +    NoAppearance, CheckboxAppearance, RadioAppearance, ButtonAppearance,
  +    ButtonBevelAppearance, ListboxAppearance, ListItemAppearance, MenulistAppearance,
  +    MenulistButtonAppearance, MenulistTextAppearance, MenulistTextFieldAppearance,
  +    ScrollbarButtonUpAppearance, ScrollbarButtonDownAppearance, 
  +    ScrollbarButtonLeftAppearance, ScrollbarButtonRightAppearance,
  +    ScrollbarTrackHorizontalAppearance, ScrollbarTrackVerticalAppearance,
  +    ScrollbarThumbHorizontalAppearance, ScrollbarThumbVerticalAppearance,
  +    ScrollbarGripperHorizontalAppearance, ScrollbarGripperVerticalAppearance,
  +    SliderHorizontalAppearance, SliderVerticalAppearance, SliderThumbHorizontalAppearance,
  +    SliderThumbVerticalAppearance, CaretAppearance, SearchFieldAppearance, SearchFieldResultsAppearance,
  +    SearchFieldCloseAppearance, TextFieldAppearance
  +};
  +
   // 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.
  @@ -710,6 +724,8 @@
       EMarginCollapse marginBottomCollapse : 2;
       EMatchNearestMailBlockquoteColor matchNearestMailBlockquoteColor : 1;    
   
  +    EAppearance m_appearance : 5;
  +
   #ifndef KHTML_NO_XBL
       BindingURI* bindingURI; // The XBL binding URI list.
   #endif
  @@ -1247,6 +1263,7 @@
       }
       ShadowData* textShadow() const { return css3InheritedData->textShadow; }
       float opacity() const { return css3NonInheritedData->opacity; }
  +    EAppearance appearance() const { return css3NonInheritedData->m_appearance; }
       EBoxAlignment boxAlign() const { return css3NonInheritedData->flexibleBox->align; }
       EBoxDirection boxDirection() const { return inherited_flags._box_direction; }
       float boxFlex() { return css3NonInheritedData->flexibleBox->flex; }
  @@ -1450,6 +1467,7 @@
       void setOutlineOffset(unsigned short v) { SET_VAR(background, m_outline._offset, v) }
       void setTextShadow(ShadowData* val, bool add=false);
       void setOpacity(float f) { SET_VAR(css3NonInheritedData, opacity, f); }
  +    void setAppearance(EAppearance a) { SET_VAR(css3NonInheritedData, m_appearance, a); }
       void setBoxAlign(EBoxAlignment a) { SET_VAR(css3NonInheritedData.access()->flexibleBox, align, a); }
       void setBoxDirection(EBoxDirection d) { inherited_flags._box_direction = d; }
       void setBoxFlex(float f) { SET_VAR(css3NonInheritedData.access()->flexibleBox, flex, f); }
  @@ -1593,6 +1611,7 @@
       static ENBSPMode initialNBSPMode() { return NBNORMAL; }
       static EKHTMLLineBreak initialKHTMLLineBreak() { return LBNORMAL; }
       static EMatchNearestMailBlockquoteColor initialMatchNearestMailBlockquoteColor() { return BCNORMAL; }
  +    static EAppearance initialAppearance() { return NoAppearance; }
   
   #if APPLE_CHANGES
       // Keep these at the end.
  
  
  



More information about the webkit-changes mailing list