source: webkit/trunk/Source/WebCore/css/CSSProperty.cpp

Last change on this file was 291946, checked in by [email protected], 3 years ago

Use static_assert instead of COMPILE_ASSERT
https://bugs.webkit.org/show_bug.cgi?id=238417

Reviewed by Mark Lam.

Source/JavaScriptCore:

  • assembler/ARM64Assembler.h:
  • assembler/ARMv7Assembler.h:
  • assembler/MacroAssemblerX86Common.h:
  • bytecode/Opcode.h:
  • bytecode/VirtualRegister.h:
  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNullOrUndefined):
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNullOrUndefined):
(JSC::DFG::SpeculativeJIT::compileToBooleanObjectOrOther):
(JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch):

  • inspector/InspectorProtocolTypes.h:

(Inspector::Protocol::BindingTraits<JSON::ArrayOf<T>>::runtimeCast):

  • inspector/scripts/codegen/cpp_generator_templates.py:
  • inspector/scripts/codegen/generate_cpp_protocol_types_header.py:
  • inspector/scripts/tests/expected/commands-with-async-attribute.json-result:
  • inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result:
  • inspector/scripts/tests/expected/definitions-with-mac-platform.json-result:
  • inspector/scripts/tests/expected/events-with-optional-parameters.json-result:
  • inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result:
  • inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result:
  • inspector/scripts/tests/expected/type-declaration-object-type.json-result:
  • inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result:
  • inspector/scripts/tests/expected/type-with-open-parameters.json-result:
  • jit/FPRInfo.h:
  • jit/GPRInfo.h:
  • parser/Parser.h:
  • runtime/JSCell.cpp:
  • runtime/JSObject.h:
  • runtime/SmallStrings.cpp:

(JSC::SmallStrings::SmallStrings):

  • runtime/Structure.h:

(JSC::Structure::outOfLineCapacity):

  • yarr/YarrInterpreter.cpp:

Source/WebCore:

  • animation/CSSPropertyAnimation.cpp:

(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):

  • contentextensions/DFANode.h:
  • css/CSSBasicShapes.cpp:

(WebCore::buildPolygonString):

  • css/CSSProperty.cpp:
  • css/CSSRule.cpp:
  • css/CSSValue.cpp:
  • css/StyleProperties.cpp:
  • css/StyleRule.cpp:
  • css/calc/CSSCalcOperationNode.cpp:

(WebCore::sortingCategoryForType):

  • dom/ElementData.cpp:
  • dom/NodeRareData.cpp:
  • dom/ShadowRoot.cpp:
  • dom/SpaceSplitString.cpp:
  • dom/StyledElement.cpp:
  • dom/TreeScope.cpp:
  • editing/HTMLInterchange.cpp:

(WebCore::convertHTMLTextToInterchangeFormat):

  • html/HTMLTrackElement.cpp:
  • html/track/VTTCue.cpp:
  • platform/Length.cpp:
  • platform/ScrollableArea.cpp:
  • platform/UserAgentQuirks.h:

(WebCore::UserAgentQuirks::UserAgentQuirks):

  • platform/graphics/FontCascadeDescription.cpp:
  • platform/graphics/Region.cpp:

(WebCore::Region::Shape::shapeOperation):

  • platform/graphics/TextRun.cpp:
  • platform/text/BidiContext.cpp:
  • platform/text/TextFlags.h:
  • platform/win/ImportedFunctionsEnumerator.cpp:

(WebCore::ImportedFunctionsEnumerator::addressOfCurrentFunctionPointer const):

  • rendering/BreakLines.cpp:
  • rendering/FloatingObjects.cpp:
  • rendering/LegacyInlineBox.cpp:
  • rendering/LegacyInlineFlowBox.cpp:
  • rendering/LegacyInlineTextBox.cpp:
  • rendering/LegacyRootInlineBox.cpp:
  • rendering/RenderBlock.cpp:
  • rendering/RenderBlockFlow.cpp:
  • rendering/RenderBox.cpp:
  • rendering/RenderObject.cpp:
  • rendering/RenderTableCell.cpp:
  • rendering/RenderText.cpp:
  • rendering/style/FillLayer.cpp:
  • rendering/style/RenderStyle.cpp:
  • rendering/style/StyleBoxData.cpp:
  • rendering/style/StyleRareInheritedData.cpp:
  • rendering/style/WillChangeData.h:
  • rendering/svg/SVGInlineTextBox.cpp:
  • style/RuleData.cpp:
  • svg/GradientAttributes.h:

Source/WebKit:

  • Platform/IPC/Connection.h:

(IPC::Connection::send):
(IPC::Connection::sendWithAsyncReply):
(IPC::Connection::sendSync):

  • Platform/IPC/MessageSender.h:
  • Platform/IPC/unix/ConnectionUnix.cpp:

(IPC::Connection::sendOutgoingMessage):

  • UIProcess/AuxiliaryProcessProxy.h:

(WebKit::AuxiliaryProcessProxy::send):
(WebKit::AuxiliaryProcessProxy::sendSync):
(WebKit::AuxiliaryProcessProxy::sendWithAsyncReply):

Source/WebKitLegacy/mac:

  • Plugins/WebBasePluginPackage.mm:

(-[WebBasePluginPackage isNativeLibraryData:]):

  • WebView/WebDynamicScrollBarsView.mm:

Source/WTF:

Use C++ static_assert instead of COMPILE_ASSERT.
Currently keeping it since it was also used in Internal code too.

  • wtf/CrossThreadCopier.cpp:
  • wtf/JSONValues.cpp:

(WTF::JSONImpl::ObjectBase::asObject):
(WTF::JSONImpl::ObjectBase::asObject const):
(WTF::JSONImpl::ArrayBase::asArray):

  • wtf/JSONValues.h:
  • wtf/glib/FileSystemGlib.cpp:

(WTF::FileSystemImpl::lockFile):

  • wtf/posix/FileSystemPOSIX.cpp:

(WTF::FileSystemImpl::lockFile):

  • wtf/text/AtomString.h:
  • Property svn:eol-style set to native
File size: 1.8 KB
Line 
1/**
2 * (C) 1999-2003 Lars Knoll ([email protected])
3 * Copyright (C) 2004-2021 Apple Inc.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#include "config.h"
22#include "CSSProperty.h"
23
24#include "CSSValueList.h"
25#include "StylePropertyShorthand.h"
26#include <wtf/NeverDestroyed.h>
27
28namespace WebCore {
29
30struct SameSizeAsCSSProperty {
31 uint32_t bitfields;
32 void* value;
33};
34
35static_assert(sizeof(CSSProperty) == sizeof(SameSizeAsCSSProperty), "CSSProperty should stay small");
36
37CSSPropertyID StylePropertyMetadata::shorthandID() const
38{
39 if (!m_isSetFromShorthand)
40 return CSSPropertyInvalid;
41
42 auto shorthands = matchingShorthandsForLonghand(static_cast<CSSPropertyID>(m_propertyID));
43 ASSERT(shorthands.size() && m_indexInShorthandsVector >= 0 && m_indexInShorthandsVector < shorthands.size());
44 return shorthands[m_indexInShorthandsVector].id();
45}
46
47void CSSProperty::wrapValueInCommaSeparatedList()
48{
49 auto list = CSSValueList::createCommaSeparated();
50 list.get().append(m_value.releaseNonNull());
51 m_value = WTFMove(list);
52}
53
54} // namespace WebCore
Note: See TracBrowser for help on using the repository browser.