haikuwebkit/Source/WebCore/rendering/mathml/RenderMathMLPadded.h

61 lines
2.4 KiB
C
Raw Permalink Normal View History

Bug 155792 - Basic implementation of mpadded https://bugs.webkit.org/show_bug.cgi?id=155792 Patch by Frederic Wang <fwang@igalia.com> on 2016-07-07 Reviewed by Brent Fulgham. Source/WebCore: We implement a basic support for the mpadded element. We support most of the attribute values except pseudo-units or negative values. Tests: mathml/presentation/mpadded-1-2.html mathml/presentation/mpadded-1.html mathml/presentation/mpadded-2.html mathml/presentation/mpadded-3.html mathml/presentation/mpadded-unsupported-values.html mathml/presentation/mpadded-dynamic.html * CMakeLists.txt: Add RenderMathMLPadded to the build system. * WebCore.xcodeproj/project.pbxproj: Ditto. * mathml/MathMLInlineContainerElement.cpp: (WebCore::MathMLInlineContainerElement::createElementRenderer): Create the renderer for mpadded. * mathml/mathattrs.in: Add voffset attribute. * mathml/mathtags.in: Make mpadded use MathMLInlineContainerElement. * rendering/RenderObject.h: (WebCore::RenderObject::isRenderMathMLPadded): Define isRenderMathMLPadded. * rendering/mathml/RenderMathMLPadded.cpp: Added. We do a simple implementation by overriding the behavior of RenderMathMLRow and forcing relayout after attribute or style change. (WebCore::RenderMathMLPadded::RenderMathMLPadded): (WebCore::RenderMathMLPadded::computePreferredLogicalWidths): (WebCore::RenderMathMLPadded::layoutBlock): (WebCore::RenderMathMLPadded::updateFromElement): (WebCore::RenderMathMLPadded::styleDidChange): (WebCore::RenderMathMLPadded::firstLineBaseline): * rendering/mathml/RenderMathMLPadded.h: Added. LayoutTests: We import mpadded tests from Mozilla test suite. We also add some tests for dynamic changes of mpadded attributes and to verify that the mpadded element behaves as if it had an inferred <mrow>. Finally, we check that fallback properly for negative and pseudo-unit values that we do not support yet. * mathml/presentation/inferred-mrow-baseline.html: Check baseline for mpadded. * mathml/presentation/inferred-mrow-baseline-expected.txt: Ditto. * mathml/presentation/inferred-mrow-stretchy.html: Check stretching of operators for mpadded. * mathml/presentation/inferred-mrow-stretchy-expected.txt: Ditto. * mathml/presentation/mpadded-dynamic.html: Added. Verify dynamic change of mpadded attributes. * mathml/presentation/mpadded-dynamic-expected.html: Added. Ditto. * mathml/presentation/mpadded-unsupported-values.html: Added. Check negative and pseudo-unit values. * mathml/presentation/mpadded-unsupported-values-expected.html: Added. * mathml/presentation/mpadded-1-2-expected.html: Added. * mathml/presentation/mpadded-1-2.html: Added. * mathml/presentation/mpadded-1-expected.html: Added. * mathml/presentation/mpadded-1.html: Added. * mathml/presentation/mpadded-2-expected.html: Added. * mathml/presentation/mpadded-2.html: Added. * mathml/presentation/mpadded-3-expected.html: Added. * mathml/presentation/mpadded-3.html: Added. Canonical link: https://commits.webkit.org/177686@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202962 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-07-08 06:16:32 +00:00
/*
* Copyright (C) 2016 Igalia S.L. 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.
*/
#pragma once
#if ENABLE(MATHML)
Move parsing of mpadded attributes to a MathMLPaddedElement class https://bugs.webkit.org/show_bug.cgi?id=159620 Patch by Frederic Wang <fwang@igalia.com> on 2016-07-12 Reviewed by Brent Fulgham. No new tests, behavior is unchanged. * CMakeLists.txt: Add MathMLPaddedElement files. * WebCore.xcodeproj/project.pbxproj: Ditto. * mathml/MathMLAllInOne.cpp: Ditto. * mathml/MathMLInlineContainerElement.cpp: Remove handling of mpadded. * mathml/MathMLPaddedElement.cpp: Added. (WebCore::MathMLPaddedElement::MathMLPaddedElement): (WebCore::MathMLPaddedElement::create): (WebCore::MathMLPaddedElement::width): Expose width attribute as a MathMLLength until mpadded pseudo-units are supported. (WebCore::MathMLPaddedElement::height): Ditto. (WebCore::MathMLPaddedElement::depth): Ditto (WebCore::MathMLPaddedElement::lspace): Ditto. (WebCore::MathMLPaddedElement::voffset): Ditto. (WebCore::MathMLPaddedElement::parseAttribute): Make length attribute dirty. (WebCore::MathMLPaddedElement::createElementRenderer): Moved code from MathMLInlineContainerElement. * mathml/MathMLPaddedElement.h: Added. * mathml/mathtags.in: Map mapdded to MathMLPaddedElement. * rendering/mathml/RenderMathMLPadded.cpp: (WebCore::RenderMathMLPadded::resolveWidth): Helper function to resolve width. (WebCore::RenderMathMLPadded::resolveAttributes): Helper function to resolve all attributes. (WebCore::RenderMathMLPadded::computePreferredLogicalWidths): Use resolveWidth. (WebCore::RenderMathMLPadded::layoutBlock): Use resolveAttributes. * rendering/mathml/RenderMathMLPadded.h: Add new helper functions to access attributes from the MathMLPaddedElement class. Canonical link: https://commits.webkit.org/177850@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-07-13 04:47:00 +00:00
#include "MathMLPaddedElement.h"
Bug 155792 - Basic implementation of mpadded https://bugs.webkit.org/show_bug.cgi?id=155792 Patch by Frederic Wang <fwang@igalia.com> on 2016-07-07 Reviewed by Brent Fulgham. Source/WebCore: We implement a basic support for the mpadded element. We support most of the attribute values except pseudo-units or negative values. Tests: mathml/presentation/mpadded-1-2.html mathml/presentation/mpadded-1.html mathml/presentation/mpadded-2.html mathml/presentation/mpadded-3.html mathml/presentation/mpadded-unsupported-values.html mathml/presentation/mpadded-dynamic.html * CMakeLists.txt: Add RenderMathMLPadded to the build system. * WebCore.xcodeproj/project.pbxproj: Ditto. * mathml/MathMLInlineContainerElement.cpp: (WebCore::MathMLInlineContainerElement::createElementRenderer): Create the renderer for mpadded. * mathml/mathattrs.in: Add voffset attribute. * mathml/mathtags.in: Make mpadded use MathMLInlineContainerElement. * rendering/RenderObject.h: (WebCore::RenderObject::isRenderMathMLPadded): Define isRenderMathMLPadded. * rendering/mathml/RenderMathMLPadded.cpp: Added. We do a simple implementation by overriding the behavior of RenderMathMLRow and forcing relayout after attribute or style change. (WebCore::RenderMathMLPadded::RenderMathMLPadded): (WebCore::RenderMathMLPadded::computePreferredLogicalWidths): (WebCore::RenderMathMLPadded::layoutBlock): (WebCore::RenderMathMLPadded::updateFromElement): (WebCore::RenderMathMLPadded::styleDidChange): (WebCore::RenderMathMLPadded::firstLineBaseline): * rendering/mathml/RenderMathMLPadded.h: Added. LayoutTests: We import mpadded tests from Mozilla test suite. We also add some tests for dynamic changes of mpadded attributes and to verify that the mpadded element behaves as if it had an inferred <mrow>. Finally, we check that fallback properly for negative and pseudo-unit values that we do not support yet. * mathml/presentation/inferred-mrow-baseline.html: Check baseline for mpadded. * mathml/presentation/inferred-mrow-baseline-expected.txt: Ditto. * mathml/presentation/inferred-mrow-stretchy.html: Check stretching of operators for mpadded. * mathml/presentation/inferred-mrow-stretchy-expected.txt: Ditto. * mathml/presentation/mpadded-dynamic.html: Added. Verify dynamic change of mpadded attributes. * mathml/presentation/mpadded-dynamic-expected.html: Added. Ditto. * mathml/presentation/mpadded-unsupported-values.html: Added. Check negative and pseudo-unit values. * mathml/presentation/mpadded-unsupported-values-expected.html: Added. * mathml/presentation/mpadded-1-2-expected.html: Added. * mathml/presentation/mpadded-1-2.html: Added. * mathml/presentation/mpadded-1-expected.html: Added. * mathml/presentation/mpadded-1.html: Added. * mathml/presentation/mpadded-2-expected.html: Added. * mathml/presentation/mpadded-2.html: Added. * mathml/presentation/mpadded-3-expected.html: Added. * mathml/presentation/mpadded-3.html: Added. Canonical link: https://commits.webkit.org/177686@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202962 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-07-08 06:16:32 +00:00
#include "RenderMathMLRow.h"
namespace WebCore {
class RenderMathMLPadded final : public RenderMathMLRow {
bmalloc should support strictly type-segregated isolated heaps https://bugs.webkit.org/show_bug.cgi?id=178108 Reviewed by Saam Barati, Simon Fraser, and Ryosuke Niwa. Source/bmalloc: This introduces a new allocation API in bmalloc called IsoHeap. An IsoHeap is templatized by type and created in static storage. When unused, it takes only a few words. When you do use it, each IsoHeap gets a bag of virtual pages unique to it. This prevents use-after-free bugs in one IsoHeap from affecting any other memory. At worst, two pointers of the same type will point to the same object even though they should not have. IsoHeaps allocate using a first-fit discipline that combines ideas from bmalloc and Riptide (the JSC GC): Like Riptide, it uses a bump'n'pop allocator. What Riptide calls blocks, IsoHeaps calls pages. Pages are collected into directories. Directories track pages using bitvectors, so that it's easy to quickly find a completely free page or one that has at least one free object. I think that the bump'n'pop allocator is as fast as the bmalloc Immix-style (page and line) allocator, but is better at allocating in holes. It's guaranteed to follow a first-fit discipline. However, the real reason why I wrote it that was is that this is what I'm more familiar with. This is a part of the design I want to revisit (bug 179278). Like bmalloc, it uses a deallocation log. This means that the internal IsoHeap data structures can be locked with a coarse-grained lock, since the deallocator only grabs it when flushing the log. Similarly, the allocator only grabs it when refilling the bump'n'pop FreeList. This adds a unit test for IsoHeaps. In this change, IsoHeaps are adopted only by WebCore's RenderObject. Note that despite the use of GC concepts, it's not a goal to make this code directly sharable with GC. The GC will probably have to do isolated heaps its own way (likely a special Subspace or something like that). * bmalloc.xcodeproj/project.pbxproj: * bmalloc/Algorithm.h: (bmalloc::findBitInWord): * bmalloc/AllIsoHeaps.cpp: Added. (bmalloc::AllIsoHeaps::AllIsoHeaps): (bmalloc::AllIsoHeaps::add): (bmalloc::AllIsoHeaps::head): * bmalloc/AllIsoHeaps.h: Added. * bmalloc/AllIsoHeapsInlines.h: Added. (bmalloc::AllIsoHeaps::forEach): * bmalloc/BMalloced.h: Added. * bmalloc/Bits.h: Added. (bmalloc::bitsArrayLength): (bmalloc::BitsWordView::BitsWordView): (bmalloc::BitsWordView::numBits const): (bmalloc::BitsWordView::word const): (bmalloc::BitsWordOwner::BitsWordOwner): (bmalloc::BitsWordOwner::view const): (bmalloc::BitsWordOwner::operator=): (bmalloc::BitsWordOwner::setAll): (bmalloc::BitsWordOwner::clearAll): (bmalloc::BitsWordOwner::set): (bmalloc::BitsWordOwner::numBits const): (bmalloc::BitsWordOwner::arrayLength const): (bmalloc::BitsWordOwner::word const): (bmalloc::BitsWordOwner::word): (bmalloc::BitsWordOwner::words const): (bmalloc::BitsWordOwner::words): (bmalloc::BitsAndWords::BitsAndWords): (bmalloc::BitsAndWords::view const): (bmalloc::BitsAndWords::numBits const): (bmalloc::BitsAndWords::word const): (bmalloc::BitsOrWords::BitsOrWords): (bmalloc::BitsOrWords::view const): (bmalloc::BitsOrWords::numBits const): (bmalloc::BitsOrWords::word const): (bmalloc::BitsNotWords::BitsNotWords): (bmalloc::BitsNotWords::view const): (bmalloc::BitsNotWords::numBits const): (bmalloc::BitsNotWords::word const): (bmalloc::BitsImpl::BitsImpl): (bmalloc::BitsImpl::numBits const): (bmalloc::BitsImpl::size const): (bmalloc::BitsImpl::arrayLength const): (bmalloc::BitsImpl::operator== const): (bmalloc::BitsImpl::operator!= const): (bmalloc::BitsImpl::at const): (bmalloc::BitsImpl::operator[] const): (bmalloc::BitsImpl::isEmpty const): (bmalloc::BitsImpl::operator& const): (bmalloc::BitsImpl::operator| const): (bmalloc::BitsImpl::operator~ const): (bmalloc::BitsImpl::forEachSetBit const): (bmalloc::BitsImpl::forEachClearBit const): (bmalloc::BitsImpl::forEachBit const): (bmalloc::BitsImpl::findBit const): (bmalloc::BitsImpl::findSetBit const): (bmalloc::BitsImpl::findClearBit const): (bmalloc::BitsImpl::wordView const): (bmalloc::BitsImpl::atImpl const): (bmalloc::Bits::Bits): (bmalloc::Bits::operator=): (bmalloc::Bits::resize): (bmalloc::Bits::setAll): (bmalloc::Bits::clearAll): (bmalloc::Bits::setAndCheck): (bmalloc::Bits::operator|=): (bmalloc::Bits::operator&=): (bmalloc::Bits::at const): (bmalloc::Bits::operator[] const): (bmalloc::Bits::BitReference::BitReference): (bmalloc::Bits::BitReference::operator bool const): (bmalloc::Bits::BitReference::operator=): (bmalloc::Bits::at): (bmalloc::Bits::operator[]): * bmalloc/CryptoRandom.cpp: Replaced with Source/bmalloc/bmalloc/CryptoRandom.cpp. (bmalloc::cryptoRandom): * bmalloc/CryptoRandom.h: Replaced with Source/bmalloc/bmalloc/CryptoRandom.h. * bmalloc/DeferredDecommit.h: Added. * bmalloc/DeferredDecommitInlines.h: Added. (bmalloc::DeferredDecommit::DeferredDecommit): * bmalloc/DeferredTrigger.h: Added. (bmalloc::DeferredTrigger::DeferredTrigger): * bmalloc/DeferredTriggerInlines.h: Added. (bmalloc::DeferredTrigger<trigger>::didBecome): (bmalloc::DeferredTrigger<trigger>::handleDeferral): * bmalloc/EligibilityResult.h: Added. (bmalloc::EligibilityResult::EligibilityResult): * bmalloc/EligibilityResultInlines.h: Added. (bmalloc::EligibilityResult<Config>::EligibilityResult): * bmalloc/FixedVector.h: * bmalloc/FreeList.cpp: Added. (bmalloc::FreeList::FreeList): (bmalloc::FreeList::~FreeList): (bmalloc::FreeList::clear): (bmalloc::FreeList::initializeList): (bmalloc::FreeList::initializeBump): (bmalloc::FreeList::contains const): * bmalloc/FreeList.h: Added. (bmalloc::FreeCell::scramble): (bmalloc::FreeCell::descramble): (bmalloc::FreeCell::setNext): (bmalloc::FreeCell::next const): (bmalloc::FreeList::allocationWillFail const): (bmalloc::FreeList::allocationWillSucceed const): (bmalloc::FreeList::originalSize const): (bmalloc::FreeList::head const): * bmalloc/FreeListInlines.h: Added. (bmalloc::FreeList::allocate): (bmalloc::FreeList::forEach const): * bmalloc/IsoAllocator.h: Added. * bmalloc/IsoAllocatorInlines.h: Added. (bmalloc::IsoAllocator<Config>::IsoAllocator): (bmalloc::IsoAllocator<Config>::~IsoAllocator): (bmalloc::IsoAllocator<Config>::allocate): (bmalloc::IsoAllocator<Config>::allocateSlow): (bmalloc::IsoAllocator<Config>::scavenge): * bmalloc/IsoConfig.h: Added. * bmalloc/IsoDeallocator.h: Added. * bmalloc/IsoDeallocatorInlines.h: Added. (bmalloc::IsoDeallocator<Config>::IsoDeallocator): (bmalloc::IsoDeallocator<Config>::~IsoDeallocator): (bmalloc::IsoDeallocator<Config>::deallocate): (bmalloc::IsoDeallocator<Config>::scavenge): * bmalloc/IsoDirectory.h: Added. (bmalloc::IsoDirectoryBaseBase::IsoDirectoryBaseBase): (bmalloc::IsoDirectoryBaseBase::~IsoDirectoryBaseBase): (bmalloc::IsoDirectoryBase::heap): * bmalloc/IsoDirectoryInlines.h: Added. (bmalloc::IsoDirectoryBase<Config>::IsoDirectoryBase): (bmalloc::passedNumPages>::IsoDirectory): (bmalloc::passedNumPages>::takeFirstEligible): (bmalloc::passedNumPages>::didBecome): (bmalloc::passedNumPages>::didDecommit): (bmalloc::passedNumPages>::scavenge): (bmalloc::passedNumPages>::forEachCommittedPage): * bmalloc/IsoDirectoryPage.h: Added. (bmalloc::IsoDirectoryPage::index const): * bmalloc/IsoDirectoryPageInlines.h: Added. (bmalloc::IsoDirectoryPage<Config>::IsoDirectoryPage): (bmalloc::IsoDirectoryPage<Config>::pageFor): * bmalloc/IsoHeap.h: Added. (bmalloc::api::IsoHeap::allocatorOffset): (bmalloc::api::IsoHeap::setAllocatorOffset): (bmalloc::api::IsoHeap::deallocatorOffset): (bmalloc::api::IsoHeap::setDeallocatorOffset): * bmalloc/IsoHeapImpl.cpp: Added. (bmalloc::IsoHeapImplBase::IsoHeapImplBase): (bmalloc::IsoHeapImplBase::~IsoHeapImplBase): (bmalloc::IsoHeapImplBase::scavengeNow): (bmalloc::IsoHeapImplBase::finishScavenging): * bmalloc/IsoHeapImpl.h: Added. * bmalloc/IsoHeapImplInlines.h: Added. (bmalloc::IsoHeapImpl<Config>::IsoHeapImpl): (bmalloc::IsoHeapImpl<Config>::takeFirstEligible): (bmalloc::IsoHeapImpl<Config>::didBecomeEligible): (bmalloc::IsoHeapImpl<Config>::scavenge): (bmalloc::IsoHeapImpl<Config>::allocatorOffset): (bmalloc::IsoHeapImpl<Config>::deallocatorOffset): (bmalloc::IsoHeapImpl<Config>::numLiveObjects): (bmalloc::IsoHeapImpl<Config>::numCommittedPages): (bmalloc::IsoHeapImpl<Config>::forEachDirectory): (bmalloc::IsoHeapImpl<Config>::forEachCommittedPage): (bmalloc::IsoHeapImpl<Config>::forEachLiveObject): * bmalloc/IsoHeapInlines.h: Added. (bmalloc::api::IsoHeap<Type>::allocate): (bmalloc::api::IsoHeap<Type>::tryAllocate): (bmalloc::api::IsoHeap<Type>::deallocate): (bmalloc::api::IsoHeap<Type>::scavenge): (bmalloc::api::IsoHeap<Type>::isInitialized): (bmalloc::api::IsoHeap<Type>::impl): * bmalloc/IsoPage.h: Added. (bmalloc::IsoPage::index const): (bmalloc::IsoPage::directory): (bmalloc::IsoPage::isInUseForAllocation const): (bmalloc::IsoPage::indexOfFirstObject): * bmalloc/IsoPageInlines.h: Added. (bmalloc::IsoPage<Config>::tryCreate): (bmalloc::IsoPage<Config>::IsoPage): (bmalloc::IsoPage<Config>::free): (bmalloc::IsoPage<Config>::startAllocating): (bmalloc::IsoPage<Config>::stopAllocating): (bmalloc::IsoPage<Config>::forEachLiveObject): * bmalloc/IsoPageTrigger.h: Added. * bmalloc/IsoTLS.cpp: Added. (bmalloc::IsoTLS::scavenge): (bmalloc::IsoTLS::IsoTLS): (bmalloc::IsoTLS::ensureEntries): (bmalloc::IsoTLS::destructor): (bmalloc::IsoTLS::sizeForCapacity): (bmalloc::IsoTLS::capacityForSize): (bmalloc::IsoTLS::size): (bmalloc::IsoTLS::forEachEntry): * bmalloc/IsoTLS.h: Added. * bmalloc/IsoTLSAllocatorEntry.h: Added. * bmalloc/IsoTLSAllocatorEntryInlines.h: Added. (bmalloc::IsoTLSAllocatorEntry<Config>::IsoTLSAllocatorEntry): (bmalloc::IsoTLSAllocatorEntry<Config>::~IsoTLSAllocatorEntry): (bmalloc::IsoTLSAllocatorEntry<Config>::construct): * bmalloc/IsoTLSDeallocatorEntry.h: Added. * bmalloc/IsoTLSDeallocatorEntryInlines.h: Added. (bmalloc::IsoTLSDeallocatorEntry<Config>::IsoTLSDeallocatorEntry): (bmalloc::IsoTLSDeallocatorEntry<Config>::~IsoTLSDeallocatorEntry): (bmalloc::IsoTLSDeallocatorEntry<Config>::construct): * bmalloc/IsoTLSEntry.cpp: Added. (bmalloc::IsoTLSEntry::IsoTLSEntry): (bmalloc::IsoTLSEntry::~IsoTLSEntry): * bmalloc/IsoTLSEntry.h: Added. (bmalloc::IsoTLSEntry::offset const): (bmalloc::IsoTLSEntry::alignment const): (bmalloc::IsoTLSEntry::size const): (bmalloc::IsoTLSEntry::extent const): * bmalloc/IsoTLSEntryInlines.h: Added. (bmalloc::IsoTLSEntry::walkUpToInclusive): (bmalloc::DefaultIsoTLSEntry<EntryType>::DefaultIsoTLSEntry): (bmalloc::DefaultIsoTLSEntry<EntryType>::~DefaultIsoTLSEntry): (bmalloc::DefaultIsoTLSEntry<EntryType>::move): (bmalloc::DefaultIsoTLSEntry<EntryType>::destruct): (bmalloc::DefaultIsoTLSEntry<EntryType>::scavenge): * bmalloc/IsoTLSInlines.h: Added. (bmalloc::IsoTLS::allocate): (bmalloc::IsoTLS::deallocate): (bmalloc::IsoTLS::scavenge): (bmalloc::IsoTLS::allocator): (bmalloc::IsoTLS::deallocator): (bmalloc::IsoTLS::get): (bmalloc::IsoTLS::set): (bmalloc::IsoTLS::ensureHeap): (bmalloc::IsoTLS::ensureHeapAndEntries): * bmalloc/IsoTLSLayout.cpp: Added. (bmalloc::IsoTLSLayout::IsoTLSLayout): (bmalloc::IsoTLSLayout::add): * bmalloc/IsoTLSLayout.h: Added. (bmalloc::IsoTLSLayout::head const): * bmalloc/PerHeapKind.h: * bmalloc/PerProcess.h: (bmalloc::PerProcess<T>::getFastCase): * bmalloc/Scavenger.cpp: (bmalloc::Scavenger::scavenge): * bmalloc/Scavenger.h: * bmalloc/bmalloc.h: (bmalloc::api::scavengeThisThread): * test: Added. * test/testbmalloc.cpp: Added. (hiddenTruthBecauseNoReturnIsStupid): (usage): (assertEmptyPointerSet): (assertHasObjects): (assertHasOnlyObjects): (assertClean): (testIsoSimple): (testIsoSimpleScavengeBeforeDealloc): (testIsoFlipFlopFragmentedPages): (testIsoFlipFlopFragmentedPagesScavengeInMiddle): (BisoMalloced::BisoMalloced): (testBisoMalloced): (BisoMallocedInline::BisoMallocedInline): (testBisoMallocedInline): (run): (main): Source/WebCore: No new tests because no new change in behavior. Though, the bmalloc change has a unit test. Adopting IsoHeap means dropping in macros in both the .h and .cpp file of each class that we opt in. It's not pretty, but it helps ensure speedy allocation since it means that we never have to do any kind of switch or dynamic lookup to find the right allocator for a type. This change is perf-neutral on MotionMark, PLT3, and membuster. * Sources.txt: * html/shadow/SliderThumbElement.cpp: * html/shadow/SliderThumbElement.h: * html/shadow/mac/ImageControlsButtonElementMac.cpp: * html/shadow/mac/ImageControlsRootElementMac.cpp: * rendering/RenderAttachment.cpp: * rendering/RenderAttachment.h: * rendering/RenderBlock.cpp: * rendering/RenderBlock.h: * rendering/RenderBlockFlow.cpp: * rendering/RenderBlockFlow.h: * rendering/RenderBox.cpp: * rendering/RenderBox.h: * rendering/RenderBoxModelObject.cpp: * rendering/RenderBoxModelObject.h: * rendering/RenderButton.cpp: * rendering/RenderButton.h: * rendering/RenderCombineText.cpp: * rendering/RenderCombineText.h: * rendering/RenderCounter.cpp: * rendering/RenderCounter.h: * rendering/RenderDeprecatedFlexibleBox.cpp: * rendering/RenderDeprecatedFlexibleBox.h: * rendering/RenderDetailsMarker.cpp: * rendering/RenderDetailsMarker.h: * rendering/RenderElement.cpp: * rendering/RenderElement.h: * rendering/RenderEmbeddedObject.cpp: * rendering/RenderEmbeddedObject.h: * rendering/RenderFileUploadControl.cpp: * rendering/RenderFileUploadControl.h: * rendering/RenderFlexibleBox.cpp: * rendering/RenderFlexibleBox.h: * rendering/RenderFragmentContainer.cpp: * rendering/RenderFragmentContainer.h: * rendering/RenderFragmentContainerSet.cpp: * rendering/RenderFragmentContainerSet.h: * rendering/RenderFragmentedFlow.cpp: * rendering/RenderFragmentedFlow.h: * rendering/RenderFrameBase.cpp: * rendering/RenderFrameBase.h: * rendering/RenderFrameSet.cpp: * rendering/RenderFrameSet.h: * rendering/RenderFullScreen.cpp: * rendering/RenderFullScreen.h: * rendering/RenderGrid.cpp: * rendering/RenderGrid.h: * rendering/RenderHTMLCanvas.cpp: * rendering/RenderHTMLCanvas.h: * rendering/RenderImage.cpp: * rendering/RenderImage.h: * rendering/RenderImageResourceStyleImage.cpp: * rendering/RenderImageResourceStyleImage.h: * rendering/RenderInline.cpp: * rendering/RenderInline.h: * rendering/RenderLayerModelObject.cpp: * rendering/RenderLayerModelObject.h: * rendering/RenderLineBreak.cpp: * rendering/RenderLineBreak.h: * rendering/RenderListBox.cpp: * rendering/RenderListBox.h: * rendering/RenderListItem.cpp: * rendering/RenderListItem.h: * rendering/RenderListMarker.cpp: * rendering/RenderListMarker.h: * rendering/RenderMedia.cpp: * rendering/RenderMedia.h: * rendering/RenderMediaControlElements.cpp: * rendering/RenderMediaControlElements.h: * rendering/RenderMenuList.cpp: * rendering/RenderMenuList.h: * rendering/RenderMeter.cpp: * rendering/RenderMeter.h: * rendering/RenderMultiColumnFlow.cpp: * rendering/RenderMultiColumnFlow.h: * rendering/RenderMultiColumnSet.cpp: * rendering/RenderMultiColumnSet.h: * rendering/RenderMultiColumnSpannerPlaceholder.cpp: * rendering/RenderMultiColumnSpannerPlaceholder.h: * rendering/RenderObject.cpp: * rendering/RenderObject.h: * rendering/RenderProgress.cpp: * rendering/RenderProgress.h: * rendering/RenderQuote.cpp: * rendering/RenderQuote.h: * rendering/RenderReplaced.cpp: * rendering/RenderReplaced.h: * rendering/RenderReplica.cpp: * rendering/RenderReplica.h: * rendering/RenderRuby.cpp: * rendering/RenderRuby.h: * rendering/RenderRubyBase.cpp: * rendering/RenderRubyBase.h: * rendering/RenderRubyRun.cpp: * rendering/RenderRubyRun.h: * rendering/RenderRubyText.cpp: * rendering/RenderRubyText.h: * rendering/RenderScrollbarPart.cpp: * rendering/RenderScrollbarPart.h: * rendering/RenderSearchField.cpp: * rendering/RenderSearchField.h: * rendering/RenderSlider.cpp: * rendering/RenderSlider.h: * rendering/RenderTable.cpp: * rendering/RenderTable.h: * rendering/RenderTableCaption.cpp: * rendering/RenderTableCaption.h: * rendering/RenderTableCell.cpp: * rendering/RenderTableCell.h: * rendering/RenderTableCol.cpp: * rendering/RenderTableCol.h: * rendering/RenderTableRow.cpp: * rendering/RenderTableRow.h: * rendering/RenderTableSection.cpp: * rendering/RenderTableSection.h: * rendering/RenderText.cpp: * rendering/RenderText.h: * rendering/RenderTextControl.cpp: * rendering/RenderTextControl.h: * rendering/RenderTextControlMultiLine.cpp: * rendering/RenderTextControlMultiLine.h: * rendering/RenderTextControlSingleLine.cpp: * rendering/RenderTextControlSingleLine.h: * rendering/RenderTextFragment.cpp: * rendering/RenderTextFragment.h: * rendering/RenderVTTCue.cpp: * rendering/RenderVTTCue.h: * rendering/RenderVideo.cpp: * rendering/RenderVideo.h: * rendering/RenderView.cpp: * rendering/RenderView.h: * rendering/RenderWidget.cpp: * rendering/RenderWidget.h: * rendering/mathml/RenderMathMLBlock.cpp: * rendering/mathml/RenderMathMLBlock.h: * rendering/mathml/RenderMathMLFenced.cpp: * rendering/mathml/RenderMathMLFenced.h: * rendering/mathml/RenderMathMLFencedOperator.cpp: * rendering/mathml/RenderMathMLFencedOperator.h: * rendering/mathml/RenderMathMLFraction.cpp: * rendering/mathml/RenderMathMLFraction.h: * rendering/mathml/RenderMathMLMath.cpp: * rendering/mathml/RenderMathMLMath.h: * rendering/mathml/RenderMathMLMenclose.cpp: * rendering/mathml/RenderMathMLMenclose.h: * rendering/mathml/RenderMathMLOperator.cpp: * rendering/mathml/RenderMathMLOperator.h: * rendering/mathml/RenderMathMLPadded.cpp: * rendering/mathml/RenderMathMLPadded.h: * rendering/mathml/RenderMathMLRoot.cpp: * rendering/mathml/RenderMathMLRoot.h: * rendering/mathml/RenderMathMLRow.cpp: * rendering/mathml/RenderMathMLRow.h: * rendering/mathml/RenderMathMLScripts.cpp: * rendering/mathml/RenderMathMLScripts.h: * rendering/mathml/RenderMathMLSpace.cpp: * rendering/mathml/RenderMathMLSpace.h: * rendering/mathml/RenderMathMLToken.cpp: * rendering/mathml/RenderMathMLToken.h: * rendering/mathml/RenderMathMLUnderOver.cpp: * rendering/mathml/RenderMathMLUnderOver.h: * rendering/svg/RenderSVGBlock.cpp: * rendering/svg/RenderSVGBlock.h: * rendering/svg/RenderSVGContainer.cpp: * rendering/svg/RenderSVGContainer.h: * rendering/svg/RenderSVGEllipse.cpp: * rendering/svg/RenderSVGEllipse.h: * rendering/svg/RenderSVGForeignObject.cpp: * rendering/svg/RenderSVGForeignObject.h: * rendering/svg/RenderSVGGradientStop.cpp: * rendering/svg/RenderSVGGradientStop.h: * rendering/svg/RenderSVGHiddenContainer.cpp: * rendering/svg/RenderSVGHiddenContainer.h: * rendering/svg/RenderSVGImage.cpp: * rendering/svg/RenderSVGImage.h: * rendering/svg/RenderSVGInline.cpp: * rendering/svg/RenderSVGInline.h: * rendering/svg/RenderSVGInlineText.cpp: * rendering/svg/RenderSVGInlineText.h: * rendering/svg/RenderSVGModelObject.cpp: * rendering/svg/RenderSVGModelObject.h: * rendering/svg/RenderSVGPath.cpp: * rendering/svg/RenderSVGPath.h: * rendering/svg/RenderSVGRect.cpp: * rendering/svg/RenderSVGRect.h: * rendering/svg/RenderSVGResourceClipper.cpp: * rendering/svg/RenderSVGResourceClipper.h: * rendering/svg/RenderSVGResourceContainer.cpp: * rendering/svg/RenderSVGResourceContainer.h: * rendering/svg/RenderSVGResourceFilter.cpp: * rendering/svg/RenderSVGResourceFilter.h: * rendering/svg/RenderSVGResourceFilterPrimitive.cpp: * rendering/svg/RenderSVGResourceFilterPrimitive.h: * rendering/svg/RenderSVGResourceGradient.cpp: * rendering/svg/RenderSVGResourceGradient.h: * rendering/svg/RenderSVGResourceLinearGradient.cpp: * rendering/svg/RenderSVGResourceLinearGradient.h: * rendering/svg/RenderSVGResourceMarker.cpp: * rendering/svg/RenderSVGResourceMarker.h: * rendering/svg/RenderSVGResourceMasker.cpp: * rendering/svg/RenderSVGResourceMasker.h: * rendering/svg/RenderSVGResourcePattern.cpp: * rendering/svg/RenderSVGResourcePattern.h: * rendering/svg/RenderSVGResourceRadialGradient.cpp: * rendering/svg/RenderSVGResourceRadialGradient.h: * rendering/svg/RenderSVGRoot.cpp: * rendering/svg/RenderSVGRoot.h: * rendering/svg/RenderSVGShape.cpp: * rendering/svg/RenderSVGShape.h: * rendering/svg/RenderSVGTSpan.cpp: Added. * rendering/svg/RenderSVGTSpan.h: * rendering/svg/RenderSVGText.cpp: * rendering/svg/RenderSVGText.h: * rendering/svg/RenderSVGTextPath.cpp: * rendering/svg/RenderSVGTextPath.h: * rendering/svg/RenderSVGTransformableContainer.cpp: * rendering/svg/RenderSVGTransformableContainer.h: * rendering/svg/RenderSVGViewportContainer.cpp: * rendering/svg/RenderSVGViewportContainer.h: Source/WTF: This just adds an easy way of using the bmalloc IsoHeap API in WebKit. If bmalloc is not enabled, these macros will just make the object FastMalloced. * WTF.xcodeproj/project.pbxproj: * wtf/FastTLS.h: * wtf/IsoMalloc.h: Added. * wtf/IsoMallocInlines.h: Added. Canonical link: https://commits.webkit.org/195445@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224537 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-07 19:21:52 +00:00
WTF_MAKE_ISO_ALLOCATED(RenderMathMLPadded);
Bug 155792 - Basic implementation of mpadded https://bugs.webkit.org/show_bug.cgi?id=155792 Patch by Frederic Wang <fwang@igalia.com> on 2016-07-07 Reviewed by Brent Fulgham. Source/WebCore: We implement a basic support for the mpadded element. We support most of the attribute values except pseudo-units or negative values. Tests: mathml/presentation/mpadded-1-2.html mathml/presentation/mpadded-1.html mathml/presentation/mpadded-2.html mathml/presentation/mpadded-3.html mathml/presentation/mpadded-unsupported-values.html mathml/presentation/mpadded-dynamic.html * CMakeLists.txt: Add RenderMathMLPadded to the build system. * WebCore.xcodeproj/project.pbxproj: Ditto. * mathml/MathMLInlineContainerElement.cpp: (WebCore::MathMLInlineContainerElement::createElementRenderer): Create the renderer for mpadded. * mathml/mathattrs.in: Add voffset attribute. * mathml/mathtags.in: Make mpadded use MathMLInlineContainerElement. * rendering/RenderObject.h: (WebCore::RenderObject::isRenderMathMLPadded): Define isRenderMathMLPadded. * rendering/mathml/RenderMathMLPadded.cpp: Added. We do a simple implementation by overriding the behavior of RenderMathMLRow and forcing relayout after attribute or style change. (WebCore::RenderMathMLPadded::RenderMathMLPadded): (WebCore::RenderMathMLPadded::computePreferredLogicalWidths): (WebCore::RenderMathMLPadded::layoutBlock): (WebCore::RenderMathMLPadded::updateFromElement): (WebCore::RenderMathMLPadded::styleDidChange): (WebCore::RenderMathMLPadded::firstLineBaseline): * rendering/mathml/RenderMathMLPadded.h: Added. LayoutTests: We import mpadded tests from Mozilla test suite. We also add some tests for dynamic changes of mpadded attributes and to verify that the mpadded element behaves as if it had an inferred <mrow>. Finally, we check that fallback properly for negative and pseudo-unit values that we do not support yet. * mathml/presentation/inferred-mrow-baseline.html: Check baseline for mpadded. * mathml/presentation/inferred-mrow-baseline-expected.txt: Ditto. * mathml/presentation/inferred-mrow-stretchy.html: Check stretching of operators for mpadded. * mathml/presentation/inferred-mrow-stretchy-expected.txt: Ditto. * mathml/presentation/mpadded-dynamic.html: Added. Verify dynamic change of mpadded attributes. * mathml/presentation/mpadded-dynamic-expected.html: Added. Ditto. * mathml/presentation/mpadded-unsupported-values.html: Added. Check negative and pseudo-unit values. * mathml/presentation/mpadded-unsupported-values-expected.html: Added. * mathml/presentation/mpadded-1-2-expected.html: Added. * mathml/presentation/mpadded-1-2.html: Added. * mathml/presentation/mpadded-1-expected.html: Added. * mathml/presentation/mpadded-1.html: Added. * mathml/presentation/mpadded-2-expected.html: Added. * mathml/presentation/mpadded-2.html: Added. * mathml/presentation/mpadded-3-expected.html: Added. * mathml/presentation/mpadded-3.html: Added. Canonical link: https://commits.webkit.org/177686@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202962 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-07-08 06:16:32 +00:00
public:
Move parsing of accentunder and accent attributes from renderer to element classes https://bugs.webkit.org/show_bug.cgi?id=159625 Patch by Frederic Wang <fwang@igalia.com> on 2016-07-21 Reviewed by Brent Fulgham. We introduce a new MathMLUnderOverElement that is used for elements munder, mover and munderover in order to create RenderMathMLUnderOver and parse and expose the values of the accent and accentunder attributes. This is one more step toward moving MathML attribute parsing to the DOM (bug 156536). We also do minor clean-up for this and previous renderer classes that no longer do attribute parsing: the MathMLNames namespace is no longer necessary and constructors can take a more accurate element type. No new tests, already covered by existing test. * CMakeLists.txt: Add MathMLUnderOverElement files. * WebCore.xcodeproj/project.pbxproj: Ditto. * mathml/MathMLAllInOne.cpp: Ditto. * mathml/MathMLElement.cpp: (WebCore::MathMLElement::cachedBooleanAttribute): Add parsing of boolean attributes. * mathml/MathMLElement.h: New type and helper functions for boolean attributes. * mathml/MathMLInlineContainerElement.cpp: (WebCore::MathMLInlineContainerElement::createElementRenderer): Remove handling of under/over/underover elements. * mathml/MathMLScriptsElement.cpp: (WebCore::MathMLScriptsElement::MathMLScriptsElement): Remove inline keyword to avoid link errors now that MathMLUnderOverElement overrides that class. * mathml/MathMLScriptsElement.h: Allow MathMLUnderOverElement to override this class. * mathml/MathMLUnderOverElement.cpp: (WebCore::MathMLUnderOverElement::MathMLUnderOverElement): (WebCore::MathMLUnderOverElement::create): (WebCore::MathMLUnderOverElement::accent): Helper function to access the accent value. (WebCore::MathMLUnderOverElement::accentUnder): Helper function to access the accentunder value. (WebCore::MathMLUnderOverElement::parseAttribute): Make accent and accentunder dirty. (WebCore::MathMLUnderOverElement::createElementRenderer): Create RenderMathMLUnderOver * mathml/MathMLUnderOverElement.h: * mathml/mathtags.in: Map under/over/underover to MathMLUnderOverElement. * rendering/mathml/RenderMathMLFraction.cpp: Remove MathMLNames and make the constructor take a MathMLFractionElement. (WebCore::RenderMathMLFraction::RenderMathMLFraction): * rendering/mathml/RenderMathMLFraction.h: * rendering/mathml/RenderMathMLPadded.cpp: Remove MathMLNames and make the constructor take a MathMLPaddedElement. (WebCore::RenderMathMLPadded::RenderMathMLPadded): * rendering/mathml/RenderMathMLPadded.h: * rendering/mathml/RenderMathMLScripts.cpp: Remove MathMLNames and make the constructor take a MathMLScriptsElement. Also rename scriptsElement() to element(). (WebCore::RenderMathMLScripts::RenderMathMLScripts): (WebCore::RenderMathMLScripts::element): (WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded): (WebCore::RenderMathMLScripts::scriptsElement): Deleted. * rendering/mathml/RenderMathMLScripts.h: * rendering/mathml/RenderMathMLUnderOver.cpp: Remove MathMLNames and make the constructor take a RenderMathMLUnderOver. (WebCore::RenderMathMLUnderOver::RenderMathMLUnderOver): (WebCore::RenderMathMLUnderOver::element): (WebCore::RenderMathMLUnderOver::hasAccent): Use the helper functions for accent and accentunder. * rendering/mathml/RenderMathMLUnderOver.h: Canonical link: https://commits.webkit.org/178228@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203553 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-07-22 05:33:01 +00:00
RenderMathMLPadded(MathMLPaddedElement&, RenderStyle&&);
Bug 155792 - Basic implementation of mpadded https://bugs.webkit.org/show_bug.cgi?id=155792 Patch by Frederic Wang <fwang@igalia.com> on 2016-07-07 Reviewed by Brent Fulgham. Source/WebCore: We implement a basic support for the mpadded element. We support most of the attribute values except pseudo-units or negative values. Tests: mathml/presentation/mpadded-1-2.html mathml/presentation/mpadded-1.html mathml/presentation/mpadded-2.html mathml/presentation/mpadded-3.html mathml/presentation/mpadded-unsupported-values.html mathml/presentation/mpadded-dynamic.html * CMakeLists.txt: Add RenderMathMLPadded to the build system. * WebCore.xcodeproj/project.pbxproj: Ditto. * mathml/MathMLInlineContainerElement.cpp: (WebCore::MathMLInlineContainerElement::createElementRenderer): Create the renderer for mpadded. * mathml/mathattrs.in: Add voffset attribute. * mathml/mathtags.in: Make mpadded use MathMLInlineContainerElement. * rendering/RenderObject.h: (WebCore::RenderObject::isRenderMathMLPadded): Define isRenderMathMLPadded. * rendering/mathml/RenderMathMLPadded.cpp: Added. We do a simple implementation by overriding the behavior of RenderMathMLRow and forcing relayout after attribute or style change. (WebCore::RenderMathMLPadded::RenderMathMLPadded): (WebCore::RenderMathMLPadded::computePreferredLogicalWidths): (WebCore::RenderMathMLPadded::layoutBlock): (WebCore::RenderMathMLPadded::updateFromElement): (WebCore::RenderMathMLPadded::styleDidChange): (WebCore::RenderMathMLPadded::firstLineBaseline): * rendering/mathml/RenderMathMLPadded.h: Added. LayoutTests: We import mpadded tests from Mozilla test suite. We also add some tests for dynamic changes of mpadded attributes and to verify that the mpadded element behaves as if it had an inferred <mrow>. Finally, we check that fallback properly for negative and pseudo-unit values that we do not support yet. * mathml/presentation/inferred-mrow-baseline.html: Check baseline for mpadded. * mathml/presentation/inferred-mrow-baseline-expected.txt: Ditto. * mathml/presentation/inferred-mrow-stretchy.html: Check stretching of operators for mpadded. * mathml/presentation/inferred-mrow-stretchy-expected.txt: Ditto. * mathml/presentation/mpadded-dynamic.html: Added. Verify dynamic change of mpadded attributes. * mathml/presentation/mpadded-dynamic-expected.html: Added. Ditto. * mathml/presentation/mpadded-unsupported-values.html: Added. Check negative and pseudo-unit values. * mathml/presentation/mpadded-unsupported-values-expected.html: Added. * mathml/presentation/mpadded-1-2-expected.html: Added. * mathml/presentation/mpadded-1-2.html: Added. * mathml/presentation/mpadded-1-expected.html: Added. * mathml/presentation/mpadded-1.html: Added. * mathml/presentation/mpadded-2-expected.html: Added. * mathml/presentation/mpadded-2.html: Added. * mathml/presentation/mpadded-3-expected.html: Added. * mathml/presentation/mpadded-3.html: Added. Canonical link: https://commits.webkit.org/177686@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202962 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-07-08 06:16:32 +00:00
private:
const char* renderName() const final { return "RenderMathMLPadded"; }
bool isRenderMathMLPadded() const final { return true; }
void computePreferredLogicalWidths() final;
Introduce user-defined literal for LayoutUnit https://bugs.webkit.org/show_bug.cgi?id=191915 Reviewed by Dean Jackson. * platform/LayoutUnit.h: Introduce a user-defined literal for LayoutUnit, _lu, replacing the existing "fromPixel" factory function. * layout/FormattingContextGeometry.cpp: * layout/inlineformatting/InlineFormattingContextGeometry.cpp: * layout/inlineformatting/InlineLineBreaker.cpp: * page/FrameView.cpp: * page/FrameViewLayoutContext.h: * page/Page.cpp: * page/SpatialNavigation.h: * platform/ScrollableArea.cpp: * rendering/EllipsisBox.cpp: * rendering/FlexibleBoxAlgorithm.cpp: * rendering/FloatingObjects.cpp: * rendering/GridLayoutFunctions.cpp: * rendering/GridTrackSizingAlgorithm.cpp: * rendering/InlineFlowBox.cpp: * rendering/InlineTextBox.cpp: * rendering/LayoutState.h: * rendering/LogicalSelectionOffsetCaches.h: * rendering/RenderBlock.cpp: * rendering/RenderBlock.h: * rendering/RenderBlockFlow.cpp: * rendering/RenderBlockFlow.h: * rendering/RenderBlockLineLayout.cpp: * rendering/RenderBox.cpp: * rendering/RenderBoxModelObject.cpp: * rendering/RenderDeprecatedFlexibleBox.cpp: * rendering/RenderDeprecatedFlexibleBox.h: * rendering/RenderElement.cpp: * rendering/RenderFlexibleBox.cpp: * rendering/RenderFlexibleBox.h: * rendering/RenderFragmentContainer.cpp: * rendering/RenderFragmentedFlow.cpp: * rendering/RenderGrid.cpp: * rendering/RenderGrid.h: * rendering/RenderImage.cpp: * rendering/RenderLayer.cpp: * rendering/RenderListMarker.cpp: * rendering/RenderMultiColumnFlow.cpp: * rendering/RenderMultiColumnSet.cpp: * rendering/RenderReplaced.cpp: * rendering/RenderReplaced.h: * rendering/RenderRubyRun.h: * rendering/RenderTable.cpp: * rendering/RenderTable.h: * rendering/RenderTableSection.cpp: * rendering/RenderTheme.cpp: * rendering/RenderTreeAsText.cpp: * rendering/RenderView.cpp: * rendering/RootInlineBox.h: * rendering/SimpleLineLayout.cpp: * rendering/SimpleLineLayoutPagination.cpp: * rendering/TableLayout.h: * rendering/line/BreakingContext.h: * rendering/line/LineLayoutState.h: * rendering/line/LineWidth.h: * rendering/mathml/MathOperator.cpp: * rendering/mathml/MathOperator.h: * rendering/mathml/RenderMathMLBlock.h: * rendering/mathml/RenderMathMLFraction.cpp: * rendering/mathml/RenderMathMLFraction.h: * rendering/mathml/RenderMathMLMath.cpp: * rendering/mathml/RenderMathMLMath.h: * rendering/mathml/RenderMathMLMenclose.h: * rendering/mathml/RenderMathMLOperator.cpp: * rendering/mathml/RenderMathMLOperator.h: * rendering/mathml/RenderMathMLPadded.h: * rendering/mathml/RenderMathMLRoot.cpp: * rendering/mathml/RenderMathMLRoot.h: * rendering/mathml/RenderMathMLRow.h: * rendering/mathml/RenderMathMLScripts.cpp: * rendering/mathml/RenderMathMLScripts.h: * rendering/mathml/RenderMathMLSpace.h: * rendering/mathml/RenderMathMLToken.cpp: * rendering/mathml/RenderMathMLToken.h: * rendering/mathml/RenderMathMLUnderOver.h: * rendering/shapes/ShapeOutsideInfo.cpp: * rendering/style/CollapsedBorderValue.h: Update all instances of LayoutUnit(), LayoutUnit(0), LayoutUnit { 0 }, etc. and add any other literal conversions that will be needed when making non-int LayoutUnit constructors explicit. For good measure, also mark all default values for LayoutUnit parameters. Canonical link: https://commits.webkit.org/206632@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238463 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-23 20:47:11 +00:00
void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0_lu) final;
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<LayoutUnit> firstLineBaseline() const final;
Bug 155792 - Basic implementation of mpadded https://bugs.webkit.org/show_bug.cgi?id=155792 Patch by Frederic Wang <fwang@igalia.com> on 2016-07-07 Reviewed by Brent Fulgham. Source/WebCore: We implement a basic support for the mpadded element. We support most of the attribute values except pseudo-units or negative values. Tests: mathml/presentation/mpadded-1-2.html mathml/presentation/mpadded-1.html mathml/presentation/mpadded-2.html mathml/presentation/mpadded-3.html mathml/presentation/mpadded-unsupported-values.html mathml/presentation/mpadded-dynamic.html * CMakeLists.txt: Add RenderMathMLPadded to the build system. * WebCore.xcodeproj/project.pbxproj: Ditto. * mathml/MathMLInlineContainerElement.cpp: (WebCore::MathMLInlineContainerElement::createElementRenderer): Create the renderer for mpadded. * mathml/mathattrs.in: Add voffset attribute. * mathml/mathtags.in: Make mpadded use MathMLInlineContainerElement. * rendering/RenderObject.h: (WebCore::RenderObject::isRenderMathMLPadded): Define isRenderMathMLPadded. * rendering/mathml/RenderMathMLPadded.cpp: Added. We do a simple implementation by overriding the behavior of RenderMathMLRow and forcing relayout after attribute or style change. (WebCore::RenderMathMLPadded::RenderMathMLPadded): (WebCore::RenderMathMLPadded::computePreferredLogicalWidths): (WebCore::RenderMathMLPadded::layoutBlock): (WebCore::RenderMathMLPadded::updateFromElement): (WebCore::RenderMathMLPadded::styleDidChange): (WebCore::RenderMathMLPadded::firstLineBaseline): * rendering/mathml/RenderMathMLPadded.h: Added. LayoutTests: We import mpadded tests from Mozilla test suite. We also add some tests for dynamic changes of mpadded attributes and to verify that the mpadded element behaves as if it had an inferred <mrow>. Finally, we check that fallback properly for negative and pseudo-unit values that we do not support yet. * mathml/presentation/inferred-mrow-baseline.html: Check baseline for mpadded. * mathml/presentation/inferred-mrow-baseline-expected.txt: Ditto. * mathml/presentation/inferred-mrow-stretchy.html: Check stretching of operators for mpadded. * mathml/presentation/inferred-mrow-stretchy-expected.txt: Ditto. * mathml/presentation/mpadded-dynamic.html: Added. Verify dynamic change of mpadded attributes. * mathml/presentation/mpadded-dynamic-expected.html: Added. Ditto. * mathml/presentation/mpadded-unsupported-values.html: Added. Check negative and pseudo-unit values. * mathml/presentation/mpadded-unsupported-values-expected.html: Added. * mathml/presentation/mpadded-1-2-expected.html: Added. * mathml/presentation/mpadded-1-2.html: Added. * mathml/presentation/mpadded-1-expected.html: Added. * mathml/presentation/mpadded-1.html: Added. * mathml/presentation/mpadded-2-expected.html: Added. * mathml/presentation/mpadded-2.html: Added. * mathml/presentation/mpadded-3-expected.html: Added. * mathml/presentation/mpadded-3.html: Added. Canonical link: https://commits.webkit.org/177686@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202962 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-07-08 06:16:32 +00:00
Move parsing of mpadded attributes to a MathMLPaddedElement class https://bugs.webkit.org/show_bug.cgi?id=159620 Patch by Frederic Wang <fwang@igalia.com> on 2016-07-12 Reviewed by Brent Fulgham. No new tests, behavior is unchanged. * CMakeLists.txt: Add MathMLPaddedElement files. * WebCore.xcodeproj/project.pbxproj: Ditto. * mathml/MathMLAllInOne.cpp: Ditto. * mathml/MathMLInlineContainerElement.cpp: Remove handling of mpadded. * mathml/MathMLPaddedElement.cpp: Added. (WebCore::MathMLPaddedElement::MathMLPaddedElement): (WebCore::MathMLPaddedElement::create): (WebCore::MathMLPaddedElement::width): Expose width attribute as a MathMLLength until mpadded pseudo-units are supported. (WebCore::MathMLPaddedElement::height): Ditto. (WebCore::MathMLPaddedElement::depth): Ditto (WebCore::MathMLPaddedElement::lspace): Ditto. (WebCore::MathMLPaddedElement::voffset): Ditto. (WebCore::MathMLPaddedElement::parseAttribute): Make length attribute dirty. (WebCore::MathMLPaddedElement::createElementRenderer): Moved code from MathMLInlineContainerElement. * mathml/MathMLPaddedElement.h: Added. * mathml/mathtags.in: Map mapdded to MathMLPaddedElement. * rendering/mathml/RenderMathMLPadded.cpp: (WebCore::RenderMathMLPadded::resolveWidth): Helper function to resolve width. (WebCore::RenderMathMLPadded::resolveAttributes): Helper function to resolve all attributes. (WebCore::RenderMathMLPadded::computePreferredLogicalWidths): Use resolveWidth. (WebCore::RenderMathMLPadded::layoutBlock): Use resolveAttributes. * rendering/mathml/RenderMathMLPadded.h: Add new helper functions to access attributes from the MathMLPaddedElement class. Canonical link: https://commits.webkit.org/177850@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-07-13 04:47:00 +00:00
MathMLPaddedElement& element() const { return static_cast<MathMLPaddedElement&>(nodeForNonAnonymous()); }
More cleanup for the mpadded implementation https://bugs.webkit.org/show_bug.cgi?id=161136 Source/WebCore: Patch by Frederic Wang <fwang@igalia.com> on 2016-08-28 Reviewed by Darin Adler. We perform the following cleanup for the mpadded renderer class: 1) We do not store the ascent on the class. This may make update more reliable and will help for general improvement of MathML ascents (bug 155879). 2) We split resolveWidth/resolveAttributes into smaller functions and improve the coding style. This helps to calculate firstLineBaseline in 1). 3) We do not override updateFromElement and styleDidChange to perform setNeedsLayout calls. These calls already seem unnecessary and can be removed even more safely after 1). We add a test for style change. Change of attributes as well as metrics calcuation of empty and non-empty mpadded elements are already covered by other tests. Test: mathml/presentation/mpadded-style-change.html * rendering/mathml/RenderMathMLPadded.cpp: (WebCore::RenderMathMLPadded::voffset): New helper function to resolve voffset. (WebCore::RenderMathMLPadded::lspace): Ditto for lspace. (WebCore::RenderMathMLPadded::mpaddedWidth): Ditto for width. (WebCore::RenderMathMLPadded::mpaddedHeight): Ditto for height. (WebCore::RenderMathMLPadded::mpaddedDepth): Ditto for detph. (WebCore::RenderMathMLPadded::computePreferredLogicalWidths): Use mpaddedWidth(). (WebCore::RenderMathMLPadded::layoutBlock): Use the new helper functions. (WebCore::RenderMathMLPadded::firstLineBaseline): Use voffset or mpaddedHeight for baseline calculation instead of m_padded. (WebCore::RenderMathMLPadded::resolveWidth): Deleted. Renamed mpaddedWidth. (WebCore::RenderMathMLPadded::resolveAttributes): Deleted. Split into smaller functions. (WebCore::RenderMathMLPadded::updateFromElement): Deleted. We do not need to call setNeedsLayout. (WebCore::RenderMathMLPadded::styleDidChange): Deleted. Ditto. * rendering/mathml/RenderMathMLPadded.h: Update function declaration and remove m_ascent. LayoutTests: We add a test for style change in mpadded. Patch by Frederic Wang <fwang@igalia.com> on 2016-08-28 Reviewed by Darin Adler. * mathml/presentation/mpadded-style-change-expected.html: Added. * mathml/presentation/mpadded-style-change.html: Added. Canonical link: https://commits.webkit.org/179472@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@205098 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-28 08:26:07 +00:00
LayoutUnit voffset() const;
LayoutUnit lspace() const;
LayoutUnit mpaddedWidth(LayoutUnit contentWidth) const;
LayoutUnit mpaddedHeight(LayoutUnit contentHeight) const;
LayoutUnit mpaddedDepth(LayoutUnit contentDepth) const;
Bug 155792 - Basic implementation of mpadded https://bugs.webkit.org/show_bug.cgi?id=155792 Patch by Frederic Wang <fwang@igalia.com> on 2016-07-07 Reviewed by Brent Fulgham. Source/WebCore: We implement a basic support for the mpadded element. We support most of the attribute values except pseudo-units or negative values. Tests: mathml/presentation/mpadded-1-2.html mathml/presentation/mpadded-1.html mathml/presentation/mpadded-2.html mathml/presentation/mpadded-3.html mathml/presentation/mpadded-unsupported-values.html mathml/presentation/mpadded-dynamic.html * CMakeLists.txt: Add RenderMathMLPadded to the build system. * WebCore.xcodeproj/project.pbxproj: Ditto. * mathml/MathMLInlineContainerElement.cpp: (WebCore::MathMLInlineContainerElement::createElementRenderer): Create the renderer for mpadded. * mathml/mathattrs.in: Add voffset attribute. * mathml/mathtags.in: Make mpadded use MathMLInlineContainerElement. * rendering/RenderObject.h: (WebCore::RenderObject::isRenderMathMLPadded): Define isRenderMathMLPadded. * rendering/mathml/RenderMathMLPadded.cpp: Added. We do a simple implementation by overriding the behavior of RenderMathMLRow and forcing relayout after attribute or style change. (WebCore::RenderMathMLPadded::RenderMathMLPadded): (WebCore::RenderMathMLPadded::computePreferredLogicalWidths): (WebCore::RenderMathMLPadded::layoutBlock): (WebCore::RenderMathMLPadded::updateFromElement): (WebCore::RenderMathMLPadded::styleDidChange): (WebCore::RenderMathMLPadded::firstLineBaseline): * rendering/mathml/RenderMathMLPadded.h: Added. LayoutTests: We import mpadded tests from Mozilla test suite. We also add some tests for dynamic changes of mpadded attributes and to verify that the mpadded element behaves as if it had an inferred <mrow>. Finally, we check that fallback properly for negative and pseudo-unit values that we do not support yet. * mathml/presentation/inferred-mrow-baseline.html: Check baseline for mpadded. * mathml/presentation/inferred-mrow-baseline-expected.txt: Ditto. * mathml/presentation/inferred-mrow-stretchy.html: Check stretching of operators for mpadded. * mathml/presentation/inferred-mrow-stretchy-expected.txt: Ditto. * mathml/presentation/mpadded-dynamic.html: Added. Verify dynamic change of mpadded attributes. * mathml/presentation/mpadded-dynamic-expected.html: Added. Ditto. * mathml/presentation/mpadded-unsupported-values.html: Added. Check negative and pseudo-unit values. * mathml/presentation/mpadded-unsupported-values-expected.html: Added. * mathml/presentation/mpadded-1-2-expected.html: Added. * mathml/presentation/mpadded-1-2.html: Added. * mathml/presentation/mpadded-1-expected.html: Added. * mathml/presentation/mpadded-1.html: Added. * mathml/presentation/mpadded-2-expected.html: Added. * mathml/presentation/mpadded-2.html: Added. * mathml/presentation/mpadded-3-expected.html: Added. * mathml/presentation/mpadded-3.html: Added. Canonical link: https://commits.webkit.org/177686@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202962 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-07-08 06:16:32 +00:00
};
} // namespace WebCore
SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderMathMLPadded, isRenderMathMLPadded())
#endif // ENABLE(MATHML)