source: webkit/trunk/Source/WebCore/rendering/RenderMultiColumnFlow.cpp

Last change on this file was 291992, checked in by Chris Dumez, 3 years ago

Prepare WebCore for making the String(const char*) constructor explicit
https://bugs.webkit.org/show_bug.cgi?id=238408

Reviewed by Geoff Garen.

Prepare WebCore for making the String(const char*) constructor explicit.
Making this constructor explicit helps findings cases where a String is constructed
from a literal without the ""_s suffix.

Source/WebCore:

  • Scripts/SettingsTemplates/Settings.cpp.erb:
  • contentextensions/ContentExtensionError.cpp:
  • contentextensions/ContentExtensionError.h:
  • css/MediaQueryEvaluator.cpp:

(WebCore::MediaQueryEvaluator::mediaAttributeMatches):

  • dom/BroadcastChannel.cpp:

(WebCore::BroadcastChannel::postMessage):

  • dom/DataTransfer.cpp:

(WebCore::normalizeType):
(WebCore::IEOpFromDragOp):

  • dom/Document.cpp:

(WebCore::Document::compatMode const):
(WebCore::Document::characterSetWithUTF8Fallback const):
(WebCore::Document::processMetaHttpEquiv):
(WebCore::Document::setDomain):
(WebCore::Document::execCommand):
(WebCore::Document::queryCommandEnabled):
(WebCore::Document::queryCommandIndeterm):
(WebCore::Document::queryCommandState):
(WebCore::Document::queryCommandSupported):
(WebCore::Document::queryCommandValue):
(WebCore::Document::updateResizeObservations):

  • dom/Element.cpp:

(WebCore::Element::setOuterHTML):
(WebCore::Element::animate):

  • dom/ImageOverlay.cpp:

(WebCore::ImageOverlay::updateWithTextRecognitionResult):

  • dom/Node.cpp:

(WebCore::Node::showTreeForThisAcrossFrame const):

  • dom/ProcessingInstruction.cpp:

(WebCore::ProcessingInstruction::checkStyleSheet):

  • dom/ViewportArguments.cpp:

(WebCore::viewportErrorMessageTemplate):
(WebCore::viewportErrorMessage):

  • editing/Editor.cpp:

(WebCore::Editor::toggleBold):
(WebCore::Editor::toggleUnderline):
(WebCore::Editor::setBaseWritingDirection):

  • editing/EditorCommand.cpp:

(WebCore::isStylePresent):
(WebCore::executeToggleStyle):
(WebCore::stateStyle):
(WebCore::textDecorationChangeForToggling):

  • editing/InsertLineBreakCommand.cpp:

(WebCore::InsertLineBreakCommand::doApply):

  • editing/InsertTextCommand.cpp:

(WebCore::InsertTextCommand::insertTab):

  • editing/ReplaceSelectionCommand.cpp:

(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
(WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):

  • editing/TextManipulationController.cpp:

(WebCore::TextManipulationController::observeParagraphs):

  • editing/TypingCommand.cpp:

(WebCore::TypingCommand::insertLineBreakAndNotifyAccessibility):
(WebCore::TypingCommand::insertParagraphSeparatorAndNotifyAccessibility):
(WebCore::TypingCommand::insertParagraphSeparatorInQuotedContentAndNotifyAccessibility):

  • editing/markup.cpp:

(WebCore::createPageForSanitizingWebContent):

  • fileapi/BlobURL.cpp:

(WebCore::BlobURL::createInternalURL):

  • fileapi/FileReaderLoader.cpp:

(WebCore::FileReaderLoader::start):
(WebCore::FileReaderLoader::convertToText):
(WebCore::FileReaderLoader::convertToDataURL):

  • history/BackForwardCache.cpp:

(WebCore::BackForwardCache::BackForwardCache):

  • html/EmailInputType.cpp:
  • html/EnterKeyHint.cpp:

(WebCore::attributeValueForEnterKeyHint):

  • html/FTPDirectoryDocument.cpp:

(WebCore::FTPDirectoryDocumentParser::createBasicDocument):

  • html/HTMLAnchorElement.cpp:

(WebCore::HTMLAnchorElement::handleClick):

  • html/HTMLFrameElementBase.cpp:

(WebCore::HTMLFrameElementBase::parseAttribute):

  • html/HTMLImageElement.cpp:

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
(WebCore::HTMLImageElement::evaluateDynamicMediaQueryDependencies):

  • html/HTMLInputElement.cpp:

(WebCore::HTMLInputElement::showPicker):

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::play):
(WebCore::HTMLMediaElement::selectNextSourceChild):
(WebCore::HTMLMediaElement::updateSleepDisabling):

  • html/HTMLObjectElement.cpp:

(WebCore::HTMLObjectElement::parametersForPlugin):

  • html/ImageBitmap.cpp:

(WebCore::ImageBitmap::createPromise):
(WebCore::croppedSourceRectangleWithFormatting):
(WebCore::ImageBitmap::createFromBuffer):

  • html/ImageDocument.cpp:

(WebCore::ImageDocument::createDocumentStructure):

  • html/MediaFragmentURIParser.cpp:

(WebCore::MediaFragmentURIParser::parseFragments):

  • html/PDFDocument.cpp:

(WebCore::PDFDocument::sendPDFArrayBuffer):

  • html/canvas/ANGLEInstancedArrays.cpp:

(WebCore::ANGLEInstancedArrays::ANGLEInstancedArrays):
(WebCore::ANGLEInstancedArrays::supported):

  • html/canvas/EXTTextureCompressionRGTC.cpp:

(WebCore::EXTTextureCompressionRGTC::EXTTextureCompressionRGTC):

  • html/canvas/WebGL2RenderingContext.cpp:

(WebCore::WebGL2RenderingContext::initializeShaderExtensions):

  • html/canvas/WebGLCompressedTextureATC.cpp:

(WebCore::WebGLCompressedTextureATC::WebGLCompressedTextureATC):
(WebCore::WebGLCompressedTextureATC::supported):

  • html/canvas/WebGLCompressedTextureETC.cpp:

(WebCore::WebGLCompressedTextureETC::WebGLCompressedTextureETC):
(WebCore::WebGLCompressedTextureETC::supported):

  • html/canvas/WebGLCompressedTextureETC1.cpp:

(WebCore::WebGLCompressedTextureETC1::WebGLCompressedTextureETC1):
(WebCore::WebGLCompressedTextureETC1::supported):

  • html/canvas/WebGLCompressedTexturePVRTC.cpp:

(WebCore::WebGLCompressedTexturePVRTC::WebGLCompressedTexturePVRTC):
(WebCore::WebGLCompressedTexturePVRTC::supported):

  • html/canvas/WebGLCompressedTextureS3TC.cpp:

(WebCore::WebGLCompressedTextureS3TC::WebGLCompressedTextureS3TC):
(WebCore::WebGLCompressedTextureS3TC::supported):

  • html/canvas/WebGLCompressedTextureS3TCsRGB.cpp:

(WebCore::WebGLCompressedTextureS3TCsRGB::WebGLCompressedTextureS3TCsRGB):
(WebCore::WebGLCompressedTextureS3TCsRGB::supported):

  • html/canvas/WebGLDebugShaders.cpp:

(WebCore::WebGLDebugShaders::WebGLDebugShaders):

  • html/canvas/WebGLDepthTexture.cpp:

(WebCore::WebGLDepthTexture::WebGLDepthTexture):
(WebCore::WebGLDepthTexture::supported):

  • html/canvas/WebGLDrawBuffers.cpp:

(WebCore::WebGLDrawBuffers::WebGLDrawBuffers):
(WebCore::WebGLDrawBuffers::supported):
(WebCore::WebGLDrawBuffers::satisfiesWebGLRequirements):

  • html/canvas/WebGLRenderingContextBase.cpp:

(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::setupFlags):
(WebCore::WebGLRenderingContextBase::getActiveUniform):
(WebCore::WebGLRenderingContextBase::addExtensionSupportedFormatsAndTypes):
(WebCore::WebGLRenderingContextBase::loseContextImpl):
(WebCore::WebGLRenderingContextBase::printToConsole):
(WebCore::WebGLRenderingContextBase::maybeRestoreContext):
(WebCore::WebGLRenderingContextBase::recycleContext):

  • html/parser/CSSPreloadScanner.cpp:

(WebCore::CSSPreloadScanner::emitRule):

  • html/parser/HTMLParserIdioms.cpp:

(WebCore::serializeForNumberType):

  • html/parser/HTMLPreloadScanner.cpp:

(WebCore::TokenPreloadScanner::initiatorFor):
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):

  • html/parser/HTMLPreloadScanner.h:
  • html/parser/HTMLResourcePreloader.h:

(WebCore::PreloadRequest::PreloadRequest):

  • html/track/TextTrackCue.cpp:

(WebCore::TextTrackCue::create):

  • html/track/TextTrackCueGeneric.cpp:

(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):

  • html/track/VTTCue.cpp:

(WebCore::VTTCueBox::applyCSSProperties):

  • html/track/WebVTTParser.cpp:

(WebCore::WebVTTParser::WebVTTParser):
(WebCore::WebVTTTreeBuilder::constructTreeFromToken):

  • inspector/InspectorAuditAccessibilityObject.cpp:

(WebCore::InspectorAuditAccessibilityObject::getComputedProperties):

  • inspector/InspectorCanvas.cpp:

(WebCore::InspectorCanvas::indexForData):
(WebCore::InspectorCanvas::buildArrayForCanvasPattern):

  • inspector/InspectorFrontendClientLocal.cpp:
  • inspector/InspectorFrontendHost.cpp:
  • inspector/InspectorOverlay.cpp:

(WebCore::InspectorOverlay::setGridOverlayForNode):
(WebCore::InspectorOverlay::clearGridOverlayForNode):
(WebCore::InspectorOverlay::setFlexOverlayForNode):
(WebCore::InspectorOverlay::clearFlexOverlayForNode):

  • inspector/InspectorStyleSheet.cpp:

(WebCore::InspectorStyle::buildObjectForStyle const):
(WebCore::InspectorStyle::styleWithProperties const):
(WebCore::selectorsFromSource):

  • inspector/agents/InspectorAnimationAgent.cpp:

(WebCore::InspectorAnimationAgent::resolveAnimation):

  • inspector/agents/InspectorCSSAgent.cpp:

(WebCore::InspectorCSSAgent::getFontDataForNode):
(WebCore::InspectorCSSAgent::getStyleSheet):
(WebCore::InspectorCSSAgent::setRuleSelector):
(WebCore::InspectorCSSAgent::addRule):

  • inspector/agents/InspectorCanvasAgent.cpp:

(WebCore::InspectorCanvasAgent::resolveContext):

  • inspector/agents/InspectorDOMAgent.cpp:

(WebCore::InspectorDOMAgent::getSupportedEventNames):
(WebCore::InspectorDOMAgent::showGridOverlay):
(WebCore::InspectorDOMAgent::showFlexOverlay):

  • inspector/agents/InspectorDOMDebuggerAgent.cpp:

(WebCore::InspectorDOMDebuggerAgent::setEventBreakpoint):
(WebCore::InspectorDOMDebuggerAgent::removeEventBreakpoint):
(WebCore::InspectorDOMDebuggerAgent::breakOnURLIfNeeded):

  • inspector/agents/InspectorDOMStorageAgent.cpp:

(WebCore::InspectorDOMStorageAgent::findStorageArea):

  • inspector/agents/InspectorDatabaseAgent.cpp:

(WebCore::InspectorDatabaseAgent::executeSQL):

  • inspector/agents/InspectorIndexedDBAgent.cpp:

(WebCore::Inspector::ExecutableWithDatabase::start):

  • inspector/agents/InspectorLayerTreeAgent.cpp:

(WebCore::InspectorLayerTreeAgent::buildObjectForLayer):

  • inspector/agents/InspectorNetworkAgent.cpp:

(WebCore::InspectorNetworkAgent::resolveWebSocket):

  • inspector/agents/InspectorPageAgent.cpp:

(WebCore::parseCookieObject):

  • inspector/agents/page/PageDOMDebuggerAgent.cpp:

(WebCore::PageDOMDebuggerAgent::setDOMBreakpoint):
(WebCore::PageDOMDebuggerAgent::removeDOMBreakpoint):
(WebCore::PageDOMDebuggerAgent::willInsertDOMNode):
(WebCore::PageDOMDebuggerAgent::willRemoveDOMNode):
(WebCore::PageDOMDebuggerAgent::buildPauseDataForDOMBreakpoint):

  • layout/Verification.cpp:

(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):

  • layout/integration/LayoutIntegrationCoverage.cpp:

(WebCore::LayoutIntegration::canUseForLineLayoutWithReason):

  • loader/ContentFilter.h:

(WebCore::ContentFilter::urlScheme):

  • loader/CrossOriginAccessControl.cpp:

(WebCore::createAccessControlPreflightRequest):

  • loader/CrossOriginPreflightResultCache.cpp:

(WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginMethod const):
(WebCore::CrossOriginPreflightResultCacheItem::validateCrossOriginHeaders const):

  • loader/DocumentLoader.cpp:

(WebCore::DocumentLoader::maybeLoadEmpty):

  • loader/DocumentThreadableLoader.cpp:

(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
(WebCore::DocumentThreadableLoader::checkURLSchemeAsCORSEnabled):
(WebCore::DocumentThreadableLoader::cancel):
(WebCore::DocumentThreadableLoader::loadRequest):

  • loader/FormSubmission.cpp:

(WebCore::FormSubmission::create):
(WebCore::FormSubmission::populateFrameLoadRequest):

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::updateRequestAndAddExtraFields):
(WebCore::FrameLoader::loadPostRequest):
(WebCore::FrameLoader::loadDifferentDocumentItem):

  • loader/ImageLoader.cpp:

(WebCore::rejectPromises):
(WebCore::ImageLoader::rejectDecodePromises):
(WebCore::ImageLoader::notifyFinished):
(WebCore::ImageLoader::decode):

  • loader/ImageLoader.h:
  • loader/MixedContentChecker.cpp:

(WebCore::logWarning):
(WebCore::MixedContentChecker::canDisplayInsecureContent):
(WebCore::MixedContentChecker::canRunInsecureContent):

  • loader/PingLoader.cpp:

(WebCore::PingLoader::sendPing):

  • loader/ResourceLoadStatistics.cpp:

(WebCore::encodeFontHashSet):
(WebCore::encodeCanvasActivityRecord):
(WebCore::ResourceLoadStatistics::encode const):
(WebCore::decodeHashCountedSet):
(WebCore::decodeFontHashSet):
(WebCore::decodeCanvasActivityRecord):
(WebCore::ResourceLoadStatistics::decode):
(WebCore::ResourceLoadStatistics::toString const):

  • loader/ResourceLoader.cpp:

(WebCore::ResourceLoader::start):
(WebCore::ResourceLoader::loadDataURL):

  • loader/ServerTimingParser.cpp:

(WebCore::ServerTimingParser::parseServerTiming):

  • loader/SubresourceLoader.cpp:

(WebCore::SubresourceLoader::didReceiveResponse):

  • loader/TextResourceDecoder.cpp:

(WebCore::TextResourceDecoder::textFromUTF8):

  • loader/archive/cf/LegacyWebArchive.cpp:

(WebCore::LegacyWebArchive::create):
(WebCore::LegacyWebArchive::createFromSelection):

  • loader/cache/CachedApplicationManifest.cpp:

(WebCore::CachedApplicationManifest::CachedApplicationManifest):
(WebCore::CachedApplicationManifest::encoding const):

  • loader/cache/CachedCSSStyleSheet.cpp:

(WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
(WebCore::CachedCSSStyleSheet::didAddClient):
(WebCore::CachedCSSStyleSheet::encoding const):
(WebCore::CachedCSSStyleSheet::checkNotify):

  • loader/cache/CachedResource.cpp:

(WebCore::CachedResource::load):

  • loader/cache/CachedSVGDocument.cpp:

(WebCore::CachedSVGDocument::CachedSVGDocument):
(WebCore::CachedSVGDocument::encoding const):

  • loader/cache/CachedSVGFont.cpp:

(WebCore::CachedSVGFont::ensureCustomFontData):

  • loader/cache/CachedScript.cpp:

(WebCore::CachedScript::encoding const):

  • loader/cache/CachedXSLStyleSheet.cpp:

(WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
(WebCore::CachedXSLStyleSheet::encoding const):

  • loader/cache/MemoryCache.cpp:

(WebCore::MemoryCache::MemoryCache):
(WebCore::MemoryCache::originsWithCache const):

  • mathml/MathMLElement.cpp:

(WebCore::convertMathSizeIfNeeded):

  • page/CaptionUserPreferencesMediaAF.cpp:

(WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS const):

  • page/Chrome.cpp:

(WebCore::Chrome::print):

  • page/ContextMenuController.cpp:

(WebCore::ContextMenuController::contextMenuItemSelected):
(WebCore::ContextMenuController::checkOrEnableIfNeeded const):

  • page/DOMSelection.cpp:

(WebCore::DOMSelection::extend):

  • page/DOMWindow.cpp:

(WebCore::DOMWindow::print):
(WebCore::DOMWindow::alert):
(WebCore::DOMWindow::confirmForBindings):
(WebCore::DOMWindow::prompt):
(WebCore::DOMWindow::showModalDialog):

  • page/EventHandler.cpp:

(WebCore::handleKeyboardSelectionMovement):

  • page/EventSource.cpp:

(WebCore::EventSource::connect):

  • page/Frame.cpp:

(WebCore::createRegExpForLabels):
(WebCore::matchLabelsAgainstString):

  • page/FrameView.cpp:

(WebCore::FrameView::adjustMediaTypeForPrinting):

  • page/IntersectionObserver.cpp:

(WebCore::parseRootMargin):
(WebCore::IntersectionObserver::create):

  • page/LoggedInStatus.cpp:

(WebCore::LoggedInStatus::create):

  • page/NavigatorBase.cpp:
  • page/Page.cpp:

(WebCore::Page::userStyleSheet const):

  • page/Quirks.cpp:

(WebCore::Quirks::triggerOptionalStorageAccessQuirk const):

  • page/WindowFeatures.cpp:

(WebCore::parseDialogFeatures):
(WebCore::boolFeature):
(WebCore::floatFeature):

  • page/csp/ContentSecurityPolicy.cpp:

(WebCore::consoleMessageForViolation):
(WebCore::ContentSecurityPolicy::allowEval const):
(WebCore::ContentSecurityPolicy::reportInvalidPluginTypes const):

  • page/csp/ContentSecurityPolicyDirectiveList.cpp:

(WebCore::ContentSecurityPolicyDirectiveList::shouldReportSample const):

  • page/csp/ContentSecurityPolicyDirectiveNames.cpp:
  • page/csp/ContentSecurityPolicyDirectiveNames.h:
  • platform/LegacySchemeRegistry.cpp:

(WebCore::allBuiltinSchemes):

  • platform/LocalizedStrings.cpp:

(WebCore::AXMenuListPopupActionVerb):
(WebCore::AXMenuListActionVerb):
(WebCore::AXListItemActionVerb):

  • platform/SleepDisabler.cpp:

(WebCore::SleepDisabler::SleepDisabler):

  • platform/SleepDisabler.h:
  • platform/audio/HRTFDatabase.cpp:

(WebCore::HRTFDatabase::HRTFDatabase):

  • platform/encryptedmedia/CDMPrivate.cpp:

(WebCore::CDMPrivate::getSupportedCapabilitiesForAudioVideoType):

  • platform/encryptedmedia/clearkey/CDMClearKey.cpp:

(WebCore::parseLicenseFormat):
(WebCore::parseLicenseReleaseAcknowledgementFormat):
(WebCore::extractKeyidsFromCencInitData):
(WebCore::extractKeyIdFromWebMInitData):
(WebCore::CDMInstanceSessionClearKey::removeSessionData):

  • platform/graphics/Font.cpp:

(WebCore::Font::description const):

  • platform/graphics/GraphicsTypes.cpp:
  • platform/graphics/InbandGenericCue.cpp:

(WebCore::InbandGenericCue::toJSONString const):

  • platform/graphics/MediaPlayer.cpp:
  • platform/graphics/avfoundation/FormatDescriptionUtilities.cpp:

(WebCore::codecFromFormatDescription):

  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayerCA::updateAnimations):

  • platform/graphics/cg/PDFDocumentImage.cpp:

(WebCore::PDFDocumentImage::filenameExtension const):

  • platform/graphics/cocoa/VP9UtilitiesCocoa.mm:

(WebCore::createVideoInfoFromVP9HeaderParser):
(WebCore::createVideoInfoFromVP8Header):

  • platform/graphics/cocoa/VideoTrackPrivateWebM.cpp:

(WebCore::VideoTrackPrivateWebM::codec const):

  • platform/graphics/filters/FEBlend.cpp:

(WebCore::FEBlend::externalRepresentation const):

  • platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:

(WebCore::GraphicsContextGLOpenGL::validateDepthStencil):

  • platform/ios/QuickLook.h:
  • platform/ios/QuickLook.mm:
  • platform/mediastream/RealtimeMediaSourceCenter.cpp:

(WebCore::RealtimeMediaSourceCenter::hashStringWithSalt):

  • platform/mock/RTCNotifiersMock.cpp:

(WebCore::RemoteDataChannelNotifier::fire):

  • platform/mock/ScrollbarsControllerMock.cpp:

(WebCore::ScrollbarsControllerMock::mouseEnteredContentArea):
(WebCore::ScrollbarsControllerMock::mouseMovedInContentArea):
(WebCore::ScrollbarsControllerMock::mouseExitedContentArea):

  • platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:

(WebCore::mimeTypeCache):

  • platform/network/BlobResourceHandle.cpp:

(WebCore::BlobResourceHandle::loadResourceSynchronously):
(WebCore::BlobResourceHandle::notifyResponseOnError):

  • platform/network/DataURLDecoder.cpp:

(WebCore::DataURLDecoder::DecodeTask::process):

  • platform/network/HTTPParsers.cpp:

(WebCore::parseStructuredFieldValue):
(WebCore::parseHTTPHeader):

  • platform/network/NetworkStorageSession.cpp:

(WebCore::NetworkStorageSession::storageAccessQuirks):

  • platform/network/ParsedContentType.cpp:

(WebCore::ParsedContentType::charset const):

  • platform/network/ResourceResponseBase.cpp:

(WebCore::ResourceResponseBase::filter):

  • platform/network/cf/DNSResolveQueueCFNet.cpp:

(WebCore::DNSResolveQueueCFNet::updateIsUsingProxy):

  • platform/network/cf/SocketStreamHandleImplCFNet.cpp:

(WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
(WebCore::SocketStreamHandleImpl::addCONNECTCredentials):
(WebCore::SocketStreamHandleImpl::readStreamCallback):

  • platform/sql/SQLiteDatabase.cpp:

(WebCore::SQLiteDatabase::authorizerFunction):

  • rendering/RenderAttachment.h:
  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::renderName const):

  • rendering/RenderBlock.h:
  • rendering/RenderButton.h:
  • rendering/RenderCombineText.h:
  • rendering/RenderCounter.cpp:

(WebCore::RenderCounter::renderName const):

  • rendering/RenderCounter.h:
  • rendering/RenderDeprecatedFlexibleBox.cpp:

(WebCore::RenderDeprecatedFlexibleBox::renderName const):

  • rendering/RenderDeprecatedFlexibleBox.h:
  • rendering/RenderDetailsMarker.h:
  • rendering/RenderEmbeddedObject.h:
  • rendering/RenderFileUploadControl.h:
  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::renderName const):

  • rendering/RenderFlexibleBox.h:
  • rendering/RenderFragmentContainer.h:
  • rendering/RenderFragmentContainerSet.h:
  • rendering/RenderFragmentedFlow.h:
  • rendering/RenderFrame.h:
  • rendering/RenderFrameSet.h:
  • rendering/RenderFullScreen.h:
  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::renderName const):

  • rendering/RenderGrid.h:
  • rendering/RenderHTMLCanvas.h:
  • rendering/RenderIFrame.h:
  • rendering/RenderImage.h:
  • rendering/RenderInline.cpp:

(WebCore::RenderInline::renderName const):

  • rendering/RenderInline.h:
  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
(WebCore::RenderLayerBacking::ensureClippingStackLayers):
(WebCore::RenderLayerBacking::updateDescendantClippingLayer):
(WebCore::RenderLayerBacking::updateOverflowControlsLayers):
(WebCore::RenderLayerBacking::updateMaskingLayer):
(WebCore::RenderLayerBacking::updateChildClippingStrategy):
(WebCore::RenderLayerBacking::updateScrollingLayers):

  • rendering/RenderLineBreak.h:
  • rendering/RenderListBox.h:
  • rendering/RenderListItem.h:
  • rendering/RenderListMarker.h:
  • rendering/RenderMedia.h:
  • rendering/RenderMenuList.h:
  • rendering/RenderMeter.h:
  • rendering/RenderModel.h:
  • rendering/RenderMultiColumnFlow.cpp:

(WebCore::RenderMultiColumnFlow::renderName const):

  • rendering/RenderMultiColumnFlow.h:
  • rendering/RenderMultiColumnSet.cpp:

(WebCore::RenderMultiColumnSet::renderName const):

  • rendering/RenderMultiColumnSet.h:
  • rendering/RenderMultiColumnSpannerPlaceholder.cpp:

(WebCore::RenderMultiColumnSpannerPlaceholder::renderName const):

  • rendering/RenderMultiColumnSpannerPlaceholder.h:
  • rendering/RenderObject.cpp:

(WebCore::RenderObject::outputRenderObject const):

  • rendering/RenderObject.h:
  • rendering/RenderProgress.h:
  • rendering/RenderQuote.h:
  • rendering/RenderReplaced.h:
  • rendering/RenderReplica.h:
  • rendering/RenderRuby.h:
  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.h:
  • rendering/RenderScrollbarPart.h:
  • rendering/RenderSlider.h:
  • rendering/RenderTable.h:
  • rendering/RenderTableCell.h:
  • rendering/RenderTableCol.h:
  • rendering/RenderTableRow.h:
  • rendering/RenderTableSection.h:
  • rendering/RenderText.cpp:

(WebCore::RenderText::renderName const):

  • rendering/RenderText.h:
  • rendering/RenderTextControl.h:
  • rendering/RenderTreeAsText.cpp:

(WebCore::getTagName):
(WebCore::RenderTreeAsText::writeRenderObject):

  • rendering/RenderVideo.h:
  • rendering/RenderView.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/RenderMathMLPadded.h:
  • rendering/mathml/RenderMathMLRoot.h:
  • rendering/mathml/RenderMathMLRow.h:
  • rendering/mathml/RenderMathMLScripts.h:
  • rendering/mathml/RenderMathMLSpace.h:
  • rendering/mathml/RenderMathMLToken.h:
  • rendering/mathml/RenderMathMLUnderOver.h:
  • rendering/shapes/ShapeOutsideInfo.cpp:

(WebCore::checkShapeImageOrigin):

  • rendering/style/GridPositionsResolver.cpp:

(WebCore::adjustGridPositionsFromStyle):

  • rendering/svg/LegacyRenderSVGContainer.h:
  • rendering/svg/LegacyRenderSVGRect.h:
  • rendering/svg/LegacyRenderSVGRoot.h:
  • rendering/svg/LegacyRenderSVGShape.h:
  • rendering/svg/RenderSVGContainer.h:
  • rendering/svg/RenderSVGEllipse.h:
  • rendering/svg/RenderSVGForeignObject.h:
  • rendering/svg/RenderSVGGradientStop.h:
  • rendering/svg/RenderSVGHiddenContainer.h:
  • rendering/svg/RenderSVGImage.h:
  • rendering/svg/RenderSVGInline.h:
  • rendering/svg/RenderSVGInlineText.h:
  • rendering/svg/RenderSVGPath.h:
  • rendering/svg/RenderSVGRect.h:
  • rendering/svg/RenderSVGResourceClipper.h:
  • rendering/svg/RenderSVGResourceFilter.h:
  • rendering/svg/RenderSVGResourceFilterPrimitive.h:
  • rendering/svg/RenderSVGResourceLinearGradient.h:
  • rendering/svg/RenderSVGResourceMarker.h:
  • rendering/svg/RenderSVGResourceMasker.h:
  • rendering/svg/RenderSVGResourcePattern.h:
  • rendering/svg/RenderSVGResourceRadialGradient.h:
  • rendering/svg/RenderSVGRoot.h:
  • rendering/svg/RenderSVGShape.h:
  • rendering/svg/RenderSVGTSpan.h:
  • rendering/svg/RenderSVGText.h:
  • rendering/svg/RenderSVGTextPath.h:
  • rendering/svg/RenderSVGViewportContainer.h:
  • rendering/svg/SVGContainerLayout.cpp:

(WebCore::SVGContainerLayout::verifyLayoutLocationConsistency):

  • rendering/svg/SVGRenderTreeAsText.cpp:

(WebCore::TextStreamSeparator::TextStreamSeparator):
(WebCore::writeSVGFillPaintingResource):
(WebCore::writeSVGStrokePaintingResource):
(WebCore::writeStandardPrefix):

  • svg/LinearGradientAttributes.h:

(WebCore::LinearGradientAttributes::LinearGradientAttributes):

  • svg/RadialGradientAttributes.h:

(WebCore::RadialGradientAttributes::RadialGradientAttributes):

  • svg/SVGFitToViewBox.cpp:

(WebCore::SVGFitToViewBox::parseViewBoxGeneric):

  • svg/SVGGeometryElement.cpp:

(WebCore::SVGGeometryElement::parseAttribute):

  • svg/graphics/SVGImage.cpp:

(WebCore::SVGImage::dataChanged):

  • testing/Internals.cpp:

(WebCore::styleValidityToToString):
(WebCore::responseSourceToString):
(WebCore::Internals::openDummyInspectorFrontend):
(WebCore::Internals::elementBufferingPolicy):
(WebCore::Internals::createSleepDisabler):
(WebCore::Internals::loadArtworkImage):

  • testing/InternalsMapLike.cpp:

(WebCore::InternalsMapLike::InternalsMapLike):

  • testing/MockMediaSessionCoordinator.cpp:

(WebCore::MockMediaSessionCoordinator::positionStateChanged):
(WebCore::MockMediaSessionCoordinator::readyStateChanged):
(WebCore::MockMediaSessionCoordinator::playbackStateChanged):
(WebCore::MockMediaSessionCoordinator::trackIdentifierChanged):

  • testing/MockMediaSessionCoordinator.h:
  • testing/MockPageOverlayClient.cpp:

(WebCore::MockPageOverlayClient::layerTreeAsText):

  • testing/MockPaymentCoordinator.cpp:
  • workers/WorkerScriptLoader.cpp:

(WebCore::WorkerScriptLoader::notifyError):

  • workers/service/ServiceWorkerContainer.cpp:

(WebCore::ServiceWorkerContainer::addRegistration):

  • workers/service/server/RegistrationDatabase.cpp:

(WebCore::RegistrationDatabase::ensureValidRecordsTable):
(WebCore::updateViaCacheToString):
(WebCore::workerTypeToString):
(WebCore::RegistrationDatabase::doPushChanges):

  • workers/service/server/SWServer.cpp:

(WebCore::SWServer::scheduleJob):

  • workers/shared/SharedWorker.cpp:

(WebCore::SharedWorker::create):

  • worklets/PaintWorkletGlobalScope.cpp:

(WebCore::PaintWorkletGlobalScope::registerPaint):

  • worklets/WorkletGlobalScope.cpp:

(WebCore::WorkletGlobalScope::userAgent const):

  • xml/XMLErrors.cpp:

(WebCore::XMLErrors::handleError):
(WebCore::XMLErrors::appendErrorMessage):

  • xml/XMLErrors.h:
  • xml/XMLHttpRequest.cpp:

(WebCore::replaceCharsetInMediaTypeIfNeeded):
(WebCore::XMLHttpRequest::setTimeout):
(WebCore::XMLHttpRequest::setResponseType):
(WebCore::XMLHttpRequest::open):
(WebCore::XMLHttpRequest::createDecoder const):

  • xml/XPathParser.cpp:

(WebCore::XPath::Parser::nextTokenInternal):

  • xml/XSLTProcessor.cpp:

(WebCore::XSLTProcessor::transformToFragment):

  • xml/XSLTProcessorLibxslt.cpp:

(WebCore::XSLTProcessor::parseErrorFunc):
(WebCore::docLoaderFunc):
(WebCore::resultMIMEType):
(WebCore::XSLTProcessor::transformToString):

  • xml/parser/XMLDocumentParser.cpp:

(WebCore::XMLDocumentParser::createLeafTextNode):

  • xml/parser/XMLDocumentParserLibxml2.cpp:

(WebCore::openFunc):

Source/WebCore/PAL:

  • pal/Logging.cpp:

(PAL::registerNotifyCallback):

  • pal/Logging.h:
  • pal/system/SleepDisabler.cpp:

(PAL::SleepDisabler::create):
(PAL::SleepDisabler::SleepDisabler):

  • pal/system/SleepDisabler.h:
  • pal/system/cocoa/SleepDisablerCocoa.cpp:

(PAL::SleepDisabler::create):
(PAL::SleepDisablerCocoa::SleepDisablerCocoa):

  • pal/system/cocoa/SleepDisablerCocoa.h:
  • pal/system/glib/SleepDisablerGLib.cpp:

(PAL::SleepDisabler::create):
(PAL::SleepDisablerGLib::SleepDisablerGLib):
(PAL::SleepDisablerGLib::acquireInhibitor):

  • pal/system/glib/SleepDisablerGLib.h:

Source/WebKit:

  • NetworkProcess/NetworkDataTaskBlob.cpp:
  • UIProcess/WebProcessProxy.cpp:

(WebKit::WebProcessProxy::didCreateSleepDisabler):

  • WebProcess/WebProcess.cpp:

(WebKit::WebProcess::initializeWebProcess):

Source/WTF:

  • wtf/text/WTFString.h:

(WTF::equalIgnoringASCIICase):

File size: 18.4 KB
Line 
1/*
2 * Copyright (C) 2012 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS IN..0TERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include "config.h"
27#include "RenderMultiColumnFlow.h"
28
29#include "HitTestResult.h"
30#include "RenderIterator.h"
31#include "RenderLayoutState.h"
32#include "RenderMultiColumnSet.h"
33#include "RenderMultiColumnSpannerPlaceholder.h"
34#include "RenderTreeBuilder.h"
35#include "RenderView.h"
36#include "TransformState.h"
37#include <wtf/IsoMallocInlines.h>
38
39namespace WebCore {
40
41WTF_MAKE_ISO_ALLOCATED_IMPL(RenderMultiColumnFlow);
42
43RenderMultiColumnFlow::RenderMultiColumnFlow(Document& document, RenderStyle&& style)
44 : RenderFragmentedFlow(document, WTFMove(style))
45 , m_spannerMap(makeUnique<SpannerMap>())
46{
47 setFragmentedFlowState(InsideInFragmentedFlow);
48}
49
50RenderMultiColumnFlow::~RenderMultiColumnFlow() = default;
51
52ASCIILiteral RenderMultiColumnFlow::renderName() const
53{
54 return "RenderMultiColumnFlowThread"_s;
55}
56
57RenderMultiColumnSet* RenderMultiColumnFlow::firstMultiColumnSet() const
58{
59 for (RenderObject* sibling = nextSibling(); sibling; sibling = sibling->nextSibling()) {
60 if (is<RenderMultiColumnSet>(*sibling))
61 return downcast<RenderMultiColumnSet>(sibling);
62 }
63 return nullptr;
64}
65
66RenderMultiColumnSet* RenderMultiColumnFlow::lastMultiColumnSet() const
67{
68 ASSERT(multiColumnBlockFlow());
69
70 for (RenderObject* sibling = multiColumnBlockFlow()->lastChild(); sibling; sibling = sibling->previousSibling()) {
71 if (is<RenderMultiColumnSet>(*sibling))
72 return downcast<RenderMultiColumnSet>(sibling);
73 }
74 return nullptr;
75}
76
77RenderBox* RenderMultiColumnFlow::firstColumnSetOrSpanner() const
78{
79 if (RenderObject* sibling = nextSibling()) {
80 ASSERT(is<RenderBox>(*sibling));
81 ASSERT(is<RenderMultiColumnSet>(*sibling) || findColumnSpannerPlaceholder(downcast<RenderBox>(sibling)));
82 return downcast<RenderBox>(sibling);
83 }
84 return nullptr;
85}
86
87RenderBox* RenderMultiColumnFlow::nextColumnSetOrSpannerSiblingOf(const RenderBox* child)
88{
89 return child ? child->nextSiblingBox() : nullptr;
90}
91
92RenderBox* RenderMultiColumnFlow::previousColumnSetOrSpannerSiblingOf(const RenderBox* child)
93{
94 if (!child)
95 return nullptr;
96 if (auto* sibling = child->previousSiblingBox()) {
97 if (!is<RenderFragmentedFlow>(*sibling))
98 return sibling;
99 }
100 return nullptr;
101}
102
103RenderMultiColumnSpannerPlaceholder* RenderMultiColumnFlow::findColumnSpannerPlaceholder(RenderBox* spanner) const
104{
105 return m_spannerMap->get(spanner).get();
106}
107
108void RenderMultiColumnFlow::layout()
109{
110 ASSERT(!m_inLayout);
111 m_inLayout = true;
112 m_lastSetWorkedOn = nullptr;
113 if (RenderBox* first = firstColumnSetOrSpanner()) {
114 if (is<RenderMultiColumnSet>(*first)) {
115 m_lastSetWorkedOn = downcast<RenderMultiColumnSet>(first);
116 m_lastSetWorkedOn->beginFlow(this);
117 }
118 }
119 RenderFragmentedFlow::layout();
120 if (RenderMultiColumnSet* lastSet = lastMultiColumnSet()) {
121 if (!nextColumnSetOrSpannerSiblingOf(lastSet))
122 lastSet->endFlow(this, logicalHeight());
123 lastSet->expandToEncompassFragmentedFlowContentsIfNeeded();
124 }
125 m_inLayout = false;
126 m_lastSetWorkedOn = nullptr;
127}
128
129void RenderMultiColumnFlow::addFragmentToThread(RenderFragmentContainer* fragmentContainer)
130{
131 auto* columnSet = downcast<RenderMultiColumnSet>(fragmentContainer);
132 if (RenderMultiColumnSet* nextSet = columnSet->nextSiblingMultiColumnSet()) {
133 RenderFragmentContainerList::iterator it = m_fragmentList.find(nextSet);
134 ASSERT(it != m_fragmentList.end());
135 m_fragmentList.insertBefore(it, columnSet);
136 } else
137 m_fragmentList.add(columnSet);
138 fragmentContainer->setIsValid(true);
139}
140
141void RenderMultiColumnFlow::willBeRemovedFromTree(IsInternalMove isInternalMove)
142{
143 // Detach all column sets from the flow thread. Cannot destroy them at this point, since they
144 // are siblings of this object, and there may be pointers to this object's sibling somewhere
145 // further up on the call stack.
146 for (RenderMultiColumnSet* columnSet = firstMultiColumnSet(); columnSet; columnSet = columnSet->nextSiblingMultiColumnSet())
147 columnSet->detachFragment();
148 RenderFragmentedFlow::willBeRemovedFromTree(isInternalMove);
149}
150
151void RenderMultiColumnFlow::fragmentedFlowDescendantBoxLaidOut(RenderBox* descendant)
152{
153 if (!is<RenderMultiColumnSpannerPlaceholder>(*descendant))
154 return;
155 auto& placeholder = downcast<RenderMultiColumnSpannerPlaceholder>(*descendant);
156 RenderBlock* container = placeholder.containingBlock();
157
158 for (RenderBox* prev = previousColumnSetOrSpannerSiblingOf(placeholder.spanner()); prev; prev = previousColumnSetOrSpannerSiblingOf(prev)) {
159 if (is<RenderMultiColumnSet>(*prev)) {
160 downcast<RenderMultiColumnSet>(*prev).endFlow(container, placeholder.logicalTop());
161 break;
162 }
163 }
164
165 for (RenderBox* next = nextColumnSetOrSpannerSiblingOf(placeholder.spanner()); next; next = nextColumnSetOrSpannerSiblingOf(next)) {
166 if (is<RenderMultiColumnSet>(*next)) {
167 m_lastSetWorkedOn = downcast<RenderMultiColumnSet>(next);
168 m_lastSetWorkedOn->beginFlow(container);
169 break;
170 }
171 }
172}
173
174RenderBox::LogicalExtentComputedValues RenderMultiColumnFlow::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop) const
175{
176 // We simply remain at our intrinsic height.
177 return { logicalHeight, logicalTop, ComputedMarginValues() };
178}
179
180LayoutUnit RenderMultiColumnFlow::initialLogicalWidth() const
181{
182 return columnWidth();
183}
184
185void RenderMultiColumnFlow::setPageBreak(const RenderBlock* block, LayoutUnit offset, LayoutUnit spaceShortage)
186{
187 if (auto* multicolSet = downcast<RenderMultiColumnSet>(fragmentAtBlockOffset(block, offset)))
188 multicolSet->recordSpaceShortage(spaceShortage);
189}
190
191void RenderMultiColumnFlow::updateMinimumPageHeight(const RenderBlock* block, LayoutUnit offset, LayoutUnit minHeight)
192{
193 if (auto* multicolSet = downcast<RenderMultiColumnSet>(fragmentAtBlockOffset(block, offset)))
194 multicolSet->updateMinimumColumnHeight(minHeight);
195}
196
197void RenderMultiColumnFlow::updateSpaceShortageForSizeContainment(const RenderBlock* block, LayoutUnit offset, LayoutUnit shortage)
198{
199 if (auto* multicolSet = downcast<RenderMultiColumnSet>(fragmentAtBlockOffset(block, offset)))
200 multicolSet->updateSpaceShortageForSizeContainment(shortage);
201}
202
203RenderFragmentContainer* RenderMultiColumnFlow::fragmentAtBlockOffset(const RenderBox* box, LayoutUnit offset, bool extendLastFragment) const
204{
205 if (!m_inLayout)
206 return RenderFragmentedFlow::fragmentAtBlockOffset(box, offset, extendLastFragment);
207
208 // Layout in progress. We are calculating the set heights as we speak, so the fragment range
209 // information is not up-to-date.
210
211 RenderMultiColumnSet* columnSet = m_lastSetWorkedOn ? m_lastSetWorkedOn : firstMultiColumnSet();
212 if (!columnSet) {
213 // If there's no set, bail. This multicol is empty or only consists of spanners. There
214 // are no fragments.
215 return nullptr;
216 }
217 // The last set worked on is a good guess. But if we're not within the bounds, search for the
218 // right one.
219 if (offset < columnSet->logicalTopInFragmentedFlow()) {
220 do {
221 if (RenderMultiColumnSet* prev = columnSet->previousSiblingMultiColumnSet())
222 columnSet = prev;
223 else
224 break;
225 } while (offset < columnSet->logicalTopInFragmentedFlow());
226 } else {
227 while (offset >= columnSet->logicalBottomInFragmentedFlow()) {
228 RenderMultiColumnSet* next = columnSet->nextSiblingMultiColumnSet();
229 if (!next || !next->hasBeenFlowed())
230 break;
231 columnSet = next;
232 }
233 }
234 return columnSet;
235}
236
237void RenderMultiColumnFlow::setFragmentRangeForBox(const RenderBox& box, RenderFragmentContainer* startFragment, RenderFragmentContainer* endFragment)
238{
239 // Some column sets may have zero height, which means that two or more sets may start at the
240 // exact same flow thread position, which means that some parts of the code may believe that a
241 // given box lives in sets that it doesn't really live in. Make some adjustments here and
242 // include such sets if they are adjacent to the start and/or end fragments.
243 for (RenderMultiColumnSet* columnSet = downcast<RenderMultiColumnSet>(*startFragment).previousSiblingMultiColumnSet(); columnSet; columnSet = columnSet->previousSiblingMultiColumnSet()) {
244 if (columnSet->logicalHeightInFragmentedFlow())
245 break;
246 startFragment = columnSet;
247 }
248 for (RenderMultiColumnSet* columnSet = downcast<RenderMultiColumnSet>(*startFragment).nextSiblingMultiColumnSet(); columnSet; columnSet = columnSet->nextSiblingMultiColumnSet()) {
249 if (columnSet->logicalHeightInFragmentedFlow())
250 break;
251 endFragment = columnSet;
252 }
253
254 RenderFragmentedFlow::setFragmentRangeForBox(box, startFragment, endFragment);
255}
256
257bool RenderMultiColumnFlow::addForcedFragmentBreak(const RenderBlock* block, LayoutUnit offset, RenderBox* /*breakChild*/, bool /*isBefore*/, LayoutUnit* offsetBreakAdjustment)
258{
259 if (auto* multicolSet = downcast<RenderMultiColumnSet>(fragmentAtBlockOffset(block, offset))) {
260 multicolSet->addForcedBreak(offset);
261 if (offsetBreakAdjustment)
262 *offsetBreakAdjustment = pageLogicalHeightForOffset(offset) ? pageRemainingLogicalHeightForOffset(offset, IncludePageBoundary) : 0_lu;
263 return true;
264 }
265 return false;
266}
267
268LayoutSize RenderMultiColumnFlow::offsetFromContainer(RenderElement& enclosingContainer, const LayoutPoint& physicalPoint, bool* offsetDependsOnPoint) const
269{
270 ASSERT(&enclosingContainer == container());
271
272 if (offsetDependsOnPoint)
273 *offsetDependsOnPoint = true;
274
275 LayoutPoint translatedPhysicalPoint(physicalPoint);
276 if (RenderFragmentContainer* fragment = physicalTranslationFromFlowToFragment(translatedPhysicalPoint))
277 translatedPhysicalPoint.moveBy(fragment->topLeftLocation());
278
279 LayoutSize offset(translatedPhysicalPoint.x(), translatedPhysicalPoint.y());
280 if (is<RenderBox>(enclosingContainer))
281 offset -= toLayoutSize(downcast<RenderBox>(enclosingContainer).scrollPosition());
282 return offset;
283}
284
285void RenderMultiColumnFlow::mapAbsoluteToLocalPoint(OptionSet<MapCoordinatesMode> mode, TransformState& transformState) const
286{
287 // First get the transform state's point into the block flow thread's physical coordinate space.
288 parent()->mapAbsoluteToLocalPoint(mode, transformState);
289 LayoutPoint transformPoint(transformState.mappedPoint());
290
291 // Now walk through each fragment.
292 const RenderMultiColumnSet* candidateColumnSet = nullptr;
293 LayoutPoint candidatePoint;
294 LayoutSize candidateContainerOffset;
295
296 for (const auto& columnSet : childrenOfType<RenderMultiColumnSet>(*parent())) {
297 candidateContainerOffset = columnSet.offsetFromContainer(*parent(), LayoutPoint());
298
299 candidatePoint = transformPoint - candidateContainerOffset;
300 candidateColumnSet = &columnSet;
301
302 // We really have no clue what to do with overflow. We'll just use the closest fragment to the point in that case.
303 LayoutUnit pointOffset = isHorizontalWritingMode() ? candidatePoint.y() : candidatePoint.x();
304 LayoutUnit fragmentOffset = isHorizontalWritingMode() ? columnSet.topLeftLocation().y() : columnSet.topLeftLocation().x();
305 if (pointOffset < fragmentOffset + columnSet.logicalHeight())
306 break;
307 }
308
309 // Once we have a good guess as to which fragment we hit tested through (and yes, this was just a heuristic, but it's
310 // the best we could do), then we can map from the fragment into the flow thread.
311 LayoutSize translationOffset = physicalTranslationFromFragmentToFlow(candidateColumnSet, candidatePoint) + candidateContainerOffset;
312 bool preserve3D = mode.contains(UseTransforms) && (parent()->style().preserves3D() || style().preserves3D());
313 if (mode.contains(UseTransforms) && shouldUseTransformFromContainer(parent())) {
314 TransformationMatrix t;
315 getTransformFromContainer(parent(), translationOffset, t);
316 transformState.applyTransform(t, preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
317 } else
318 transformState.move(translationOffset.width(), translationOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
319}
320
321LayoutSize RenderMultiColumnFlow::physicalTranslationFromFragmentToFlow(const RenderMultiColumnSet* columnSet, const LayoutPoint& physicalPoint) const
322{
323 LayoutPoint logicalPoint = columnSet->flipForWritingMode(physicalPoint);
324 LayoutPoint translatedPoint = columnSet->translateFragmentPointToFragmentedFlow(logicalPoint);
325 LayoutPoint physicalTranslatedPoint = columnSet->flipForWritingMode(translatedPoint);
326 return physicalPoint - physicalTranslatedPoint;
327}
328
329RenderFragmentContainer* RenderMultiColumnFlow::mapFromFlowToFragment(TransformState& transformState) const
330{
331 if (!hasValidFragmentInfo())
332 return nullptr;
333
334 // Get back into our local flow thread space.
335 LayoutRect boxRect = transformState.mappedQuad().enclosingBoundingBox();
336 flipForWritingMode(boxRect);
337
338 // FIXME: We need to refactor RenderObject::absoluteQuads to be able to split the quads across fragments,
339 // for now we just take the center of the mapped enclosing box and map it to a column.
340 LayoutPoint centerPoint = boxRect.center();
341 LayoutUnit centerLogicalOffset = isHorizontalWritingMode() ? centerPoint.y() : centerPoint.x();
342 auto* fragmentContainer = fragmentAtBlockOffset(this, centerLogicalOffset, true);
343 if (!fragmentContainer)
344 return nullptr;
345 transformState.move(physicalTranslationOffsetFromFlowToFragment(fragmentContainer, centerLogicalOffset));
346 return fragmentContainer;
347}
348
349LayoutSize RenderMultiColumnFlow::physicalTranslationOffsetFromFlowToFragment(const RenderFragmentContainer* fragmentContainer, const LayoutUnit logicalOffset) const
350{
351 // Now that we know which multicolumn set we hit, we need to get the appropriate translation offset for the column.
352 const auto* columnSet = downcast<RenderMultiColumnSet>(fragmentContainer);
353 LayoutPoint translationOffset = columnSet->columnTranslationForOffset(logicalOffset);
354
355 // Now we know how we want the rect to be translated into the fragment. At this point we're converting
356 // back to physical coordinates.
357 if (style().isFlippedBlocksWritingMode()) {
358 LayoutRect portionRect(columnSet->fragmentedFlowPortionRect());
359 LayoutRect columnRect = columnSet->columnRectAt(0);
360 LayoutUnit physicalDeltaFromPortionBottom = logicalHeight() - columnSet->logicalBottomInFragmentedFlow();
361 if (isHorizontalWritingMode())
362 columnRect.setHeight(portionRect.height());
363 else
364 columnRect.setWidth(portionRect.width());
365 columnSet->flipForWritingMode(columnRect);
366 if (isHorizontalWritingMode())
367 translationOffset.move(0_lu, columnRect.y() - portionRect.y() - physicalDeltaFromPortionBottom);
368 else
369 translationOffset.move(columnRect.x() - portionRect.x() - physicalDeltaFromPortionBottom, 0_lu);
370 }
371
372 return LayoutSize(translationOffset.x(), translationOffset.y());
373}
374
375RenderFragmentContainer* RenderMultiColumnFlow::physicalTranslationFromFlowToFragment(LayoutPoint& physicalPoint) const
376{
377 if (!hasValidFragmentInfo())
378 return nullptr;
379
380 // Put the physical point into the flow thread's coordinate space.
381 LayoutPoint logicalPoint = flipForWritingMode(physicalPoint);
382
383 // Now get the fragment that we are in.
384 LayoutUnit logicalOffset = isHorizontalWritingMode() ? logicalPoint.y() : logicalPoint.x();
385 RenderFragmentContainer* fragmentContainer = fragmentAtBlockOffset(this, logicalOffset, true);
386 if (!fragmentContainer)
387 return nullptr;
388
389 // Translate to the coordinate space of the fragment.
390 LayoutSize translationOffset = physicalTranslationOffsetFromFlowToFragment(fragmentContainer, logicalOffset);
391
392 // Now shift the physical point into the fragment's coordinate space.
393 physicalPoint += translationOffset;
394
395 return fragmentContainer;
396}
397
398bool RenderMultiColumnFlow::isPageLogicalHeightKnown() const
399{
400 if (RenderMultiColumnSet* columnSet = lastMultiColumnSet())
401 return columnSet->columnHeightComputed();
402 return false;
403}
404
405bool RenderMultiColumnFlow::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction hitTestAction)
406{
407 // You cannot be inside an in-flow RenderFragmentedFlow without a corresponding DOM node. It's better to
408 // just let the ancestor figure out where we are instead.
409 if (hitTestAction == HitTestBlockBackground)
410 return false;
411 bool inside = RenderFragmentedFlow::nodeAtPoint(request, result, locationInContainer, accumulatedOffset, hitTestAction);
412 if (inside && !result.innerNode())
413 return false;
414 return inside;
415}
416
417bool RenderMultiColumnFlow::shouldCheckColumnBreaks() const
418{
419 if (!parent()->isRenderView())
420 return true;
421 return view().frameView().pagination().behavesLikeColumns;
422}
423
424}
Note: See TracBrowser for help on using the repository browser.