📄 render_style.h
字号:
Length backgroundXPosition() const { return background->m_background.m_xPosition; } Length backgroundYPosition() const { return background->m_background.m_yPosition; } BackgroundLayer* accessBackgroundLayers() { return &(background.access()->m_background); } const BackgroundLayer* backgroundLayers() const { return &(background->m_background); } // returns true for collapsing borders, false for separate borders bool borderCollapse() const { return inherited_flags.f._border_collapse; } short borderHorizontalSpacing() const { return inherited->border_hspacing; } short borderVerticalSpacing() const { return inherited->border_vspacing; } EEmptyCell emptyCells() const { return inherited_flags.f._empty_cells; } ECaptionSide captionSide() const { return inherited_flags.f._caption_side; } EListStyleType listStyleType() const { return inherited_flags.f._list_style_type; } CachedImage *listStyleImage() const { return inherited->style_image; } EListStylePosition listStylePosition() const { return inherited_flags.f._list_style_position; } Length marginTop() const { return surround->margin.top; } Length marginBottom() const { return surround->margin.bottom; } Length marginLeft() const { return surround->margin.left; } Length marginRight() const { return surround->margin.right; } Length paddingTop() const { return surround->padding.top; } Length paddingBottom() const { return surround->padding.bottom; } Length paddingLeft() const { return surround->padding.left; } Length paddingRight() const { return surround->padding.right; } ECursor cursor() const { return inherited_flags.f._cursor_style; } short widows() const { return inherited->widows; } short orphans() const { return inherited->orphans; } bool pageBreakInside() const { return inherited_flags.f._page_break_inside; } EPageBreak pageBreakBefore() const { return noninherited_flags.f._page_break_before; } EPageBreak pageBreakAfter() const { return noninherited_flags.f._page_break_after; } DOM::QuotesValueImpl* quotes() const { return inherited->quotes; } QString openQuote(int level) const; QString closeQuote(int level) const; // CSS3 Getter Methods EBoxSizing boxSizing() const { return box->box_sizing; } int outlineOffset() const { if (background->m_outline.style == BNONE || background->m_outline.style == BHIDDEN) return 0; return background->m_outline._offset; } ShadowData* textShadow() const { return css3InheritedData->textShadow; } float opacity() { return css3NonInheritedData->opacity; } EUserInput userInput() const { return inherited_flags.f._user_input; } Length marqueeIncrement() { return css3NonInheritedData->marquee->increment; } int marqueeSpeed() { return css3NonInheritedData->marquee->speed; } int marqueeLoopCount() { return css3NonInheritedData->marquee->loops; } EMarqueeBehavior marqueeBehavior() { return css3NonInheritedData->marquee->behavior; } EMarqueeDirection marqueeDirection() { return css3NonInheritedData->marquee->direction; } // End CSS3 Getters// attribute setter methods void setDisplay(EDisplay v) { noninherited_flags.f._display = v; } void setOriginalDisplay(EDisplay v) { noninherited_flags.f._originalDisplay = v; } void setPosition(EPosition v) { noninherited_flags.f._position = v; } void setFloating(EFloat v) { noninherited_flags.f._floating = v; } void setLeft(Length v) { SET_VAR(surround,offset.left,v) } void setRight(Length v) { SET_VAR(surround,offset.right,v) } void setTop(Length v) { SET_VAR(surround,offset.top,v) } void setBottom(Length v){ SET_VAR(surround,offset.bottom,v) } void setWidth(Length v) { SET_VAR(box,width,v) } void setHeight(Length v) { SET_VAR(box,height,v) } void setMinWidth(Length v) { SET_VAR(box,min_width,v) } void setMaxWidth(Length v) { SET_VAR(box,max_width,v) } void setMinHeight(Length v) { SET_VAR(box,min_height,v) } void setMaxHeight(Length v) { SET_VAR(box,max_height,v) } void resetBorderTop() { SET_VAR(surround, border.top, BorderValue()) } void resetBorderRight() { SET_VAR(surround, border.right, BorderValue()) } void resetBorderBottom() { SET_VAR(surround, border.bottom, BorderValue()) } void resetBorderLeft() { SET_VAR(surround, border.left, BorderValue()) } void resetOutline() { SET_VAR(background, m_outline, OutlineValue()) } void setBackgroundColor(const QColor& v) { SET_VAR(background, m_color, v) } void setBorderLeftWidth(unsigned short v) { SET_VAR(surround,border.left.width,v) } void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround,border.left.style,v) } void setBorderLeftColor(const QColor & v) { SET_VAR(surround,border.left.color,v) } void setBorderRightWidth(unsigned short v) { SET_VAR(surround,border.right.width,v) } void setBorderRightStyle(EBorderStyle v) { SET_VAR(surround,border.right.style,v) } void setBorderRightColor(const QColor & v) { SET_VAR(surround,border.right.color,v) } void setBorderTopWidth(unsigned short v) { SET_VAR(surround,border.top.width,v) } void setBorderTopStyle(EBorderStyle v) { SET_VAR(surround,border.top.style,v) } void setBorderTopColor(const QColor & v) { SET_VAR(surround,border.top.color,v) } void setBorderBottomWidth(unsigned short v) { SET_VAR(surround,border.bottom.width,v) } void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround,border.bottom.style,v) } void setBorderBottomColor(const QColor & v) { SET_VAR(surround,border.bottom.color,v) } void setOutlineWidth(unsigned short v) { SET_VAR(background,m_outline.width,v) } void setOutlineStyle(EBorderStyle v, bool isAuto = false) { SET_VAR(background,m_outline.style,v) SET_VAR(background,m_outline._auto, isAuto) } void setOutlineColor(const QColor & v) { SET_VAR(background,m_outline.color,v) } void setOverflow(EOverflow v) { noninherited_flags.f._overflow = v; } void setVisibility(EVisibility v) { inherited_flags.f._visibility = v; } void setVerticalAlign(EVerticalAlign v) { noninherited_flags.f._vertical_align = v; } void setVerticalAlignLength(Length l) { SET_VAR(box, vertical_align, l ) } void setClipLeft(Length v) { SET_VAR(visual,clip.left,v) } void setClipRight(Length v) { SET_VAR(visual,clip.right,v) } void setClipTop(Length v) { SET_VAR(visual,clip.top,v) } void setClipBottom(Length v) { SET_VAR(visual,clip.bottom,v) } void setClip( Length top, Length right, Length bottom, Length left ); void setHasClip( bool b ) { noninherited_flags.f._hasClip = b; } void setUnicodeBidi( EUnicodeBidi b ) { noninherited_flags.f._unicodeBidi = b; } void setClear(EClear v) { noninherited_flags.f._clear = v; } void setTableLayout(ETableLayout v) { noninherited_flags.f._table_layout = v; } bool setFontDef(const khtml::FontDef & v) { // bah, this doesn't compare pointers. broken! (Dirk) if (!(inherited->font.fontDef == v)) { inherited.access()->font = Font( v ); return true; } return false; } void setColor(const QColor & v) { SET_VAR(inherited,color,v) } void setTextIndent(Length v) { SET_VAR(inherited,indent,v) } void setTextAlign(ETextAlign v) { inherited_flags.f._text_align = v; } void setTextTransform(ETextTransform v) { inherited_flags.f._text_transform = v; } void addToTextDecorationsInEffect(int v) { inherited_flags.f._text_decorations |= v; } void setTextDecorationsInEffect(int v) { inherited_flags.f._text_decorations = v; } void setTextDecoration(unsigned v) { SET_VAR(visual, textDecoration, v); } void setDirection(EDirection v) { inherited_flags.f._direction = v; } void setLineHeight(Length v) { SET_VAR(inherited,line_height,v) } void setWhiteSpace(EWhiteSpace v) { inherited_flags.f._white_space = v; } void setWordSpacing(int v) { SET_VAR(inherited,font.wordSpacing,v) } void setLetterSpacing(int v) { SET_VAR(inherited,font.letterSpacing,v) } void clearBackgroundLayers() { background.access()->m_background = BackgroundLayer(); } void inheritBackgroundLayers(const BackgroundLayer& parent) { background.access()->m_background = parent; } void adjustBackgroundLayers(); void setBorderCollapse(bool collapse) { inherited_flags.f._border_collapse = collapse; } void setBorderHorizontalSpacing(short v) { SET_VAR(inherited,border_hspacing,v) } void setBorderVerticalSpacing(short v) { SET_VAR(inherited,border_vspacing,v) } void setEmptyCells(EEmptyCell v) { inherited_flags.f._empty_cells = v; } void setCaptionSide(ECaptionSide v) { inherited_flags.f._caption_side = v; } void setListStyleType(EListStyleType v) { inherited_flags.f._list_style_type = v; } void setListStyleImage(CachedImage *v) { SET_VAR(inherited,style_image,v)} void setListStylePosition(EListStylePosition v) { inherited_flags.f._list_style_position = v; } void resetMargin() { SET_VAR(surround, margin, LengthBox(Fixed)) } void setMarginTop(Length v) { SET_VAR(surround,margin.top,v) } void setMarginBottom(Length v) { SET_VAR(surround,margin.bottom,v) } void setMarginLeft(Length v) { SET_VAR(surround,margin.left,v) } void setMarginRight(Length v) { SET_VAR(surround,margin.right,v) } void resetPadding() { SET_VAR(surround, padding, LengthBox(Variable)) } void setPaddingTop(Length v) { SET_VAR(surround,padding.top,v) } void setPaddingBottom(Length v) { SET_VAR(surround,padding.bottom,v) } void setPaddingLeft(Length v) { SET_VAR(surround,padding.left,v) } void setPaddingRight(Length v) { SET_VAR(surround,padding.right,v) } void setCursor( ECursor c ) { inherited_flags.f._cursor_style = c; } bool htmlHacks() const { return inherited_flags.f._htmlHacks; } void setHtmlHacks(bool b=true) { inherited_flags.f._htmlHacks = b; } bool flowAroundFloats() const { return noninherited_flags.f._flowAroundFloats; } void setFlowAroundFloats(bool b=true) { noninherited_flags.f._flowAroundFloats = b; } int zIndex() const { return box->z_auto? 0 : box->z_index; } void setZIndex(int v) { SET_VAR(box,z_auto,false ); SET_VAR(box, z_index, v); } bool hasAutoZIndex() const { return box->z_auto; } void setHasAutoZIndex() { SET_VAR(box, z_auto, true ); } void setWidows(short w) { SET_VAR(inherited, widows, w); } void setOrphans(short o) { SET_VAR(inherited, orphans, o); } void setPageBreakInside(bool b) { inherited_flags.f._page_break_inside = b; } void setPageBreakBefore(EPageBreak b) { noninherited_flags.f._page_break_before = b; } void setPageBreakAfter(EPageBreak b) { noninherited_flags.f._page_break_after = b; } void setQuotes(DOM::QuotesValueImpl* q); // CSS3 Setters void setBoxSizing( EBoxSizing b ) { SET_VAR(box,box_sizing,b); } 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 setUserInput(EUserInput ui) { inherited_flags.f._user_input = ui; } void setMarqueeIncrement(const Length& f) { SET_VAR(css3NonInheritedData.access()->marquee, increment, f); } void setMarqueeSpeed(int f) { SET_VAR(css3NonInheritedData.access()->marquee, speed, f); } void setMarqueeDirection(EMarqueeDirection d) { SET_VAR(css3NonInheritedData.access()->marquee, direction, d); } void setMarqueeBehavior(EMarqueeBehavior b) { SET_VAR(css3NonInheritedData.access()->marquee, behavior, b); } void setMarqueeLoopCount(int i) { SET_VAR(css3NonInheritedData.access()->marquee, loops, i); } // End CSS3 Setters QPalette palette() const { return visual->palette; } void setPaletteColor(QPalette::ColorGroup g, QColorGroup::ColorRole r, const QColor& c); void resetPalette() // Called when the desktop color scheme changes. { const_cast<StyleVisualData *>(visual.get())->palette = QApplication::palette(); } ContentData* contentData() const { return content; } bool contentDataEquivalent(RenderStyle* otherStyle); void setContent(DOM::DOMStringImpl* s, bool add); void setContent(CachedObject* o, bool add); void setContent(DOM::CounterImpl* c, bool add); void setContent(EQuoteContent q, bool add); void setContentNone(); void setContentNormal(); DOM::CSSValueListImpl* counterReset() const { return counter_reset; } DOM::CSSValueListImpl* counterIncrement() const { return counter_increment; } bool counterDataEquivalent(RenderStyle* otherStyle); void setCounterReset(DOM::CSSValueListImpl* v); void setCounterIncrement(DOM::CSSValueListImpl* v); bool hasCounterReset(const DOM::DOMString& c) const; bool hasCounterIncrement(const DOM::DOMString& c) const; short counterReset(const DOM::DOMString& c) const; short counterIncrement(const DOM::DOMString& c) const; bool inheritedNotEqual( RenderStyle *other ) const; enum Diff { Equal, NonVisible = Equal, Visible, Position, Layout, CbLayout }; Diff diff( const RenderStyle *other ) const; bool isDisplayReplacedType() { return display() == INLINE_BLOCK ||/* display() == INLINE_BOX ||*/ display() == INLINE_TABLE; } bool isDisplayInlineType() { return display() == INLINE || isDisplayReplacedType(); } bool isOriginalDisplayInlineType() { return originalDisplay() == INLINE || originalDisplay() == INLINE_BLOCK || /*originalDisplay() == INLINE_BOX ||*/ originalDisplay() == INLINE_TABLE; }#ifdef ENABLE_DUMP QString createDiff( const RenderStyle &parent ) const;#endif // Initial values for all the properties static bool initialBackgroundAttachment() { return true; } static EBackgroundRepeat initialBackgroundRepeat() { return REPEAT; } static bool initialBorderCollapse() { return false; } static EBorderStyle initialBorderStyle() { return BNONE; } static ECaptionSide initialCaptionSide() { return CAPTOP; } static EClear initialClear() { return CNONE; } static EDirection initialDirection() { return LTR; } static EDisplay initialDisplay() { return INLINE; } static EEmptyCell initialEmptyCells() { return SHOW; } static EFloat initialFloating() { return FNONE; } static EListStylePosition initialListStylePosition() { return OUTSIDE; } static EListStyleType initialListStyleType() { return LDISC; } static EOverflow initialOverflow() { return OVISIBLE; } static EPageBreak initialPageBreak() { return PBAUTO; } static EPosition initialPosition() { return STATIC; } static ETableLayout initialTableLayout() { return TAUTO; } static EUnicodeBidi initialUnicodeBidi() { return UBNormal; } static DOM::QuotesValueImpl* initialQuotes() { return 0; } static EBoxSizing initialBoxSizing() { return CONTENT_BOX; } static ETextTransform initialTextTransform() { return TTNONE; } static EVisibility initialVisibility() { return VISIBLE; } static EWhiteSpace initialWhiteSpace() { return NORMAL; } static Length initialBackgroundXPosition() { return Length(); } static Length initialBackgroundYPosition() { return Length(); } static short initialBorderHorizontalSpacing() { return 0; } static short initialBorderVerticalSpacing() { return 0; } static ECursor initialCursor() { return CURSOR_AUTO; } static QColor initialColor() { return Qt::black; } static CachedImage* initialBackgroundImage() { return 0; } static CachedImage* initialListStyleImage() { return 0; } static unsigned short initialBorderWidth() { return 3; } static int initialLetterWordSpacing() { return 0; } static Length initialSize() { return Length(); } static Length initialMinSize() { return Length(0, Fixed); } static Length initialMaxSize() { return Length(UNDEFINED, Fixed); } static Length initialOffset() { return Length(); } static Length initialMargin() { return Length(Fixed); } static Length initialPadding() { return Length(Variable); } static Length initialTextIndent() { return Length(Fixed); } static EVerticalAlign initialVerticalAlign() { return BASELINE; } static int initialWidows() { return 2; } static int initialOrphans() { return 2; } static Length initialLineHeight() { return Length(-100, Percent); } static ETextAlign initialTextAlign() { return TAAUTO; } static ETextDecoration initialTextDecoration() { return TDNONE; } static bool initialFlowAroundFloats() { return false; } static int initialOutlineOffset() { return 0; } static float initialOpacity() { return 1.0f; } static int initialMarqueeLoopCount() { return -1; } static int initialMarqueeSpeed() { return 85; } static Length initialMarqueeIncrement() { return Length(6, Fixed); } static EMarqueeBehavior initialMarqueeBehavior() { return MSCROLL; } static EMarqueeDirection initialMarqueeDirection() { return MAUTO; }};class RenderPageStyle { friend class CSSStyleSelector;public: enum PageType { NO_PAGE = 0, ANY_PAGE, FIRST_PAGE, LEFT_PAGES, RIGHT_PAGES }; RenderPageStyle(); ~RenderPageStyle(); PageType pageType() { return m_pageType; } RenderPageStyle* getPageStyle(PageType type); RenderPageStyle* addPageStyle(PageType type); void removePageStyle(PageType type); Length marginTop() const { return margin.top; } Length marginBottom() const { return margin.bottom; } Length marginLeft() const { return margin.left; } Length marginRight() const { return margin.right; } Length pageWidth() const { return m_pageWidth; } Length pageHeight() const { return m_pageHeight; } void setMarginTop(Length v) { margin.top = v; } void setMarginBottom(Length v) { margin.bottom = v; } void setMarginLeft(Length v) { margin.left = v; } void setMarginRight(Length v) { margin.right = v; } void setPageWidth(Length v) { m_pageWidth = v; } void setPageHeight(Length v) { m_pageHeight = v; }protected: RenderPageStyle *next; PageType m_pageType; LengthBox margin; Length m_pageWidth; Length m_pageHeight;};} // namespace#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -