⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 renderstyle.h

📁 linux下开源浏览器WebKit的源码,市面上的很多商用浏览器都是移植自WebKit
💻 H
📖 第 1 页 / 共 5 页
字号:
    bool m_lastChildState : 1;    unsigned m_childIndex : 18; // Plenty of bits to cache an index.#if ENABLE(SVG)    DataRef<SVGRenderStyle> m_svgStyle;#endif// !END SYNC!protected:    void setBitDefaults()    {        inherited_flags._empty_cells = initialEmptyCells();        inherited_flags._caption_side = initialCaptionSide();        inherited_flags._list_style_type = initialListStyleType();        inherited_flags._list_style_position = initialListStylePosition();        inherited_flags._visibility = initialVisibility();        inherited_flags._text_align = initialTextAlign();        inherited_flags._text_transform = initialTextTransform();        inherited_flags._text_decorations = initialTextDecoration();        inherited_flags._cursor_style = initialCursor();        inherited_flags._direction = initialDirection();        inherited_flags._border_collapse = initialBorderCollapse();        inherited_flags._white_space = initialWhiteSpace();        inherited_flags._visuallyOrdered = initialVisuallyOrdered();        inherited_flags._htmlHacks=false;        inherited_flags._box_direction = initialBoxDirection();        inherited_flags._force_backgrounds_to_white = false;        inherited_flags._pointerEvents = initialPointerEvents();        noninherited_flags._effectiveDisplay = noninherited_flags._originalDisplay = initialDisplay();        noninherited_flags._overflowX = initialOverflowX();        noninherited_flags._overflowY = initialOverflowY();        noninherited_flags._vertical_align = initialVerticalAlign();        noninherited_flags._clear = initialClear();        noninherited_flags._position = initialPosition();        noninherited_flags._floating = initialFloating();        noninherited_flags._table_layout = initialTableLayout();        noninherited_flags._page_break_before = initialPageBreak();        noninherited_flags._page_break_after = initialPageBreak();        noninherited_flags._styleType = NOPSEUDO;        noninherited_flags._affectedByHover = false;        noninherited_flags._affectedByActive = false;        noninherited_flags._affectedByDrag = false;        noninherited_flags._pseudoBits = 0;        noninherited_flags._unicodeBidi = initialUnicodeBidi();    }protected:    RenderStyle();    // used to create the default style.    RenderStyle(bool);    RenderStyle(const RenderStyle&);public:    static PassRefPtr<RenderStyle> create();    static PassRefPtr<RenderStyle> createDefaultStyle();    static PassRefPtr<RenderStyle> clone(const RenderStyle*);    ~RenderStyle();    void inheritFrom(const RenderStyle* inheritParent);    PseudoId styleType() { return static_cast<PseudoId>(noninherited_flags._styleType); }    void setStyleType(PseudoId styleType) { noninherited_flags._styleType = styleType; }    RenderStyle* getCachedPseudoStyle(PseudoId);    RenderStyle* addCachedPseudoStyle(PassRefPtr<RenderStyle>);    bool affectedByHoverRules() const { return noninherited_flags._affectedByHover; }    bool affectedByActiveRules() const { return noninherited_flags._affectedByActive; }    bool affectedByDragRules() const { return noninherited_flags._affectedByDrag; }    void setAffectedByHoverRules(bool b) { noninherited_flags._affectedByHover = b; }    void setAffectedByActiveRules(bool b) { noninherited_flags._affectedByActive = b; }    void setAffectedByDragRules(bool b) { noninherited_flags._affectedByDrag = b; }    bool operator==(const RenderStyle& other) const;    bool operator!=(const RenderStyle& other) const { return !(*this == other); }    bool isFloating() const { return !(noninherited_flags._floating == FNONE); }    bool hasMargin() const { return surround->margin.nonZero(); }    bool hasBorder() const { return surround->border.hasBorder(); }    bool hasPadding() const { return surround->padding.nonZero(); }    bool hasOffset() const { return surround->offset.nonZero(); }    bool hasBackground() const    {        if (backgroundColor().isValid() && backgroundColor().alpha() > 0)            return true;        return background->m_background.hasImage();    }    bool hasBackgroundImage() const { return background->m_background.hasImage(); }    bool hasFixedBackgroundImage() const { return background->m_background.hasFixedImage(); }    bool hasAppearance() const { return appearance() != NoControlPart; }    bool visuallyOrdered() const { return inherited_flags._visuallyOrdered; }    void setVisuallyOrdered(bool b) { inherited_flags._visuallyOrdered = b; }    bool isStyleAvailable() const;    bool hasPseudoStyle(PseudoId pseudo) const;    void setHasPseudoStyle(PseudoId pseudo);    // attribute getter methods    EDisplay display() const { return static_cast<EDisplay>(noninherited_flags._effectiveDisplay); }    EDisplay originalDisplay() const { return static_cast<EDisplay>(noninherited_flags._originalDisplay); }    Length left() const { return surround->offset.left(); }    Length right() const { return surround->offset.right(); }    Length top() const { return surround->offset.top(); }    Length bottom() const { return surround->offset.bottom(); }    // Whether or not a positioned element requires normal flow x/y to be computed    // to determine its position.    bool hasStaticX() const { return (left().isAuto() && right().isAuto()) || left().isStatic() || right().isStatic(); }    bool hasStaticY() const { return (top().isAuto() && bottom().isAuto()) || top().isStatic(); }    EPosition position() const { return static_cast<EPosition>(noninherited_flags._position); }    EFloat floating() const { return static_cast<EFloat>(noninherited_flags._floating); }    Length width() const { return box->width; }    Length height() const { return box->height; }    Length minWidth() const { return box->min_width; }    Length maxWidth() const { return box->max_width; }    Length minHeight() const { return box->min_height; }    Length maxHeight() const { return box->max_height; }    const BorderData& border() const { return surround->border; }    const BorderValue& borderLeft() const { return surround->border.left; }    const BorderValue& borderRight() const { return surround->border.right; }    const BorderValue& borderTop() const { return surround->border.top; }    const BorderValue& borderBottom() const { return surround->border.bottom; }    const NinePieceImage& borderImage() const { return surround->border.image; }    const IntSize& borderTopLeftRadius() const { return surround->border.topLeft; }    const IntSize& borderTopRightRadius() const { return surround->border.topRight; }    const IntSize& borderBottomLeftRadius() const { return surround->border.bottomLeft; }    const IntSize& borderBottomRightRadius() const { return surround->border.bottomRight; }    bool hasBorderRadius() const { return surround->border.hasBorderRadius(); }    unsigned short borderLeftWidth() const { return surround->border.borderLeftWidth(); }    EBorderStyle borderLeftStyle() const { return surround->border.left.style(); }    const Color& borderLeftColor() const { return surround->border.left.color; }    bool borderLeftIsTransparent() const { return surround->border.left.isTransparent(); }    unsigned short borderRightWidth() const { return surround->border.borderRightWidth(); }    EBorderStyle borderRightStyle() const { return surround->border.right.style(); }    const Color& borderRightColor() const { return surround->border.right.color; }    bool borderRightIsTransparent() const { return surround->border.right.isTransparent(); }    unsigned short borderTopWidth() const { return surround->border.borderTopWidth(); }    EBorderStyle borderTopStyle() const { return surround->border.top.style(); }    const Color& borderTopColor() const { return surround->border.top.color; }    bool borderTopIsTransparent() const { return surround->border.top.isTransparent(); }    unsigned short borderBottomWidth() const { return surround->border.borderBottomWidth(); }    EBorderStyle borderBottomStyle() const { return surround->border.bottom.style(); }    const Color& borderBottomColor() const { return surround->border.bottom.color; }    bool borderBottomIsTransparent() const { return surround->border.bottom.isTransparent(); }    unsigned short outlineSize() const { return max(0, outlineWidth() + outlineOffset()); }    unsigned short outlineWidth() const    {        if (background->m_outline.style() == BNONE)            return 0;        return background->m_outline.width;    }    bool hasOutline() const { return outlineWidth() > 0 && outlineStyle() > BHIDDEN; }    EBorderStyle outlineStyle() const { return background->m_outline.style(); }    bool outlineStyleIsAuto() const { return background->m_outline._auto; }    const Color& outlineColor() const { return background->m_outline.color; }    EOverflow overflowX() const { return static_cast<EOverflow>(noninherited_flags._overflowX); }    EOverflow overflowY() const { return static_cast<EOverflow>(noninherited_flags._overflowY); }    EVisibility visibility() const { return static_cast<EVisibility>(inherited_flags._visibility); }    EVerticalAlign verticalAlign() const { return static_cast<EVerticalAlign>(noninherited_flags._vertical_align); }    Length verticalAlignLength() const { return box->vertical_align; }    Length clipLeft() const { return visual->clip.left(); }    Length clipRight() const { return visual->clip.right(); }    Length clipTop() const { return visual->clip.top(); }    Length clipBottom() const { return visual->clip.bottom(); }    LengthBox clip() const { return visual->clip; }    bool hasClip() const { return visual->hasClip; }    EUnicodeBidi unicodeBidi() const { return static_cast<EUnicodeBidi>(noninherited_flags._unicodeBidi); }    EClear clear() const { return static_cast<EClear>(noninherited_flags._clear); }    ETableLayout tableLayout() const { return static_cast<ETableLayout>(noninherited_flags._table_layout); }    const Font& font() const { return inherited->font; }    const FontDescription& fontDescription() const { return inherited->font.fontDescription(); }    int fontSize() const { return inherited->font.pixelSize(); }    const Color& color() const { return inherited->color; }    Length textIndent() const { return inherited->indent; }    ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flags._text_align); }    ETextTransform textTransform() const { return static_cast<ETextTransform>(inherited_flags._text_transform); }    int textDecorationsInEffect() const { return inherited_flags._text_decorations; }    int textDecoration() const { return visual->textDecoration; }    int wordSpacing() const { return inherited->font.wordSpacing(); }    int letterSpacing() const { return inherited->font.letterSpacing(); }    float zoom() const { return visual->m_zoom; }    float effectiveZoom() const { return inherited->m_effectiveZoom; }    TextDirection direction() const { return static_cast<TextDirection>(inherited_flags._direction); }    Length lineHeight() const { return inherited->line_height; }    int computedLineHeight() const    {        Length lh = lineHeight();        // Negative value means the line height is not set.  Use the font's built-in spacing.        if (lh.isNegative())            return font().lineSpacing();        if (lh.isPercent())            return lh.calcMinValue(fontSize());        return lh.value();    }    EWhiteSpace whiteSpace() const { return static_cast<EWhiteSpace>(inherited_flags._white_space); }    static bool autoWrap(EWhiteSpace ws)    {        // Nowrap and pre don't automatically wrap.        return ws != NOWRAP && ws != PRE;    }    bool autoWrap() const    {        return autoWrap(whiteSpace());    }    static bool preserveNewline(EWhiteSpace ws)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -