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

📄 csscomputedstyledeclaration.cpp

📁 linux下开源浏览器WebKit的源码,市面上的很多商用浏览器都是移植自WebKit
💻 CPP
📖 第 1 页 / 共 5 页
字号:
/* * Copyright (C) 2004 Zack Rusin <zack@kde.org> * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301  USA */#include "config.h"#include "CSSComputedStyleDeclaration.h"#include "AnimationController.h"#include "CSSBorderImageValue.h"#include "CSSMutableStyleDeclaration.h"#include "CSSPrimitiveValue.h"#include "CSSPrimitiveValueMappings.h"#include "CSSPropertyNames.h"#include "CSSReflectValue.h"#include "CSSTimingFunctionValue.h"#include "CSSValueList.h"#include "CachedImage.h"#include "Document.h"#include "ExceptionCode.h"#include "Pair.h"#include "Rect.h"#include "RenderBox.h"#include "RenderLayer.h"#include "ShadowValue.h"#include "WebKitCSSTransformValue.h"#if ENABLE(DASHBOARD_SUPPORT)#include "DashboardRegion.h"#endifnamespace WebCore {// List of all properties we know how to compute, omitting shorthands.static const int computedProperties[] = {    CSSPropertyBackgroundAttachment,    CSSPropertyBackgroundColor,    CSSPropertyBackgroundImage,    // more specific background-position-x/y are non-standard    CSSPropertyBackgroundPosition,    CSSPropertyBackgroundRepeat,    CSSPropertyBorderBottomColor,    CSSPropertyBorderBottomStyle,    CSSPropertyBorderBottomWidth,    CSSPropertyBorderCollapse,    CSSPropertyBorderLeftColor,    CSSPropertyBorderLeftStyle,    CSSPropertyBorderLeftWidth,    CSSPropertyBorderRightColor,    CSSPropertyBorderRightStyle,    CSSPropertyBorderRightWidth,    CSSPropertyBorderTopColor,    CSSPropertyBorderTopStyle,    CSSPropertyBorderTopWidth,    CSSPropertyBottom,    CSSPropertyCaptionSide,    CSSPropertyClear,    CSSPropertyColor,    CSSPropertyCursor,    CSSPropertyDirection,    CSSPropertyDisplay,    CSSPropertyEmptyCells,    CSSPropertyFloat,    CSSPropertyFontFamily,    CSSPropertyFontSize,    CSSPropertyFontStyle,    CSSPropertyFontVariant,    CSSPropertyFontWeight,    CSSPropertyHeight,    CSSPropertyLeft,    CSSPropertyLetterSpacing,    CSSPropertyLineHeight,    CSSPropertyListStyleImage,    CSSPropertyListStylePosition,    CSSPropertyListStyleType,    CSSPropertyMarginBottom,    CSSPropertyMarginLeft,    CSSPropertyMarginRight,    CSSPropertyMarginTop,    CSSPropertyMaxHeight,    CSSPropertyMaxWidth,    CSSPropertyMinHeight,    CSSPropertyMinWidth,    CSSPropertyOpacity,    CSSPropertyOrphans,    CSSPropertyOutlineColor,    CSSPropertyOutlineStyle,    CSSPropertyOutlineWidth,    CSSPropertyOverflowX,    CSSPropertyOverflowY,    CSSPropertyPaddingBottom,    CSSPropertyPaddingLeft,    CSSPropertyPaddingRight,    CSSPropertyPaddingTop,    CSSPropertyPageBreakAfter,    CSSPropertyPageBreakBefore,    CSSPropertyPageBreakInside,    CSSPropertyPointerEvents,    CSSPropertyPosition,    CSSPropertyResize,    CSSPropertyRight,    CSSPropertyTableLayout,    CSSPropertyTextAlign,    CSSPropertyTextDecoration,    CSSPropertyTextIndent,    CSSPropertyTextShadow,    CSSPropertyTextTransform,    CSSPropertyTop,    CSSPropertyUnicodeBidi,    CSSPropertyVerticalAlign,    CSSPropertyVisibility,    CSSPropertyWhiteSpace,    CSSPropertyWidows,    CSSPropertyWidth,    CSSPropertyWordSpacing,    CSSPropertyWordWrap,    CSSPropertyZIndex,    CSSPropertyZoom,    CSSPropertyWebkitAnimationDelay,    CSSPropertyWebkitAnimationDirection,    CSSPropertyWebkitAnimationDuration,    CSSPropertyWebkitAnimationIterationCount,    CSSPropertyWebkitAnimationName,    CSSPropertyWebkitAnimationTimingFunction,    CSSPropertyWebkitAppearance,    CSSPropertyWebkitBackfaceVisibility,    CSSPropertyWebkitBackgroundClip,    CSSPropertyWebkitBackgroundComposite,    CSSPropertyWebkitBackgroundOrigin,    CSSPropertyWebkitBackgroundSize,    CSSPropertyWebkitBorderFit,    CSSPropertyWebkitBorderImage,    CSSPropertyWebkitBorderHorizontalSpacing,    CSSPropertyWebkitBorderVerticalSpacing,    CSSPropertyWebkitBoxAlign,    CSSPropertyWebkitBoxDirection,    CSSPropertyWebkitBoxFlex,    CSSPropertyWebkitBoxFlexGroup,    CSSPropertyWebkitBoxLines,    CSSPropertyWebkitBoxOrdinalGroup,    CSSPropertyWebkitBoxOrient,    CSSPropertyWebkitBoxPack,    CSSPropertyWebkitBoxReflect,    CSSPropertyWebkitBoxShadow,    CSSPropertyWebkitBoxSizing,    CSSPropertyWebkitColumnBreakAfter,    CSSPropertyWebkitColumnBreakBefore,    CSSPropertyWebkitColumnBreakInside,    CSSPropertyWebkitColumnCount,    CSSPropertyWebkitColumnGap,    CSSPropertyWebkitColumnRuleColor,    CSSPropertyWebkitColumnRuleStyle,    CSSPropertyWebkitColumnRuleWidth,    CSSPropertyWebkitColumnWidth,    CSSPropertyWebkitHighlight,    CSSPropertyWebkitLineBreak,    CSSPropertyWebkitLineClamp,    CSSPropertyWebkitMarginBottomCollapse,    CSSPropertyWebkitMarginTopCollapse,    CSSPropertyWebkitMarqueeDirection,    CSSPropertyWebkitMarqueeIncrement,    CSSPropertyWebkitMarqueeRepetition,    CSSPropertyWebkitMarqueeStyle,    CSSPropertyWebkitMaskAttachment,    CSSPropertyWebkitMaskBoxImage,    CSSPropertyWebkitMaskImage,    CSSPropertyWebkitMaskPosition,    CSSPropertyWebkitMaskRepeat,    CSSPropertyWebkitMaskClip,    CSSPropertyWebkitMaskComposite,    CSSPropertyWebkitMaskOrigin,    CSSPropertyWebkitMaskSize,    CSSPropertyWebkitNbspMode,    CSSPropertyWebkitPerspective,    CSSPropertyWebkitPerspectiveOrigin,    CSSPropertyWebkitRtlOrdering,    CSSPropertyWebkitTextDecorationsInEffect,    CSSPropertyWebkitTextFillColor,    CSSPropertyWebkitTextSecurity,    CSSPropertyWebkitTextStrokeColor,    CSSPropertyWebkitTextStrokeWidth,    CSSPropertyWebkitTransform,    CSSPropertyWebkitTransformOrigin,    CSSPropertyWebkitTransformStyle,    CSSPropertyWebkitTransitionDelay,    CSSPropertyWebkitTransitionDuration,    CSSPropertyWebkitTransitionProperty,    CSSPropertyWebkitTransitionTimingFunction,    CSSPropertyWebkitUserDrag,    CSSPropertyWebkitUserModify,    CSSPropertyWebkitUserSelect,#if ENABLE(DASHBOARD_SUPPORT)    CSSPropertyWebkitDashboardRegion,#endif    CSSPropertyWebkitBorderBottomLeftRadius,    CSSPropertyWebkitBorderBottomRightRadius,    CSSPropertyWebkitBorderTopLeftRadius,    CSSPropertyWebkitBorderTopRightRadius    #if ENABLE(SVG)    ,    CSSPropertyClipPath,    CSSPropertyClipRule,    CSSPropertyMask,    CSSPropertyFilter,    CSSPropertyFloodColor,    CSSPropertyFloodOpacity,    CSSPropertyLightingColor,    CSSPropertyStopColor,    CSSPropertyStopOpacity,    CSSPropertyColorInterpolation,    CSSPropertyColorInterpolationFilters,    CSSPropertyColorRendering,    CSSPropertyFill,    CSSPropertyFillOpacity,    CSSPropertyFillRule,    CSSPropertyImageRendering,    CSSPropertyMarkerEnd,    CSSPropertyMarkerMid,    CSSPropertyMarkerStart,    CSSPropertyShapeRendering,    CSSPropertyStroke,    CSSPropertyStrokeDasharray,    CSSPropertyStrokeDashoffset,    CSSPropertyStrokeLinecap,    CSSPropertyStrokeLinejoin,    CSSPropertyStrokeMiterlimit,    CSSPropertyStrokeOpacity,    CSSPropertyStrokeWidth,    CSSPropertyTextRendering,    CSSPropertyAlignmentBaseline,    CSSPropertyBaselineShift,    CSSPropertyDominantBaseline,    CSSPropertyKerning,    CSSPropertyTextAnchor,    CSSPropertyWritingMode,    CSSPropertyGlyphOrientationHorizontal,    CSSPropertyGlyphOrientationVertical#endif};const unsigned numComputedProperties = sizeof(computedProperties) / sizeof(computedProperties[0]);static PassRefPtr<CSSValue> valueForShadow(const ShadowData* shadow){    if (!shadow)        return CSSPrimitiveValue::createIdentifier(CSSValueNone);    RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();    for (const ShadowData* s = shadow; s; s = s->next) {        RefPtr<CSSPrimitiveValue> x = CSSPrimitiveValue::create(s->x, CSSPrimitiveValue::CSS_PX);        RefPtr<CSSPrimitiveValue> y = CSSPrimitiveValue::create(s->y, CSSPrimitiveValue::CSS_PX);        RefPtr<CSSPrimitiveValue> blur = CSSPrimitiveValue::create(s->blur, CSSPrimitiveValue::CSS_PX);        RefPtr<CSSPrimitiveValue> color = CSSPrimitiveValue::createColor(s->color.rgb());        list->prepend(ShadowValue::create(x.release(), y.release(), blur.release(), color.release()));    }    return list.release();}static int valueForRepeatRule(int rule){    switch (rule) {        case RepeatImageRule:            return CSSValueRepeat;        case RoundImageRule:            return CSSValueRound;

⌨️ 快捷键说明

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