haikuwebkit/Source/WebCore/mathml/MathMLOperatorDictionary.h

62 lines
2.4 KiB
C
Raw Permalink Normal View History

/*
* Copyright (C) 2015 Frederic Wang (fred.wang@free.fr). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
Cleanup of MathML headers https://bugs.webkit.org/show_bug.cgi?id=159336 Reviewed by Alex Christensen. We do some cleanup in MathML headers: - Use #pragma once - Use final for class that are not extended. - Use final instead of override for virtual members that are not overridden by derived classes. - Try and reduce the visibility of function members to private or protected as appropriate. - Remove useless #include - Remove useless class or friendship declaration - Remove unused functions No new tests, behavior is unchanged. * mathml/MathMLElement.h: * mathml/MathMLInlineContainerElement.h: * mathml/MathMLMathElement.h: * mathml/MathMLMencloseElement.h: * mathml/MathMLOperatorDictionary.h: * mathml/MathMLPaddedElement.h: * mathml/MathMLSelectElement.h: * mathml/MathMLSpaceElement.h: * mathml/MathMLTextElement.h: * rendering/mathml/MathOperator.h: * rendering/mathml/RenderMathMLBlock.h: * rendering/mathml/RenderMathMLFenced.h: * rendering/mathml/RenderMathMLFraction.h: * rendering/mathml/RenderMathMLMath.h: * rendering/mathml/RenderMathMLMenclose.h: * rendering/mathml/RenderMathMLOperator.h: * rendering/mathml/RenderMathMLRoot.h: * rendering/mathml/RenderMathMLRow.cpp: (WebCore::RenderMathMLRow::RenderMathMLRow): Deleted. We no longer create anonymous row. * rendering/mathml/RenderMathMLRow.h: * rendering/mathml/RenderMathMLScripts.h: * rendering/mathml/RenderMathMLSpace.h: * rendering/mathml/RenderMathMLToken.h: * rendering/mathml/RenderMathMLUnderOver.h: Canonical link: https://commits.webkit.org/177918@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203228 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-07-14 17:59:17 +00:00
#pragma once
#if ENABLE(MATHML)
Remove <wtf/Optional.h> https://bugs.webkit.org/show_bug.cgi?id=226437 Reviewed by Chris Dumez. Source/JavaScriptCore: * <many files>: Remove include of <wtf/Optional.h>. * inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py: (CppBackendDispatcherHeaderGenerator._generate_secondary_header_includes): Don't generate an include of wtf/Optional.h; including WTFString.h takes care of this anyway. * inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py: (CppFrontendDispatcherHeaderGenerator._generate_secondary_header_includes): Ditto. * inspector/scripts/codegen/generate_cpp_protocol_types_header.py: (CppProtocolTypesHeaderGenerator._generate_secondary_header_includes): Ditto. * inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py: (CppProtocolTypesImplementationGenerator.generate_output): Generate an include of <optional> instead of <wtf/Optional.h>. * inspector/scripts/tests/expected/*: Regenerate. Source/WebCore: * <many files>: Removed include of <wtf/Optional.h>. * platform/graphics/Font.h: Tweaked style a bit. * Modules/geolocation/GeolocationClient.h: Added include of <optional>. * Modules/mediastream/DoubleRange.h: Ditto. * Modules/mediastream/LongRange.h: Ditto. * Modules/webauthn/AuthenticationExtensionsClientOutputs.h: Ditto. * css/CSSToLengthConversionData.h: Ditto. * css/DOMMatrix2DInit.h: Ditto. * dom/AddEventListenerOptions.h: Ditto. * dom/DeviceMotionData.h: Ditto. * dom/DeviceOrientationData.h: Ditto. * dom/SuccessOr.h: Ditto. * html/DateTimeFieldsState.h: Ditto. * html/ImageBitmapOptions.h: Ditto. * html/canvas/PredefinedColorSpace.h: Ditto. * layout/LayoutPhase.h: Ditto. * layout/MarginTypes.h: Ditto. * loader/ResourceLoadNotifier.h: Ditto. * page/RuntimeEnabledFeatures.h: Ditto. * page/ScrollOptions.h: Ditto. * platform/MediaCapabilitiesInfo.h: Ditto. * platform/cocoa/SystemBattery.h: Ditto. * platform/graphics/DecodingOptions.h: Ditto. * platform/graphics/DestinationColorSpace.h: Ditto. * platform/graphics/DisplayRefreshMonitorClient.h: Ditto. * platform/graphics/FloatLine.h: Ditto. * platform/graphics/gpu/GPURequestAdapterOptions.h: Ditto. * platform/graphics/x11/PlatformDisplayX11.h: Ditto. * platform/ios/SelectionGeometry.h: Ditto. * platform/mac/NSScrollerImpDetails.h: Ditto. * platform/network/DNS.h: Ditto. * platform/text/EncodingTables.h: Ditto. * platform/text/TextCodecCJK.h: Ditto. * platform/text/TextCodecUTF16.h: Ditto. * platform/text/TextFlags.h: Ditto. Source/WebCore/PAL: * pal/SessionID.h: Include <optional>. * pal/crypto/gcrypt/Utilities.h: Ditto. * pal/crypto/tasn1/Utilities.cpp: Removed include of <wtf/Optional.h>. Source/WebDriver: * SessionHost.h: Removed include of <wtf/Optional.h>. Source/WebKit: * <many files>: Removed include of <wtf/Optional.h>. Source/WebKitLegacy/mac: * DOM/DOMRangeInternal.h: Added import of <optional>. * WebView/WebGeolocationPosition.mm: Removed import of <wtf/Optional.h>. * WebView/WebGeolocationPositionInternal.h: Added import of <optional>. Source/WTF: * <many files>: Removed include of <wtf/Optional.h>. * WTF.xcodeproj/project.pbxproj: Removed Optional.h. * wtf/Markable.h: Added include of <optional>. * wtf/OptionSet.h: Ditto. * wtf/Optional.h: Emptied this file. On the Windows build system, we can't seem to build successfully without an empty file here. The copied forwarding header seems to linger even if we remove the original. Until we fix the Windows build system, if we want to support incremental builds, we need to keep this empty file around. * wtf/PrintStream.h: Added include of <optional>. * wtf/Seconds.h: Ditto. * wtf/StackTrace.h: Ditto. * wtf/StdLibExtras.h: Moved the valueOrCompute function here from Optional.h. Re-sorted the "using" at the bottom of the file. * wtf/URLHelpers.h: Added include of <optional>. * wtf/Vector.h: Ditto. Tools: * <many files>: Removed include of <wtf/Optional.h>. Canonical link: https://commits.webkit.org/238372@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278340 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-02 06:45:51 +00:00
#include <optional>
#include <unicode/utypes.h>
Add Optional to Forward.h. https://bugs.webkit.org/show_bug.cgi?id=195586 Reviewed by Darin Adler. Source/JavaScriptCore: * b3/B3Common.cpp: * b3/B3Common.h: * debugger/DebuggerParseData.cpp: * debugger/DebuggerParseData.h: * heap/HeapSnapshot.cpp: * heap/HeapSnapshot.h: * jit/PCToCodeOriginMap.cpp: * jit/PCToCodeOriginMap.h: * runtime/AbstractModuleRecord.cpp: * runtime/AbstractModuleRecord.h: * wasm/WasmInstance.h: * wasm/WasmModuleParser.h: * wasm/WasmSectionParser.cpp: * wasm/WasmSectionParser.h: * wasm/WasmStreamingParser.cpp: * wasm/WasmStreamingParser.h: * yarr/YarrFlags.cpp: * yarr/YarrFlags.h: * yarr/YarrUnicodeProperties.cpp: * yarr/YarrUnicodeProperties.h: Remove unnecessary includes from headers. Source/WebCore: * Modules/encryptedmedia/MediaKeyStatusMap.cpp: * Modules/encryptedmedia/MediaKeyStatusMap.h: * Modules/webauthn/apdu/ApduCommand.cpp: * Modules/webauthn/apdu/ApduCommand.h: * Modules/webauthn/apdu/ApduResponse.cpp: * Modules/webauthn/apdu/ApduResponse.h: * Modules/webauthn/fido/FidoHidMessage.cpp: * Modules/webauthn/fido/FidoHidMessage.h: * Modules/webauthn/fido/U2fCommandConstructor.cpp: * Modules/webauthn/fido/U2fCommandConstructor.h: * Modules/webdatabase/SQLTransaction.cpp: * Modules/webdatabase/SQLTransaction.h: * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp: * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h: * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h: * Modules/webgpu/WHLSL/WHLSLPrepare.cpp: * Modules/webgpu/WHLSL/WHLSLPrepare.h: * Modules/webgpu/WebGPU.cpp: * Modules/webgpu/WebGPU.h: * Modules/webgpu/WebGPUCommandBuffer.cpp: * Modules/webgpu/WebGPUCommandBuffer.h: * animation/WebAnimation.cpp: * animation/WebAnimation.h: * crypto/gcrypt/GCryptUtilities.cpp: * crypto/gcrypt/GCryptUtilities.h: * css/CSSStyleDeclaration.cpp: * css/CSSStyleDeclaration.h: * dom/TextDecoder.cpp: * dom/TextDecoder.h: * dom/UserGestureIndicator.cpp: * dom/UserGestureIndicator.h: * editing/ChangeListTypeCommand.cpp: * editing/ChangeListTypeCommand.h: * editing/EditingStyle.cpp: * editing/EditingStyle.h: * html/DOMFormData.cpp: * html/DOMFormData.h: * html/HTMLAllCollection.cpp: * html/HTMLAllCollection.h: * html/HTMLAnchorElement.cpp: * html/HTMLAnchorElement.h: * html/ImageBitmap.cpp: * html/ImageBitmap.h: * html/canvas/Path2D.h: * html/canvas/WebMetalEnums.cpp: * html/canvas/WebMetalEnums.h: * html/parser/HTMLParserIdioms.cpp: * html/parser/HTMLParserIdioms.h: * loader/ResourceCryptographicDigest.cpp: * loader/ResourceCryptographicDigest.h: * mathml/MathMLOperatorDictionary.cpp: * mathml/MathMLOperatorDictionary.h: * page/PerformanceEntry.cpp: * page/PerformanceEntry.h: * page/ResourceUsageData.h: * platform/ReferrerPolicy.cpp: * platform/ReferrerPolicy.h: * platform/Theme.cpp: * platform/Theme.h: * platform/encryptedmedia/CDMInstance.h: * platform/graphics/gpu/GPUDevice.cpp: * platform/graphics/gpu/GPUDevice.h: * platform/graphics/transforms/AffineTransform.cpp: * platform/graphics/transforms/AffineTransform.h: * platform/graphics/transforms/TransformState.cpp: * platform/graphics/transforms/TransformState.h: * platform/graphics/transforms/TransformationMatrix.cpp: * platform/graphics/transforms/TransformationMatrix.h: * platform/graphics/win/ImageDecoderDirect2D.cpp: * platform/graphics/win/ImageDecoderDirect2D.h: * platform/mediacapabilities/AudioConfiguration.h: * platform/network/CacheValidation.cpp: * platform/network/CacheValidation.h: * platform/network/DataURLDecoder.cpp: * platform/network/DataURLDecoder.h: * platform/network/HTTPParsers.cpp: * platform/network/HTTPParsers.h: * platform/network/curl/CookieJarDB.cpp: * platform/network/curl/CookieJarDB.h: * platform/win/SearchPopupMenuDB.cpp: * platform/win/SearchPopupMenuDB.h: * rendering/ImageQualityController.cpp: * rendering/ImageQualityController.h: * svg/SVGToOTFFontConversion.cpp: * svg/SVGToOTFFontConversion.h: Remove unnecessary includes from headers. Source/WebCore/PAL: * pal/crypto/tasn1/Utilities.cpp: * pal/crypto/tasn1/Utilities.h: Remove unnecessary includes from headers. Source/WebKit: * Shared/RTCNetwork.cpp: * Shared/RTCNetwork.h: * Shared/RTCPacketOptions.cpp: * Shared/RTCPacketOptions.h: * UIProcess/API/APIWebsitePolicies.h: * UIProcess/WebStorage/LocalStorageDatabaseTracker.h: Remove unnecessary includes from headers. Source/WTF: * wtf/Forward.h: Add forward declaration for Optional. * wtf/CPUTime.h: * wtf/Expected.h: * wtf/MainThread.h: * wtf/MemoryFootprint.h: * wtf/URLHelpers.cpp: * wtf/URLHelpers.h: * wtf/cocoa/CPUTimeCocoa.cpp: * wtf/fuchsia/CPUTimeFuchsia.cpp: * wtf/unix/CPUTimeUnix.cpp: * wtf/win/CPUTimeWin.cpp: Remove unnecessary includes from headers. Tools: * TestWebKitAPI/Tests/WebCore/ApduTest.cpp: * TestWebKitAPI/Tests/WebCore/FidoHidMessageTest.cpp: Remove unnecessary includes from headers. Canonical link: https://commits.webkit.org/209906@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242776 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-03-12 05:27:44 +00:00
#include <wtf/Forward.h>
namespace WebCore {
namespace MathMLOperatorDictionary {
enum Form { Infix, Prefix, Postfix };
enum Flag {
Accent = 0x1,
Fence = 0x2, // This has no visual effect but allows to expose semantic information via the accessibility tree.
LargeOp = 0x4,
Add support for movablelimits. https://bugs.webkit.org/show_bug.cgi?id=155542 Patch by Frederic Wang <fwang@igalia.com> on 2016-07-08 Reviewed by Brent Fulgham. Source/WebCore: Tests: mathml/presentation/displaystyle-1.html mathml/presentation/displaystyle-2.html mathml/presentation/displaystyle-3.html mathml/presentation/mo-movablelimits-default.html mathml/presentation/mo-movablelimits-dynamic.html mathml/presentation/mo-movablelimits.html * mathml/MathMLTextElement.cpp: (WebCore::MathMLTextElement::parseAttribute): Take into account change of movablelimits. * rendering/mathml/MathMLOperatorDictionary.h: Remove FIXME comment. * rendering/mathml/MathMLStyle.cpp: (WebCore::MathMLStyle::updateStyleIfNeeded): Force relayout and width computation when a displaystyle value change. * rendering/mathml/RenderMathMLOperator.h: (WebCore::RenderMathMLOperator::shouldMoveLimits): Helper function to test if the operator should have his limits moved when used as a base of munder/mover/munderover. * rendering/mathml/RenderMathMLScripts.cpp: Allow munderover/munder/mover elements to use this class and take the same behavior as the corresponding msubsup/msub/sup except for the *scriptshift attributes. (WebCore::RenderMathMLScripts::RenderMathMLScripts): (WebCore::RenderMathMLScripts::getBaseAndScripts): (WebCore::RenderMathMLScripts::computePreferredLogicalWidths): (WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded): (WebCore::RenderMathMLScripts::layoutBlock): * rendering/mathml/RenderMathMLScripts.h: Allow some members to be accessible/overridden by RenderMathMLUnderOver and add munderover/munder/mover in the kind. * rendering/mathml/RenderMathMLUnderOver.cpp: (WebCore::RenderMathMLUnderOver::RenderMathMLUnderOver): We use the code from RenderMathMLScripts to initialize m_kind. (WebCore::RenderMathMLUnderOver::shouldMoveLimits): New function to determine if the base should move its limits. (WebCore::RenderMathMLUnderOver::computePreferredLogicalWidths): We use the code from RenderMathMLScripts when the base should move its limits. (WebCore::RenderMathMLUnderOver::layoutBlock): We use the code from RenderMathMLScripts when the base should move its limits. Also improve the early return for invalid markup. (WebCore::RenderMathMLUnderOver::unembellishedOperator): Deleted. We use the code from RenderMathMLScripts. (WebCore::RenderMathMLUnderOver::firstLineBaseline): Deleted. We use the code from RenderMathMLScripts. * rendering/mathml/RenderMathMLUnderOver.h: We now inherit from RenderMathMLScripts and can just remove members that exist in the parent. We define shouldMoveLimits() to determine when the layout should be done the same as RenderMathMLScripts. For now, we try and be safe with the rest of the code by continuing to claim that we are not a RenderMathMLScripts. LayoutTests: We import some reftests from Mozilla and write more tests in order to verify the effect of movablelimits. We also adjust one existing test due to change in how munderover handles invalid markup. * mathml/presentation/displaystyle-1.html: Added. Imported from Mozilla. This verifies the inheritance of displaystyle via its effect on movablelimits. * mathml/presentation/displaystyle-1-expected.html: Added. * mathml/presentation/displaystyle-2.html: Added. Imported from Mozilla. Test the effect of displaystyle on munder, mover and munderover with a movablelimits base. * mathml/presentation/displaystyle-2-expected.html: Added. * mathml/presentation/displaystyle-3.html: Added. Imported from Mozilla. Test dynamic change of displaystyle via its effect on movablelimits. * mathml/presentation/displaystyle-3-expected.html: Added. * mathml/presentation/mo-movablelimits-default.html: Added. Test that the default movablelimits value from the operator dictionary is correctly read. * mathml/presentation/mo-movablelimits-default-expected.html: Added. * mathml/presentation/mo-movablelimits-dynamic.html: Added. Imported from Mozilla. Test dynamic change of movablelimits. * mathml/presentation/mo-movablelimits-dynamic-expected.html: Added. * mathml/presentation/mo-movablelimits.html: Added. Basic test to check the effect of movablelimits on munder. * mathml/presentation/mo-movablelimits-expected.html: Added. * mathml/presentation/underover-scriptshifts.html: Added. This verifies that script shifts do not have any effect on munderover/mover/munder elements when their limits are rendered as postscripts. * mathml/presentation/underover-scriptshifts-expected.html: Added. Canonical link: https://commits.webkit.org/177691@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202970 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-07-08 07:15:24 +00:00
MovableLimits = 0x8,
Separator = 0x10, // This has no visual effect but allows to expose semantic information via the accessibility tree.
Stretchy = 0x20,
Symmetric = 0x40
};
Move parsing of boolean operator properties into MathMLOperatorElement https://bugs.webkit.org/show_bug.cgi?id=160190 Patch by Frederic Wang <fwang@igalia.com> on 2016-08-02 Reviewed by Darin Adler. No new tests, already covered by existing tests. * mathml/MathMLOperatorDictionary.h: Add a bit mask with all the property flags set. * mathml/MathMLOperatorElement.cpp: (WebCore::attributeNameToPropertyFlag): helper function to map from attribute name to flag. (WebCore::MathMLOperatorElement::computeOperatorFlag): Helper function to update one bit of m_properties.flags from the corresponding boolean attribute. The default value is taken from the operator dictionary data stored in m_dictionaryProperty.flags. (WebCore::MathMLOperatorElement::hasProperty): Returns whether the operator has a property, parsing it again if the corresponding attribute is dirty. (WebCore::MathMLOperatorElement::childrenChanged): Make all properties dirty. (WebCore::propertyFlagToAttributeName): helper function to map from flag to attribute name. (WebCore::MathMLOperatorElement::parseAttribute): Make all properties dirty if the form attribute changed. Make each property dirty when the corresponding attribute changed. (WebCore::MathMLOperatorElement::flags): Deleted. Replaced with the finer hasProperty function. * mathml/MathMLOperatorElement.h: Define new structure, member and functions to handle operator properties. * rendering/mathml/RenderMathMLFencedOperator.cpp: (WebCore::RenderMathMLFencedOperator::RenderMathMLFencedOperator): Move m_operatorFlags from the base class to the derived class. * rendering/mathml/RenderMathMLFencedOperator.h: Ditto. * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::RenderMathMLOperator): Ditto. (WebCore::RenderMathMLOperator::hasOperatorFlag): Just call hasOperatorFlag from the MathMLOperatorElement class. (WebCore::RenderMathMLOperator::setOperatorProperties): We do not initialize m_operatorFlags since it has been removed from the base class. We also do not parse attributes since this has been moved to the MathMLOperatorElement class. (WebCore::RenderMathMLOperator::setOperatorFlagFromAttribute): Deleted. (WebCore::RenderMathMLOperator::setOperatorFlagFromAttributeValue): Deleted. * rendering/mathml/RenderMathMLOperator.h: Move m_operatorFlags from the base class to the derived class, remove some parsing helper functions and update hasOperatorFlag to make it overridable. Canonical link: https://commits.webkit.org/178596@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-02 18:47:14 +00:00
const unsigned allFlags = Accent | Fence | LargeOp | MovableLimits | Separator | Stretchy | Symmetric;
Add support for non-BMP operators U+1EEF0 and U+1EEF1 https://bugs.webkit.org/show_bug.cgi?id=153984 Source/WebCore: Patch by Frederic Wang <fwang@igalia.com> on 2016-08-25 Reviewed by Darin Adler. Tests: mathml/presentation/non-bmp-operators-spacing.html mathml/presentation/non-bmp-operators-stretching.html * mathml/MathMLOperatorDictionary.cpp: We move the definition of operator dictionary Entry here as it is not used by external code. We now also accept non-BMP operators and add entries for U+1EEF0 and U+1EEF1. (WebCore::extractProperty): Helper function to convert from Entry structure to a Property structure. (WebCore::MathMLOperatorDictionary::search): This function now accepts a non-BMP parameter and returns a Property structure. (WebCore::MathMLOperatorDictionary::isVertical): This function now accepts a non-BMP parameter. * mathml/MathMLOperatorDictionary.h: Replace the Entry structure with a Property structure which was used by MathMLOperatorElement. Update the signatures of search and isVertical. * mathml/MathMLOperatorElement.cpp: (WebCore::MathMLOperatorElement::parseOperatorChar): Remove the special case that excludes non-BMP operators. (WebCore::MathMLOperatorElement::computeDictionaryProperty): Rename the property structure to use the one moved into MathMLOperatorDictionary.h. We no longer need to convert the result of the search call. (WebCore::MathMLOperatorElement::dictionaryProperty): Rename the property structure. * mathml/MathMLOperatorElement.h: Make OperatorChar accept non-BMP operators. MathMLOperatorElement::DictionaryProperty is now moved into MathMLOperatorDictionary and renamed Property. * rendering/mathml/MathOperator.cpp: Accept non-BMP operators. * rendering/mathml/MathOperator.h: Ditto. * rendering/mathml/RenderMathMLFencedOperator.cpp: (WebCore::RenderMathMLFencedOperator::updateOperatorContent): Adjust code to use the new return type of MathMLOperatorDictionary::search. * rendering/mathml/RenderMathMLFencedOperator.h: Accept non-BMP operators. * rendering/mathml/RenderMathMLOperator.cpp: Ditto. * rendering/mathml/RenderMathMLOperator.h: Ditto. LayoutTests: We add two reftests to check that the non-BMP operators are properly handled by the MathML dictionary (form, properties, direction) as well as the rendering code (spacing, stretching). We test the new horizontal strechy operators U+1EEF0 and U+1EEF1 as well as the letter U+1D400 which is not a real mathematical operator. We add a minimal test font which contains a black square for U+005F, U+1EEF0, U+1EEF1, U+1D400 and the data that can be used to stretch them horizontally. Patch by Frederic Wang <fwang@igalia.com> on 2016-08-25 Reviewed by Darin Adler. * mathml/presentation/non-bmp-operators-spacing-expected.html: Added. * mathml/presentation/non-bmp-operators-spacing.html: Added. * mathml/presentation/non-bmp-operators-stretching-expected.html: Added. * mathml/presentation/non-bmp-operators-stretching.html: Added. * mathml/presentation/non-bmp-operators.woff: Added. Canonical link: https://commits.webkit.org/179485@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@205111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-29 06:55:59 +00:00
struct Property {
MathMLOperatorDictionary::Form form;
// Default leading and trailing spaces are "thickmathspace".
unsigned short leadingSpaceInMathUnit { 5 };
unsigned short trailingSpaceInMathUnit { 5 };
// Default operator properties are all set to "false".
unsigned short flags { 0 };
};
Remove WTF::Optional synonym for std::optional, using that class template directly instead https://bugs.webkit.org/show_bug.cgi?id=226433 Reviewed by Chris Dumez. Source/JavaScriptCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * inspector/scripts/codegen/generate_objc_protocol_types_implementation.py: (ObjCProtocolTypesImplementationGenerator._generate_init_method_for_payload): Use auto instead of Optional<>. Also use * instead of value() and nest the definition of the local inside an if statement in the case where it's an optional. * inspector/scripts/tests/expected/*: Regenerated these results. Source/WebCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebCore/PAL: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebDriver: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKit: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * Scripts/webkit/tests: Regenerated expected results, by running the command "python Scripts/webkit/messages_unittest.py -r". (How am I supposed to know to do that?) Source/WebKitLegacy/ios: * WebCoreSupport/WebChromeClientIOS.h: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/mac: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/win: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WTF: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * wtf/Optional.h: Remove WTF::Optional. Tools: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Canonical link: https://commits.webkit.org/238290@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-30 16:11:40 +00:00
std::optional<Property> search(UChar32, Form, bool explicitForm);
Add support for non-BMP operators U+1EEF0 and U+1EEF1 https://bugs.webkit.org/show_bug.cgi?id=153984 Source/WebCore: Patch by Frederic Wang <fwang@igalia.com> on 2016-08-25 Reviewed by Darin Adler. Tests: mathml/presentation/non-bmp-operators-spacing.html mathml/presentation/non-bmp-operators-stretching.html * mathml/MathMLOperatorDictionary.cpp: We move the definition of operator dictionary Entry here as it is not used by external code. We now also accept non-BMP operators and add entries for U+1EEF0 and U+1EEF1. (WebCore::extractProperty): Helper function to convert from Entry structure to a Property structure. (WebCore::MathMLOperatorDictionary::search): This function now accepts a non-BMP parameter and returns a Property structure. (WebCore::MathMLOperatorDictionary::isVertical): This function now accepts a non-BMP parameter. * mathml/MathMLOperatorDictionary.h: Replace the Entry structure with a Property structure which was used by MathMLOperatorElement. Update the signatures of search and isVertical. * mathml/MathMLOperatorElement.cpp: (WebCore::MathMLOperatorElement::parseOperatorChar): Remove the special case that excludes non-BMP operators. (WebCore::MathMLOperatorElement::computeDictionaryProperty): Rename the property structure to use the one moved into MathMLOperatorDictionary.h. We no longer need to convert the result of the search call. (WebCore::MathMLOperatorElement::dictionaryProperty): Rename the property structure. * mathml/MathMLOperatorElement.h: Make OperatorChar accept non-BMP operators. MathMLOperatorElement::DictionaryProperty is now moved into MathMLOperatorDictionary and renamed Property. * rendering/mathml/MathOperator.cpp: Accept non-BMP operators. * rendering/mathml/MathOperator.h: Ditto. * rendering/mathml/RenderMathMLFencedOperator.cpp: (WebCore::RenderMathMLFencedOperator::updateOperatorContent): Adjust code to use the new return type of MathMLOperatorDictionary::search. * rendering/mathml/RenderMathMLFencedOperator.h: Accept non-BMP operators. * rendering/mathml/RenderMathMLOperator.cpp: Ditto. * rendering/mathml/RenderMathMLOperator.h: Ditto. LayoutTests: We add two reftests to check that the non-BMP operators are properly handled by the MathML dictionary (form, properties, direction) as well as the rendering code (spacing, stretching). We test the new horizontal strechy operators U+1EEF0 and U+1EEF1 as well as the letter U+1D400 which is not a real mathematical operator. We add a minimal test font which contains a black square for U+005F, U+1EEF0, U+1EEF1, U+1D400 and the data that can be used to stretch them horizontally. Patch by Frederic Wang <fwang@igalia.com> on 2016-08-25 Reviewed by Darin Adler. * mathml/presentation/non-bmp-operators-spacing-expected.html: Added. * mathml/presentation/non-bmp-operators-spacing.html: Added. * mathml/presentation/non-bmp-operators-stretching-expected.html: Added. * mathml/presentation/non-bmp-operators-stretching.html: Added. * mathml/presentation/non-bmp-operators.woff: Added. Canonical link: https://commits.webkit.org/179485@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@205111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-29 06:55:59 +00:00
bool isVertical(UChar32);
}
}
#endif // ENABLE(MATHML)