📄 renderstyle.h
字号:
/* * Copyright (C) 2000 Lars Knoll (knoll@kde.org) * (C) 2000 Antti Koivisto (koivisto@kde.org) * (C) 2000 Dirk Mueller (mueller@kde.org) * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */#ifndef RenderStyle_h#define RenderStyle_h#include "TransformationMatrix.h"#include "AnimationList.h"#include "BorderData.h"#include "BorderValue.h"#include "CSSHelper.h"#include "CSSImageGeneratorValue.h"#include "CSSPrimitiveValue.h"#include "CSSReflectionDirection.h"#include "CSSValueList.h"#include "CachedImage.h"#include "CollapsedBorderValue.h"#include "Color.h"#include "ContentData.h"#include "CounterDirectives.h"#include "CursorList.h"#include "DataRef.h"#include "FillLayer.h"#include "FloatPoint.h"#include "Font.h"#include "GraphicsTypes.h"#include "IntRect.h"#include "Length.h"#include "LengthBox.h"#include "LengthSize.h"#include "NinePieceImage.h"#include "OutlineValue.h"#include "Pair.h"#include "RenderStyleConstants.h"#include "ShadowData.h"#include "StyleBackgroundData.h"#include "StyleBoxData.h"#include "StyleFlexibleBoxData.h"#include "StyleInheritedData.h"#include "StyleMarqueeData.h"#include "StyleMultiColData.h"#include "StyleRareInheritedData.h"#include "StyleRareNonInheritedData.h"#include "StyleReflection.h"#include "StyleSurroundData.h"#include "StyleTransformData.h"#include "StyleVisualData.h"#include "TextDirection.h"#include "ThemeTypes.h"#include "TimingFunction.h"#include "TransformOperations.h"#include <wtf/OwnPtr.h>#include <wtf/RefCounted.h>#include <wtf/StdLibExtras.h>#include <wtf/Vector.h>#if ENABLE(DASHBOARD_SUPPORT)#include "StyleDashboardRegion.h"#endif#if ENABLE(SVG)#include "SVGRenderStyle.h"#endif#if ENABLE(XBL)#include "BindingURI.h"#endiftemplate<typename T, typename U> inline bool compareEqual(const T& t, const U& u) { return t == static_cast<T>(u); }#define SET_VAR(group, variable, value) \ if (!compareEqual(group->variable, value)) \ group.access()->variable = value;namespace WebCore {using std::max;class CSSStyleSelector;class CSSValueList;class CachedImage;class Pair;class StringImpl;class StyleImage;class RenderStyle: public RefCounted<RenderStyle> { friend class CSSStyleSelector;protected:// !START SYNC!: Keep this in sync with the copy constructor in RenderStyle.cpp // inherit struct InheritedFlags { bool operator==(const InheritedFlags& other) const { return (_empty_cells == other._empty_cells) && (_caption_side == other._caption_side) && (_list_style_type == other._list_style_type) && (_list_style_position == other._list_style_position) && (_visibility == other._visibility) && (_text_align == other._text_align) && (_text_transform == other._text_transform) && (_text_decorations == other._text_decorations) && (_text_transform == other._text_transform) && (_cursor_style == other._cursor_style) && (_direction == other._direction) && (_border_collapse == other._border_collapse) && (_white_space == other._white_space) && (_box_direction == other._box_direction) && (_visuallyOrdered == other._visuallyOrdered) && (_htmlHacks == other._htmlHacks) && (_force_backgrounds_to_white == other._force_backgrounds_to_white) && (_pointerEvents == other._pointerEvents); } bool operator!=(const InheritedFlags& other) const { return !(*this == other); } unsigned _empty_cells : 1; // EEmptyCell unsigned _caption_side : 2; // ECaptionSide unsigned _list_style_type : 5 ; // EListStyleType unsigned _list_style_position : 1; // EListStylePosition unsigned _visibility : 2; // EVisibility unsigned _text_align : 3; // ETextAlign unsigned _text_transform : 2; // ETextTransform unsigned _text_decorations : 4; unsigned _cursor_style : 6; // ECursor unsigned _direction : 1; // TextDirection bool _border_collapse : 1 ; unsigned _white_space : 3; // EWhiteSpace unsigned _box_direction : 1; // EBoxDirection (CSS3 box_direction property, flexible box layout module) // non CSS2 inherited bool _visuallyOrdered : 1; bool _htmlHacks :1; bool _force_backgrounds_to_white : 1; unsigned _pointerEvents : 4; // EPointerEvents } inherited_flags;// don't inherit struct NonInheritedFlags { bool operator==(const NonInheritedFlags& other) const { return (_effectiveDisplay == other._effectiveDisplay) && (_originalDisplay == other._originalDisplay) && (_overflowX == other._overflowX) && (_overflowY == other._overflowY) && (_vertical_align == other._vertical_align) && (_clear == other._clear) && (_position == other._position) && (_floating == other._floating) && (_table_layout == other._table_layout) && (_page_break_before == other._page_break_before) && (_page_break_after == other._page_break_after) && (_styleType == other._styleType) && (_affectedByHover == other._affectedByHover) && (_affectedByActive == other._affectedByActive) && (_affectedByDrag == other._affectedByDrag) && (_pseudoBits == other._pseudoBits) && (_unicodeBidi == other._unicodeBidi); } bool operator!=(const NonInheritedFlags& other) const { return !(*this == other); } unsigned _effectiveDisplay : 5; // EDisplay unsigned _originalDisplay : 5; // EDisplay unsigned _overflowX : 3; // EOverflow unsigned _overflowY : 3; // EOverflow unsigned _vertical_align : 4; // EVerticalAlign unsigned _clear : 2; // EClear unsigned _position : 2; // EPosition unsigned _floating : 2; // EFloat unsigned _table_layout : 1; // ETableLayout unsigned _page_break_before : 2; // EPageBreak unsigned _page_break_after : 2; // EPageBreak unsigned _styleType : 5; // PseudoId bool _affectedByHover : 1; bool _affectedByActive : 1; bool _affectedByDrag : 1; unsigned _pseudoBits : 7; unsigned _unicodeBidi : 2; // EUnicodeBidi } noninherited_flags; // non-inherited attributes DataRef<StyleBoxData> box; DataRef<StyleVisualData> visual; DataRef<StyleBackgroundData> background; DataRef<StyleSurroundData> surround; DataRef<StyleRareNonInheritedData> rareNonInheritedData; // inherited attributes DataRef<StyleRareInheritedData> rareInheritedData; DataRef<StyleInheritedData> inherited; // list of associated pseudo styles RefPtr<RenderStyle> m_cachedPseudoStyle; unsigned m_pseudoState : 3; // PseudoState bool m_affectedByAttributeSelectors : 1; bool m_unique : 1; // Bits for dynamic child matching. bool m_affectedByEmpty : 1; bool m_emptyState : 1; // We optimize for :first-child and :last-child. The other positional child selectors like nth-child or // *-child-of-type, we will just give up and re-evaluate whenever children change at all. bool m_childrenAffectedByFirstChildRules : 1; bool m_childrenAffectedByLastChildRules : 1; bool m_childrenAffectedByDirectAdjacentRules : 1; bool m_childrenAffectedByForwardPositionalRules : 1; bool m_childrenAffectedByBackwardPositionalRules : 1; bool m_firstChildState : 1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -