o
    /hH                     @   s   d Z dgZddlZddlZG dd dZedejZdd Z	edZ
d	d
 Zg e_ejjD ]Zejje D ]
Zeje	e q7q/dd ZejD ]Zeeeeee  qJdS )a	  CSS2Properties (partly!) implements DOM Level 2 CSS CSS2Properties used
by CSSStyleDeclaration

TODO: CSS2Properties
    If an implementation does implement this interface, it is expected to
    understand the specific syntax of the shorthand properties, and apply
    their semantics; when the margin property is set, for example, the
    marginTop, marginRight, marginBottom and marginLeft properties are
    actually being set by the underlying implementation.

    When dealing with CSS "shorthand" properties, the shorthand properties
    should be decomposed into their component longhand properties as
    appropriate, and when querying for their value, the form returned
    should be the shortest form exactly equivalent to the declarations made
    in the ruleset. However, if there is no shorthand declaration that
    could be added to the ruleset without changing in any way the rules
    already declared in the ruleset (i.e., by adding longhand rules that
    were previously not declared in the ruleset), then the empty string
    should be returned for the shorthand property.

    For example, querying for the font property should not return
    "normal normal normal 14pt/normal Arial, sans-serif", when
    "14pt Arial, sans-serif" suffices. (The normals are initial values, and
    are implied by use of the longhand property.)

    If the values for all the longhand properties that compose a particular
    string are the initial values, then a string consisting of all the
    initial values should be returned (e.g. a border-width value of
    "medium" should be returned as such, not as "").

    For some shorthand properties that take missing values from other
    sides, such as the margin, padding, and border-[width|style|color]
    properties, the minimum number of sides possible should be used; i.e.,
    "0px 10px" will be returned instead of "0px 10px 0px 10px".

    If the value of a shorthand property can not be decomposed into its
    component longhand properties, as is the case for the font property
    with a value of "menu", querying for the values of the component
    longhand properties should return the empty string.

TODO: CSS2Properties DOMImplementation
    The interface found within this section are not mandatory. A DOM
    application can use the hasFeature method of the DOMImplementation
    interface to determine whether it is supported or not. The feature
    string for this extended interface listed in this section is "CSS2"
    and the version is "2.0".

CSS2Properties    Nc                   @   s(   e Zd ZdZdd Zdd Zdd ZdS )	r   a  The CSS2Properties interface represents a convenience mechanism
    for retrieving and setting properties within a CSSStyleDeclaration.
    The attributes of this interface correspond to all the properties
    specified in CSS2. Getting an attribute of this interface is
    equivalent to calling the getPropertyValue method of the
    CSSStyleDeclaration interface. Setting an attribute of this
    interface is equivalent to calling the setProperty method of the
    CSSStyleDeclaration interface.

    cssutils actually also allows usage of ``del`` to remove a CSS property
    from a CSSStyleDeclaration.

    This is an abstract class, the following functions need to be present
    in inheriting class:

    - ``_getP``
    - ``_setP``
    - ``_delP``
    c                 C      d S N selfCSSnamer   r   N/var/www/html/myenv/lib/python3.10/site-packages/cssutils/css/cssproperties.py_getPO      zCSS2Properties._getPc                 C   r   r   r   )r   r   valuer   r   r	   _setPR   r   zCSS2Properties._setPc                 C   r   r   r   r   r   r   r	   _delPU   r   zCSS2Properties._delPN)__name__
__module____qualname____doc__r
   r   r   r   r   r   r	   r   9   s
    z-[a-z]c                 C      dd }t || S )z]Returns DOMname for given CSSname e.g. for CSSname 'font-style' returns
    'fontStyle'.
    c                 S   s   |  dd  S )Nr      )group
capitalizemr   r   r	   _doCSStoDOMname2a      z$_toDOMname.<locals>._doCSStoDOMname2)_reCSStoDOMnamesub)r   r   r   r   r	   
_toDOMname\      r   z([A-Z])[a-z]+c                 C   r   )z\Return CSSname for given DOMname e.g. for DOMname 'fontStyle' returns
    'font-style'.
    c                 S   s   d|  d  S )N-r   )r   lowerr   r   r   r	   _doDOMtoCSSname2o   r   z$_toCSSname.<locals>._doDOMtoCSSname2)_reDOMtoCSSnamer   )DOMnamer!   r   r   r	   
_toCSSnamej   r   r$   c                    s6   t |   fdd} fdd} fdd}|||fS )z
    Closure to keep name known in each properties accessor function
    DOMname is converted to CSSname here, so actual calls use CSSname.
    c                    s
   |   S r   )r
   r   r   r   r	   _get   s   
z"__named_property_def.<locals>._getc                    s   |   | d S r   )r   )r   r   r&   r   r	   _set   s   z"__named_property_def.<locals>._setc                    s   |    d S r   )r   r%   r&   r   r	   _del   s   z"__named_property_def.<locals>._del)r$   )r#   r'   r(   r)   r   r&   r	   __named_property_def   s
   
r*   )r   __all__recssutils.profilescssutilsr   compileIr   r   r"   r$   _propertiesprofiles
propertiesr   nameappendr*   r#   setattrpropertyr   r   r   r	   <module>   s$    1 

