2017-11-20 Mario Sanchez Prada [GTK] New API to add, retrieve and delete cookies via WebKitCookieManager https://bugs.webkit.org/show_bug.cgi?id=177932 Reviewed by Carlos Garcia Campos. Implemented setCookie(), getCookies() and deleteCookie() in the Soup backend, and refactored some utility functions and conversions out of NetworkStorageSessionSoup into a new CookieSoup.cpp file, so that we now can convert between SoupCookie* and WebCore::Cookie easily from anywhere (this is now needed from the UI Process). * platform/Cookie.h: Add declarations for the new conversions. * platform/SourcesSoup.txt: Add CookieSoup.cpp. * platform/network/soup/CookieSoup.cpp: Added. (WebCore::Cookie::Cookie): New constructor, creates a WebCore::Cookie out of a SoupCookie*. (WebCore::msToSoupDate): Moved from NetworkStorageSessionSoup.cpp. (WebCore::Cookie::toSoupCookie): New, based on toSoupCookie() from NetworkStorageSessionSoup.cpp. * platform/network/soup/NetworkStorageSessionSoup.cpp: (WebCore::NetworkStorageSession::setCookies): Used the new implicit conversion. (WebCore::NetworkStorageSession::setCookie): Newly implemented. (WebCore::NetworkStorageSession::deleteCookie): Newly implemented. (WebCore::NetworkStorageSession::getCookies): Newly implemented. 2017-11-20 Zalan Bujtas Remove slow repaint object from FrameView when style changes. https://bugs.webkit.org/show_bug.cgi?id=179871 Reviewed by Antti Koivisto. The "oldStyleSlowScroll" value does not need to be computed. We already know its value by checking the HashSet. This code is also unnecessarily complicated and error prone (could lead to UAF errors by leaving stale renderers in the slow paint list). Test: fast/repaint/slow-repaint-object-crash.html * rendering/RenderElement.cpp: (WebCore::RenderElement::styleWillChange): 2017-11-20 Carlos Alberto Lopez Perez [WPE] GLContextEGLWPE.cpp:44:96: error: invalid cast from type ‘GLNativeWindowType {aka long long unsigned int}’ to type ‘EGLNativeWindowType {aka unsigned int} https://bugs.webkit.org/show_bug.cgi?id=179511 Reviewed by Žan Doberšek. r217208 changed the definition of GLNativeWindowType from EGLNativeWindowType to uint64_t for platform WPE. This built fine on a 64-bit platform since uint64_t matches the size of a pointer, but fails on 32-bits. This switches back the definition to EGLNativeWindowType. And we need to include first in order to get a definition for EGLNativeWindowType itself. This commit pretty much reverts the changes r217208 did on platform/graphics/GLContext.h No new tests, it is a build fix. * platform/graphics/GLContext.h: 2017-11-20 Michael Catanzaro Remove ENABLE_ALLINONE_BUILD option https://bugs.webkit.org/show_bug.cgi?id=179823 Reviewed by Darin Adler. * CMakeLists.txt: 2017-11-20 Emilio Cobos Álvarez Incorrect computed style in pseudo-elements with display: contents https://bugs.webkit.org/show_bug.cgi?id=179812 Reviewed by Antti Koivisto. Bug 178513 gave them an anon renderer as the main renderer. Unfortunately, the style of that box is exposed via getComputedStyle, so that needs to be handled somehow to return the correct style. Tests: imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::styledRenderer const): Don't return a display: contents pseudo anon box. * dom/Element.cpp: (WebCore::Element::hasDisplayContents const): Just look at the rare data style. (WebCore::Element::existingComputedStyle const): Look at the rare data first. This also fixes an inefficiency in the sense that before then we'd compare the anon box style to the pseudo-element style during style update, that may be more changes than needed. * style/RenderTreeUpdaterGeneratedContent.cpp: (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement): * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::resolvePseudoStyle): Move the anon box creation to render tree update instead of style resolution. 2017-11-19 Tim Horton Remove unused TOUCH_ICON_LOADING feature flag https://bugs.webkit.org/show_bug.cgi?id=179873 Reviewed by Simon Fraser. * Configurations/FeatureDefines.xcconfig: 2017-11-19 Tim Horton Remove unused LEGACY_VENDOR_PREFIXES feature flag https://bugs.webkit.org/show_bug.cgi?id=179872 Reviewed by Darin Adler. * Configurations/FeatureDefines.xcconfig: 2017-11-18 Darin Adler Eliminate some cases of double hashing, other related refactoring https://bugs.webkit.org/show_bug.cgi?id=179867 Reviewed by Sam Weinig. * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::objectStore): Use get instead of find. * Modules/mediasource/MediaSourceRegistry.cpp: (WebCore::MediaSourceRegistry::unregisterURL): Use take instead of find/remove. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::~AXObjectCache): Call setAXObjectID instead of using the removeAXID, which doesn't do anything else useful in the destructor. (WebCore::AXObjectCache::remove): Use take instead of get/remove. Also rearrange logic to eliminate the removeAXID function. (WebCore::AXObjectCache::removeAXID): Deleted. This only did two things, setAXObjectID(0) and remove from m_idsInUse, and was only called in one place besides the destructor. Clearer to not have this funtion. (WebCore::AXObjectCache::visiblePositionForTextMarkerData): Use m_idsInUse directly instead of using a function. * accessibility/AXObjectCache.h: Deleted removeAXID and isIDinUse. * dom/Document.cpp: (WebCore::Document::removedLastRef): Call UserActionElementSet::clear instead of UserActionElementSet::documentDidRemoveLastRef; new name fo the same function. (WebCore::Document::updateHoverActiveState): Use a reference when calling setInActiveChain. * dom/Element.cpp: (WebCore::Element::isUserActionElementInActiveChain const): Pass reference instead of pointer. (WebCore::Element::isUserActionElementActive const): Ditto. (WebCore::Element::isUserActionElementFocused const): Ditto. (WebCore::Element::isUserActionElementHovered const): Ditto. (WebCore::Element::setActive): Ditto. (WebCore::Element::setFocus): Ditto. (WebCore::Element::setHovered): Ditto. (WebCore::Element::clearHoverAndActiveStatusBeforeDetachingRenderer): Ditto. * dom/GenericEventQueue.cpp: (WebCore::GenericEventQueue::resume): Removed unneeded speical case for empty vector. * dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::checkStyleSheet): Updated now that parseAttributes returns an optional instead of using a boolean "OK" out argument. * dom/SelectorQuery.cpp: (WebCore::SelectorQueryCache::add): Use get instead of find. * dom/UserActionElementSet.cpp: (WebCore::UserActionElementSet::didDetach): Deleted. Moved to class definition and named clearActiveAndHovered. (WebCore::UserActionElementSet::clear): Renamed documentDidRemoveLastRef to clear. (WebCore::UserActionElementSet::hasFlag const): Renamed from hasFlags and also take reference and enumeration instead of pointer and unsigned. Makes it clearer this does not allow null and that it works on a single flag, not a set of flags. (WebCore::UserActionElementSet::clearFlags): Changed argument types to reference and OptionSet to make it clear this works on a set of flags. (WebCore::UserActionElementSet::setFlags): Ditto. * dom/UserActionElementSet.h: Updated for changes above. Also made some name changes, and used an enum class instead of an enum. * html/BaseCheckableInputType.cpp: (WebCore::BaseCheckableInputType::saveFormControlState const): Updated since FormControlState is now just a vector, not a class. * html/FileInputType.cpp: (WebCore::FileInputType::filesFromFormControlState): Ditto. (WebCore::FileInputType::restoreFormControlState): Removed unneeded check that valueSize is a multiple of 2. Code will ignore any extra strings at the end, so there is no need for the validity check. * html/FormController.cpp: (WebCore::serializeFormControlStateTo): Made a non-member function since FormControlState is now just a vector, not a class. (WebCore::deserializeFormControlState): Ditto. Also return optional instead of relying on a special failure state. (WebCore::SavedFormState::deserialize): Updated for above changes. (WebCore::SavedFormState::serializeTo const): Ditto. (WebCore::SavedFormState::appendControlState): Use add instead of both find and add to avoid double hashing. (WebCore::SavedFormState::takeControlState): Removed unneeded check for empty hash table and tweaked coding style. (WebCore::SavedFormState::referencedFilePaths const): Renamed to remove "get". (WebCore::FormKeyGenerator::formKey): Use ensure instead of find and add. (WebCore::FormController::formElementsCharacterCount const): Don't call saveFormControlState for non-text-form-controls since we ignored those values. (WebCore::FormController::willDeleteForm): Take a reference. (WebCore::FormController::restoreControlStateFor): Update since FormControlState is now a vector. (WebCore::FormController::restoreControlStateIn): Use is/downcast and update since FormControlState is now a vector. (WebCore::FormController::referencedFilePaths): Renamed to remove "get". (WebCore::FormController::registerFormElementWithState):Take a reference. (WebCore::FormController::unregisterFormElementWithState): Ditto. * html/FormController.h: Removed FormControlState class since it was just a Vector with various unneeded features, such as a "failure" state, and a never-looked-at type of "skip" or "restore". Updated for other changes above. * html/HTMLFormControlElementWithState.cpp: (WebCore::HTMLFormControlElementWithState::insertedIntoAncestor): Pass reference. (WebCore::HTMLFormControlElementWithState::removedFromAncestor): Ditto. * html/HTMLFormControlElementWithState.h: Updated for the above. Also added support for using is/downcast on this. * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::~HTMLFormElement): Pass reference. * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::saveFormControlState const): Use reserveInitialCapacit and uncheckedAppend. (WebCore::HTMLSelectElement::restoreFormControlState): Updated since state is now a vector. * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::saveFormControlState const): Ditto. * html/HiddenInputType.cpp: (WebCore::HiddenInputType::saveFormControlState const): Ditto. * html/InputType.cpp: (WebCore::InputType::saveFormControlState const): Ditto. * inspector/agents/InspectorCSSAgent.cpp: (WebCore::InspectorCSSAgent::forcePseudoState): Use get instead of find/end and got rid of uneeded special case. In another overload, ue add and remove instead of a find followed by a set or a remove. (WebCore::InspectorCSSAgent::asInspectorStyleSheet): Use ensure instead of find/set. (WebCore::InspectorCSSAgent::didRemoveDOMNode): Use take instead of find/remove. (WebCore::InspectorCSSAgent::didModifyDOMAttr): Use get instead of find. * inspector/agents/InspectorCSSAgent.h: Removed unneeded NodeToInspectorStyleSheet typedef and changed value type to Ref instead of RefPtr. * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::unbind): Use remove instead of contains/remove. (WebCore::InspectorDOMAgent::nodeForId): Use isValidKey instead of just checking for 0 and use get instead of find. (WebCore::InspectorDOMAgent::setAttributesAsText): Take out bogus const. (WebCore::InspectorDOMAgent::moveTo): Ditto. (WebCore::InspectorDOMAgent::resolveNode): Ditto. (WebCore::InspectorDOMAgent::isWhitespace): Added FIXME. Use is instead of slower nodeType. * inspector/agents/InspectorDOMAgent.h: Removed bogus const. * inspector/agents/InspectorLayerTreeAgent.cpp: (WebCore::InspectorLayerTreeAgent::bind): Use ensure instead of get/set. (WebCore::InspectorLayerTreeAgent::unbind): Use take instead of find/remove. (WebCore::InspectorLayerTreeAgent::bindPseudoElement): Use ensure instead of get/set. (WebCore::InspectorLayerTreeAgent::unbindPseudoElement): Use take instead of find/remove. * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::getCookies): Use add instead of contains/add. (WebCore::InspectorPageAgent::frameDetached): Use take instead of find/remove. (WebCore::InspectorPageAgent::frameId): Use ensure instead of get/set. (WebCore::InspectorPageAgent::loaderId): Use ensure instead of get/set. (WebCore::InspectorPageAgent::findFrameWithSecurityOrigin): Got rid of unneeded local variable. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::sessionID const): Tweaked coding style and added a null check for page. (WebCore::CachedResourceLoader::requestResource): Call page directly on the frame instead of first getting the main frame. Also use take instead of find/remove. (WebCore::CachedResourceLoader::removeCachedResource): Rewrite assertion. * platform/graphics/FontGenericFamilies.cpp: (WebCore::setGenericFontFamilyForScript): Use remove instead of find/remove. Simplified the logic a bit in the add case. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::pauseAnimation): Use add instead of find/add. Removed code that said "if (action != Remove) action = Pause" since that is a no-op; there are only two actions, Remove and Pause. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::mediaControlsScript): Use makeString instead of StringBuilder. (WebCore::RenderThemeMac::systemColor const): Rewrote to use ensure instead of add. Also crunched the code a little. * testing/Internals.cpp: (WebCore::Internals::getReferencedFilePaths const): Updated function name. * xml/parser/XMLDocumentParser.h: Updated for change below. * xml/parser/XMLDocumentParserLibxml2.cpp: (WebCore::attributesStartElementNsHandler): Updated to use std::optional instead of a separate boolean for AttributeParseState. (WebCore::parseAttributes): Ditto. Also changed the return value to work the same way. 2017-11-19 Sam Weinig Clean up gradient code in preparation for conic gradients https://bugs.webkit.org/show_bug.cgi?id=179595 Reviewed by Darin Adler. - Switches Gradient to use a Varient with type specific data structs and makes the points / radii immutable. - Replaces CSSGradientValue::addStops with template function CSSGradientValue::computeStops which dispatches to a helper adoptor struct which is passed in for gradient type specific values, rather than switching on type in the function itself. In addition, the function no longer mutates a Gradient, but rather mutates type specific the data struct (e.g. Linear or Radial for now). * css/CSSGradientValue.cpp: (WebCore::LinearGradientAdaptor::LinearGradientAdaptor): (WebCore::RadialGradientAdaptor::RadialGradientAdaptor): Add helper structs for the now templatized CSSGradientValue::computeStops that implement type specific functionality. (WebCore::CSSGradientValue::computeStops): Renamed from addStops. Now takes a GradientAdaptor wrapper which abstracts out the gradient type specific functionlity. (WebCore::CSSLinearGradientValue::createGradient): (WebCore::CSSRadialGradientValue::createGradient): (WebCore::CSSConicGradientValue::createGradient): Update to call computeStops and use new Gradient create function. * css/CSSGradientValue.h: Update for new signature for computeStops. * html/canvas/CanvasGradient.cpp: (WebCore::CanvasGradient::CanvasGradient): Update to use new Gradient create function. * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildArrayForCanvasGradient): Update to get gradient point / radii information from the data accessor. * platform/graphics/Gradient.cpp: (WebCore::Gradient::Gradient): Update constructors to the new data structs. (WebCore::Gradient::type const): Add helper to get the type of the varient, need for inspector code. (WebCore::Gradient::adjustParametersForTiledDrawing): (WebCore::Gradient::isZeroSize const): (WebCore::Gradient::hash const): Update to switch on the underlying variant to get data values. (WebCore::Gradient::addColorStop): Simplify by having one addColorStop call the other. (WebCore::Gradient::setSortedColorStops): Added. Replaces setStopsSorted. Used now that CSSGradientValue computes and sorts its color stops before creating the gradient. * platform/graphics/Gradient.h: (WebCore::Gradient::create): Replace create functions with ones that take data structs. (WebCore::Gradient::data const): Add accessor for the underlying variant. (WebCore::Gradient::isRadial const): Deleted. Replaced by type accessor. (WebCore::Gradient::p0 const): Deleted. (WebCore::Gradient::p1 const): Deleted. (WebCore::Gradient::setP0): Deleted. (WebCore::Gradient::setP1): Deleted. (WebCore::Gradient::startRadius const): Deleted. (WebCore::Gradient::endRadius const): Deleted. (WebCore::Gradient::setStartRadius): Deleted. (WebCore::Gradient::setEndRadius): Deleted. Point and radii are now immutable. (WebCore::Gradient::setStopsSorted): Deleted. Replaced by setSortedColorStops function. * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::fillRect): Pass the GraphicsContext by reference. * platform/graphics/cairo/GradientCairo.cpp: (WebCore::Gradient::createPlatformGradient): Update to switch on the underlying variant to get data values. (WebCore::Gradient::fill): Pass the GraphicsContext by reference. * platform/graphics/cg/GradientCG.cpp: (WebCore::Gradient::platformDestroy): Use nullptr. (WebCore::Gradient::fill): Pass the GraphicsContext by reference. (WebCore::Gradient::paint): Update to switch on the underlying variant to get data values. * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::fillPath): (WebCore::GraphicsContext::strokePath): (WebCore::GraphicsContext::fillRect): (WebCore::GraphicsContext::strokeRect): Pass the GraphicsContext by reference. * platform/graphics/win/GradientDirect2D.cpp: (WebCore::Gradient::generateGradient): Update to switch on the underlying variant to get data values. (WebCore::Gradient::fill): Pass the GraphicsContext by reference. * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintProgressBar): * rendering/svg/RenderSVGResourceLinearGradient.cpp: (WebCore::RenderSVGResourceLinearGradient::buildGradient const): * rendering/svg/RenderSVGResourceRadialGradient.cpp: (WebCore::RenderSVGResourceRadialGradient::buildGradient const): Update for new Gradient create function signature. 2017-11-19 Simon Fraser Use TypedArrayView's setRange() in FETurbulence https://bugs.webkit.org/show_bug.cgi?id=179878 Reviewed by Sam Weinig. Writing the 4 component values at once makes the function about 10% faster. * platform/graphics/filters/FETurbulence.cpp: (WebCore::FETurbulence::fillRegion const): 2017-11-18 Chris Dumez ASSERTION FAILED: registration in WebCore::SWServerJobQueue::scriptContextStarted(ServiceWorkerIdentifier) https://bugs.webkit.org/show_bug.cgi?id=179846 Reviewed by Darin Adler. We have seen crashes on the bots in SWServerJobQueue because methods such as scriptContextStarted() can get called after the jobQueue has been cleared. This is because when a jobQueue is cleared, an asynchronous operation may be pending (e.g. script fetch, service worker starting, install event). To address the issue, we now pass the identifier of the job that started the asynchronous operation when calling the methods on SWServerJobQueue. If the identifier does not match the identifier of the current job in the JobQueue, we ignore it. This patch also starts using a strongly typed identifier (ServiceWorkerJobIdentifier) for ServiceWorkerJob, instead of a uint64_t. It also introduces a ServiceWorkerJobDataIdentifier type which contains both a SWServerConnectionIdentifier and a ServiceWorkerJobIdentifier. This is useful because ServiceWorkerJobData is passed to the StorageProcess and it needs a globally unique identifier. ServiceWorkerJobIdentifier is only guaranteed to be unique within a single WebProcess. Augmenting it with the SWServerConnectionIdentifier of the WebProcess makes it globally unique. No new tests, unskipped exiting test. * WebCore.xcodeproj/project.pbxproj: * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::scheduleJob): (WebCore::ServiceWorkerContainer::startScriptFetchForJob): (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript): (WebCore::ServiceWorkerContainer::jobFailedLoadingScript): (WebCore::ServiceWorkerContainer::jobDidFinish): * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerContextData.cpp: (WebCore::ServiceWorkerContextData::isolatedCopy const): * workers/service/ServiceWorkerContextData.h: (WebCore::ServiceWorkerContextData::encode const): (WebCore::ServiceWorkerContextData::decode): * workers/service/ServiceWorkerFetchResult.h: (WebCore::ServiceWorkerFetchResult::encode const): (WebCore::ServiceWorkerFetchResult::decode): * workers/service/ServiceWorkerJob.h: (WebCore::ServiceWorkerJob::identifier const): * workers/service/ServiceWorkerJobData.cpp: (WebCore::ServiceWorkerJobData::ServiceWorkerJobData): (WebCore::ServiceWorkerJobData::isolatedCopy const): * workers/service/ServiceWorkerJobData.h: (WebCore::ServiceWorkerJobData::connectionIdentifier const): (WebCore::ServiceWorkerJobData::identifier const): (WebCore::ServiceWorkerJobData::encode const): (WebCore::ServiceWorkerJobData::decode): * workers/service/ServiceWorkerJobDataIdentifier.h: Copied from Source/WebCore/workers/service/ServiceWorkerFetchResult.h. (WebCore::ServiceWorkerJobDataIdentifier::operator== const): (WebCore::ServiceWorkerJobDataIdentifier::loggingString const): (WebCore::ServiceWorkerJobDataIdentifier::encode const): (WebCore::ServiceWorkerJobDataIdentifier::decode): * workers/service/ServiceWorkerTypes.h: * workers/service/context/SWContextManager.cpp: (WebCore::SWContextManager::registerServiceWorkerThreadForInstall): * workers/service/context/SWContextManager.h: * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::fireInstallEvent): * workers/service/server/SWClientConnection.cpp: (WebCore::SWClientConnection::scheduleJob): (WebCore::SWClientConnection::finishedFetchingScript): (WebCore::SWClientConnection::failedFetchingScript): (WebCore::SWClientConnection::jobRejectedInServer): (WebCore::SWClientConnection::registrationJobResolvedInServer): (WebCore::SWClientConnection::unregistrationJobResolvedInServer): (WebCore::SWClientConnection::startScriptFetchForServer): * workers/service/server/SWClientConnection.h: * workers/service/server/SWServer.cpp: (WebCore::SWServer::Connection::scheduleJobInServer): (WebCore::SWServer::rejectJob): (WebCore::SWServer::resolveRegistrationJob): (WebCore::SWServer::startScriptFetch): (WebCore::SWServer::scriptFetchFinished): (WebCore::SWServer::scriptContextFailedToStart): (WebCore::SWServer::scriptContextStarted): (WebCore::SWServer::didFinishInstall): (WebCore::SWServer::updateWorker): * workers/service/server/SWServer.h: * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::isCurrentlyProcessingJob const): (WebCore::SWServerJobQueue::scriptFetchFinished): (WebCore::SWServerJobQueue::scriptContextFailedToStart): (WebCore::SWServerJobQueue::scriptContextStarted): (WebCore::SWServerJobQueue::didFinishInstall): * workers/service/server/SWServerJobQueue.h: * workers/service/server/SWServerToContextConnection.cpp: (WebCore::SWServerToContextConnection::scriptContextFailedToStart): (WebCore::SWServerToContextConnection::scriptContextStarted): (WebCore::SWServerToContextConnection::didFinishInstall): * workers/service/server/SWServerToContextConnection.h: * workers/service/server/SWServerWorker.cpp: (WebCore::SWServerWorker::scriptContextFailedToStart): (WebCore::SWServerWorker::scriptContextStarted): (WebCore::SWServerWorker::didFinishInstall): * workers/service/server/SWServerWorker.h: 2017-11-18 Nan Wang AX: AOM: Implement number type properties https://bugs.webkit.org/show_bug.cgi?id=179497 Reviewed by Chris Fleizach. Accessibility Object Model Explainer: https://wicg.github.io/aom/explainer.html Spec: https://wicg.github.io/aom/spec/ Implemented the number type properties for Accessibility Object Modal. Test: accessibility/mac/AOM-number-properties.html * accessibility/AXObjectCache.cpp: (WebCore::isNodeAriaVisible): * accessibility/AccessibilityARIAGrid.cpp: (WebCore::AccessibilityARIAGrid::isMultiSelectable const): * accessibility/AccessibilityARIAGridCell.cpp: (WebCore::AccessibilityARIAGridCell::rowIndexRange const): (WebCore::AccessibilityARIAGridCell::axRowSpanWithRowIndex const): (WebCore::AccessibilityARIAGridCell::columnIndexRange const): (WebCore::AccessibilityARIAGridCell::ariaRowSpanWithRowIndex const): Deleted. * accessibility/AccessibilityARIAGridCell.h: * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::isEnabled const): (WebCore::AccessibilityNodeObject::isMultiSelectable const): (WebCore::AccessibilityNodeObject::isRequired const): (WebCore::AccessibilityNodeObject::headingLevel const): (WebCore::AccessibilityNodeObject::valueForRange const): (WebCore::AccessibilityNodeObject::maxValueForRange const): (WebCore::AccessibilityNodeObject::minValueForRange const): (WebCore::AccessibilityNodeObject::hierarchicalLevel const): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::intValueForProperty const): (WebCore::AccessibilityObject::unsignedValueForProperty const): (WebCore::AccessibilityObject::doubleValueForProperty const): (WebCore::AccessibilityObject::supportsSetSize const): (WebCore::AccessibilityObject::supportsPosInSet const): (WebCore::AccessibilityObject::setSize const): (WebCore::AccessibilityObject::posInSet const): (WebCore::AccessibilityObject::supportsARIASetSize const): Deleted. (WebCore::AccessibilityObject::supportsARIAPosInSet const): Deleted. (WebCore::AccessibilityObject::ariaSetSize const): Deleted. (WebCore::AccessibilityObject::ariaPosInSet const): Deleted. * accessibility/AccessibilityObject.h: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::defaultObjectInclusion const): (WebCore::AccessibilityRenderObject::liveRegionAtomic const): * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::isDataTable const): (WebCore::AccessibilityTable::axColumnCount const): (WebCore::AccessibilityTable::axRowCount const): (WebCore::AccessibilityTable::ariaColumnCount const): Deleted. (WebCore::AccessibilityTable::ariaRowCount const): Deleted. * accessibility/AccessibilityTable.h: * accessibility/AccessibilityTableCell.cpp: (WebCore::AccessibilityTableCell::AccessibilityTableCell): (WebCore::AccessibilityTableCell::rowIndexRange const): (WebCore::AccessibilityTableCell::columnIndexRange const): (WebCore::AccessibilityTableCell::axColumnIndex const): (WebCore::AccessibilityTableCell::axRowIndex const): (WebCore::AccessibilityTableCell::axColumnSpan const): (WebCore::AccessibilityTableCell::axRowSpan const): (WebCore::AccessibilityTableCell::ariaColumnIndex const): Deleted. (WebCore::AccessibilityTableCell::ariaRowIndex const): Deleted. (WebCore::AccessibilityTableCell::ariaColumnSpan const): Deleted. (WebCore::AccessibilityTableCell::ariaRowSpan const): Deleted. * accessibility/AccessibilityTableCell.h: (WebCore::AccessibilityTableCell::setAXColIndexFromRow): (WebCore::AccessibilityTableCell::setARIAColIndexFromRow): Deleted. * accessibility/AccessibilityTableRow.cpp: (WebCore::AccessibilityTableRow::addChildren): (WebCore::AccessibilityTableRow::axColumnIndex const): (WebCore::AccessibilityTableRow::axRowIndex const): (WebCore::AccessibilityTableRow::ariaColumnIndex const): Deleted. (WebCore::AccessibilityTableRow::ariaRowIndex const): Deleted. * accessibility/AccessibilityTableRow.h: * accessibility/AccessibleNode.cpp: (WebCore::ariaAttributeMap): (WebCore::isPropertyValueInt): (WebCore::isPropertyValueUnsigned): (WebCore::isPropertyValueFloat): (WebCore::AccessibleNode::setProperty): (WebCore::AccessibleNode::setOptionalProperty): (WebCore::AccessibleNode::setStringProperty): (WebCore::AccessibleNode::optionalValueForProperty): (WebCore::AccessibleNode::effectiveBoolValueForElement): (WebCore::AccessibleNode::effectiveIntValueForElement): (WebCore::AccessibleNode::effectiveUnsignedValueForElement): (WebCore::AccessibleNode::effectiveDoubleValueForElement): (WebCore::AccessibleNode::atomic const): (WebCore::AccessibleNode::setAtomic): (WebCore::AccessibleNode::setAutocomplete): (WebCore::AccessibleNode::busy const): (WebCore::AccessibleNode::setBusy): (WebCore::AccessibleNode::setChecked): (WebCore::AccessibleNode::colCount const): (WebCore::AccessibleNode::setColCount): (WebCore::AccessibleNode::colIndex const): (WebCore::AccessibleNode::setColIndex): (WebCore::AccessibleNode::colSpan const): (WebCore::AccessibleNode::setColSpan): (WebCore::AccessibleNode::setCurrent): (WebCore::AccessibleNode::disabled const): (WebCore::AccessibleNode::setDisabled): (WebCore::AccessibleNode::expanded const): (WebCore::AccessibleNode::setExpanded): (WebCore::AccessibleNode::setHasPopUp): (WebCore::AccessibleNode::hidden const): (WebCore::AccessibleNode::setHidden): (WebCore::AccessibleNode::setInvalid): (WebCore::AccessibleNode::setKeyShortcuts): (WebCore::AccessibleNode::label const): (WebCore::AccessibleNode::setLabel): (WebCore::AccessibleNode::level const): (WebCore::AccessibleNode::setLevel): (WebCore::AccessibleNode::live const): (WebCore::AccessibleNode::setLive): (WebCore::AccessibleNode::modal const): (WebCore::AccessibleNode::setModal): (WebCore::AccessibleNode::multiline const): (WebCore::AccessibleNode::setMultiline): (WebCore::AccessibleNode::multiselectable const): (WebCore::AccessibleNode::setMultiselectable): (WebCore::AccessibleNode::setOrientation): (WebCore::AccessibleNode::setPlaceholder): (WebCore::AccessibleNode::posInSet const): (WebCore::AccessibleNode::setPosInSet): (WebCore::AccessibleNode::setPressed): (WebCore::AccessibleNode::readOnly const): (WebCore::AccessibleNode::setReadOnly): (WebCore::AccessibleNode::setRelevant): (WebCore::AccessibleNode::required const): (WebCore::AccessibleNode::setRequired): (WebCore::AccessibleNode::setRole): (WebCore::AccessibleNode::setRoleDescription): (WebCore::AccessibleNode::rowCount const): (WebCore::AccessibleNode::setRowCount): (WebCore::AccessibleNode::rowIndex const): (WebCore::AccessibleNode::setRowIndex): (WebCore::AccessibleNode::rowSpan const): (WebCore::AccessibleNode::setRowSpan): (WebCore::AccessibleNode::selected const): (WebCore::AccessibleNode::setSelected): (WebCore::AccessibleNode::setSize const): (WebCore::AccessibleNode::setSetSize): (WebCore::AccessibleNode::setSort): (WebCore::AccessibleNode::valueMax const): (WebCore::AccessibleNode::setValueMax): (WebCore::AccessibleNode::valueMin const): (WebCore::AccessibleNode::setValueMin): (WebCore::AccessibleNode::valueNow const): (WebCore::AccessibleNode::setValueNow): (WebCore::AccessibleNode::setValueText): (WebCore::AccessibleNode::boolValueForProperty): Deleted. (WebCore::AccessibleNode::setBoolProperty): Deleted. * accessibility/AccessibleNode.h: * accessibility/AccessibleNode.idl: * accessibility/atk/WebKitAccessibleInterfaceTable.cpp: (webkitAccessibleTableGetNColumns): (webkitAccessibleTableGetNRows): * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp: (webkitAccessibleTableCellGetPosition): * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (webkitAccessibleGetAttributes): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityARIARowCount]): (-[WebAccessibilityObjectWrapper accessibilityARIAColumnCount]): (-[WebAccessibilityObjectWrapper accessibilityARIARowIndex]): (-[WebAccessibilityObjectWrapper accessibilityARIAColumnIndex]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): 2017-11-18 Tim Horton Fix typos in closing ENABLE() comments https://bugs.webkit.org/show_bug.cgi?id=179869 Unreviewed. * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h: * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h: 2017-11-18 Maciej Stachowiak Remove TEC support and all TEC-only encodings except EUC-TW (which now uses ICU) https://bugs.webkit.org/show_bug.cgi?id=179582 Reviewed by Darin Adler. Already covered by fast/encoding/legacy-tec-encodings.html * platform/text/TextCodecICU.cpp: Add support for EUC-TW. Remove all vestiges of TEC text codec and its related autogeneration scripts. * DerivedSources.make: * PlatformMac.cmake: * SourcesMac.txt: * WebCore.order: * WebCore.xcodeproj/project.pbxproj: * platform/ThreadGlobalData.cpp: (WebCore::ThreadGlobalData::ThreadGlobalData): No more cached TEC decoder. (WebCore::ThreadGlobalData::destroy): ditto * platform/ThreadGlobalData.h: (WebCore::ThreadGlobalData::ThreadGlobalData::cachedConverterTEC): Deleted. * platform/text/TextEncodingRegistry.cpp: (WebCore::extendTextCodecMaps): Don't add TEC decoders on MAc. * platform/text/mac/CharsetData.h: Removed. * platform/text/mac/TextCodecMac.cpp: Removed. * platform/text/mac/TextCodecMac.h: Removed. * platform/text/mac/character-sets.txt: Removed. * platform/text/mac/ios-encodings.txt: Removed. * platform/text/mac/mac-encodings.txt: Removed. * platform/text/mac/make-charset-table.pl: Removed. 2017-11-18 Simon Fraser Mechanical cleanup of FE* files https://bugs.webkit.org/show_bug.cgi?id=179868 Reviewed by Wenson Hsieh. Remove unused dump() functions. Make overridden member functions in derived classes private. Make simple getters inline. Move common FESpecularLighting and FEDiffuseLighting functions into the FELighting base class. * platform/graphics/filters/FEBlend.cpp: (WebCore::FEBlend::blendMode const): Deleted. (WebCore::FEBlend::dump): Deleted. * platform/graphics/filters/FEBlend.h: (WebCore::FEBlend::blendMode const): * platform/graphics/filters/FEColorMatrix.cpp: (WebCore::FEColorMatrix::type const): Deleted. (WebCore::FEColorMatrix::values const): Deleted. (WebCore::FEColorMatrix::dump): Deleted. * platform/graphics/filters/FEColorMatrix.h: (WebCore::FEColorMatrix::type const): (WebCore::FEColorMatrix::values const): * platform/graphics/filters/FEComponentTransfer.cpp: (WebCore::FEComponentTransfer::redFunction const): Deleted. (WebCore::FEComponentTransfer::greenFunction const): Deleted. (WebCore::FEComponentTransfer::blueFunction const): Deleted. (WebCore::FEComponentTransfer::alphaFunction const): Deleted. (WebCore::FEComponentTransfer::dump): Deleted. * platform/graphics/filters/FEComponentTransfer.h: (WebCore::FEComponentTransfer::redFunction const): (WebCore::FEComponentTransfer::greenFunction const): (WebCore::FEComponentTransfer::blueFunction const): (WebCore::FEComponentTransfer::alphaFunction const): * platform/graphics/filters/FEComposite.cpp: (WebCore::FEComposite::operation const): Deleted. (WebCore::FEComposite::k1 const): Deleted. (WebCore::FEComposite::k2 const): Deleted. (WebCore::FEComposite::k3 const): Deleted. (WebCore::FEComposite::k4 const): Deleted. (WebCore::FEComposite::dump): Deleted. * platform/graphics/filters/FEComposite.h: (WebCore::FEComposite::operation const): (WebCore::FEComposite::k1 const): (WebCore::FEComposite::k2 const): (WebCore::FEComposite::k3 const): (WebCore::FEComposite::k4 const): * platform/graphics/filters/FEConvolveMatrix.cpp: (WebCore::FEConvolveMatrix::kernelSize const): Deleted. (WebCore::FEConvolveMatrix::kernel const): Deleted. (WebCore::FEConvolveMatrix::divisor const): Deleted. (WebCore::FEConvolveMatrix::bias const): Deleted. (WebCore::FEConvolveMatrix::targetOffset const): Deleted. (WebCore::FEConvolveMatrix::edgeMode const): Deleted. (WebCore::FEConvolveMatrix::kernelUnitLength const): Deleted. (WebCore::FEConvolveMatrix::preserveAlpha const): Deleted. (WebCore::FEConvolveMatrix::dump): Deleted. * platform/graphics/filters/FEConvolveMatrix.h: (WebCore::FEConvolveMatrix::kernelSize const): (WebCore::FEConvolveMatrix::kernel const): (WebCore::FEConvolveMatrix::divisor const): (WebCore::FEConvolveMatrix::bias const): (WebCore::FEConvolveMatrix::targetOffset const): (WebCore::FEConvolveMatrix::edgeMode const): (WebCore::FEConvolveMatrix::kernelUnitLength const): (WebCore::FEConvolveMatrix::preserveAlpha const): * platform/graphics/filters/FEDiffuseLighting.cpp: (WebCore::FEDiffuseLighting::lightingColor const): Deleted. (WebCore::FEDiffuseLighting::setLightingColor): Deleted. (WebCore::FEDiffuseLighting::surfaceScale const): Deleted. (WebCore::FEDiffuseLighting::setSurfaceScale): Deleted. (WebCore::FEDiffuseLighting::diffuseConstant const): Deleted. (WebCore::FEDiffuseLighting::kernelUnitLengthX const): Deleted. (WebCore::FEDiffuseLighting::setKernelUnitLengthX): Deleted. (WebCore::FEDiffuseLighting::kernelUnitLengthY const): Deleted. (WebCore::FEDiffuseLighting::setKernelUnitLengthY): Deleted. (WebCore::FEDiffuseLighting::lightSource const): Deleted. (WebCore::FEDiffuseLighting::dump): Deleted. * platform/graphics/filters/FEDiffuseLighting.h: (WebCore::FEDiffuseLighting::diffuseConstant const): * platform/graphics/filters/FEDisplacementMap.cpp: (WebCore::FEDisplacementMap::xChannelSelector const): Deleted. (WebCore::FEDisplacementMap::yChannelSelector const): Deleted. (WebCore::FEDisplacementMap::scale const): Deleted. (WebCore::FEDisplacementMap::dump): Deleted. * platform/graphics/filters/FEDisplacementMap.h: (WebCore::FEDisplacementMap::xChannelSelector const): (WebCore::FEDisplacementMap::yChannelSelector const): (WebCore::FEDisplacementMap::scale const): * platform/graphics/filters/FEDropShadow.cpp: (WebCore::FEDropShadow::dump): Deleted. * platform/graphics/filters/FEDropShadow.h: * platform/graphics/filters/FEFlood.cpp: (WebCore::FEFlood::floodColor const): Deleted. (WebCore::FEFlood::floodOpacity const): Deleted. (WebCore::FEFlood::dump): Deleted. * platform/graphics/filters/FEFlood.h: (WebCore::FEFlood::floodColor const): (WebCore::FEFlood::floodOpacity const): * platform/graphics/filters/FEGaussianBlur.cpp: (WebCore::FEGaussianBlur::stdDeviationX const): Deleted. (WebCore::FEGaussianBlur::stdDeviationY const): Deleted. (WebCore::FEGaussianBlur::edgeMode const): Deleted. (WebCore::FEGaussianBlur::dump): Deleted. * platform/graphics/filters/FEGaussianBlur.h: (WebCore::FEGaussianBlur::stdDeviationX const): (WebCore::FEGaussianBlur::stdDeviationY const): (WebCore::FEGaussianBlur::edgeMode const): * platform/graphics/filters/FELighting.cpp: (WebCore::FELighting::setSurfaceScale): (WebCore::FELighting::setLightingColor): (WebCore::FELighting::setKernelUnitLengthX): (WebCore::FELighting::setKernelUnitLengthY): * platform/graphics/filters/FELighting.h: (WebCore::FELighting::surfaceScale const): (WebCore::FELighting::lightingColor const): (WebCore::FELighting::kernelUnitLengthX const): (WebCore::FELighting::kernelUnitLengthY const): (WebCore::FELighting::lightSource const): * platform/graphics/filters/FEMerge.cpp: (WebCore::FEMerge::dump): Deleted. * platform/graphics/filters/FEMerge.h: * platform/graphics/filters/FEMorphology.cpp: (WebCore::FEMorphology::dump): Deleted. * platform/graphics/filters/FEMorphology.h: * platform/graphics/filters/FEOffset.cpp: (WebCore::FEOffset::dx const): Deleted. (WebCore::FEOffset::dy const): Deleted. (WebCore::FEOffset::dump): Deleted. * platform/graphics/filters/FEOffset.h: (WebCore::FEOffset::dx const): (WebCore::FEOffset::dy const): * platform/graphics/filters/FESpecularLighting.cpp: (WebCore::FESpecularLighting::lightingColor const): Deleted. (WebCore::FESpecularLighting::setLightingColor): Deleted. (WebCore::FESpecularLighting::surfaceScale const): Deleted. (WebCore::FESpecularLighting::setSurfaceScale): Deleted. (WebCore::FESpecularLighting::specularConstant const): Deleted. (WebCore::FESpecularLighting::specularExponent const): Deleted. (WebCore::FESpecularLighting::kernelUnitLengthX const): Deleted. (WebCore::FESpecularLighting::setKernelUnitLengthX): Deleted. (WebCore::FESpecularLighting::kernelUnitLengthY const): Deleted. (WebCore::FESpecularLighting::setKernelUnitLengthY): Deleted. (WebCore::FESpecularLighting::lightSource const): Deleted. (WebCore::FESpecularLighting::dump): Deleted. * platform/graphics/filters/FESpecularLighting.h: (WebCore::FESpecularLighting::specularConstant const): (WebCore::FESpecularLighting::specularExponent const): * platform/graphics/filters/FETile.cpp: (WebCore::FETile::dump): Deleted. * platform/graphics/filters/FETile.h: * platform/graphics/filters/FETurbulence.cpp: (WebCore::FETurbulence::dump): Deleted. * platform/graphics/filters/FETurbulence.h: * platform/graphics/filters/FilterEffect.h: * platform/graphics/filters/SourceAlpha.cpp: (WebCore::SourceAlpha::dump): Deleted. * platform/graphics/filters/SourceAlpha.h: * platform/graphics/filters/SourceGraphic.cpp: (WebCore::SourceGraphic::dump): Deleted. * platform/graphics/filters/SourceGraphic.h: * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::dump): Deleted. * svg/graphics/filters/SVGFEImage.h: 2017-11-18 Simon Fraser Attempt to fix Windows build failures seen in EWS. Remove default constructor for ColorComponents, which was ambiguous with the one that takes 4 values. * platform/graphics/ColorUtilities.h: 2017-11-18 Simon Fraser Line of garbage pixels at the bottom of an feTurbulence sometimes https://bugs.webkit.org/show_bug.cgi?id=179866 Reviewed by Wenson Hsieh. The ParallelJobs logic was broken in that the sum of the computed job heights was one too short sometimes. Fix and clean up the logic. Test: svg/filters/feTurbulence-parallel-jobs.html * platform/graphics/filters/FETurbulence.cpp: (WebCore::FETurbulence::platformApplySoftware): 2017-11-18 Simon Fraser Use #pragma once in FE* files. Rubber-stamped by Dan Bates. * platform/graphics/filters/FEBlend.h: * platform/graphics/filters/FEColorMatrix.h: * platform/graphics/filters/FEComponentTransfer.h: * platform/graphics/filters/FEComposite.h: * platform/graphics/filters/FEConvolveMatrix.h: * platform/graphics/filters/FEDiffuseLighting.h: * platform/graphics/filters/FEDisplacementMap.h: * platform/graphics/filters/FEDropShadow.h: * platform/graphics/filters/FEFlood.h: * platform/graphics/filters/FEGaussianBlur.h: * platform/graphics/filters/FELighting.h: * platform/graphics/filters/FEMerge.h: * platform/graphics/filters/FEOffset.h: * platform/graphics/filters/FESpecularLighting.h: * platform/graphics/filters/FETile.h: 2017-11-18 Simon Fraser Remove a TimingScope that I left in by mistake. * platform/graphics/filters/FETurbulence.cpp: (WebCore::FETurbulence::platformApplySoftware): 2017-11-18 Simon Fraser FETurbulence: round the result according to the spec https://bugs.webkit.org/show_bug.cgi?id=179865 Reviewed by Zalan Bujtas. The spec explicitly says that the floating point results are multiplied by 255 then clamped between 0 and 255, so do this instead of using lroundf(). This is also faster (about 10%). * platform/graphics/ColorUtilities.h: (WebCore::ColorComponents::ColorComponents): * platform/graphics/filters/FETurbulence.cpp: (WebCore::toColorComponents): (WebCore::FETurbulence::calculateTurbulenceValueForPoint const): 2017-11-18 Simon Fraser More FETurbulence cleanup https://bugs.webkit.org/show_bug.cgi?id=179863 Reviewed by Zalan Bujtas. Hoist computation of initial StitchData up to be done once per filter, not once per pixel. Passing initial StitchData by value to calculateTurbulenceValueForPoint() ensures that each pixel gets the initial state. Also, adjusted baseFrequencyX and baseFrequencyY can be computed just once at the start, and passed through via PaintingData. Change enum TurbulenceType to be an enum class (requiring casts in a couple of places) and undo the capitalization of the values. Fix spelling of TURBULANCE -> TURBULENCE in test output. * platform/graphics/filters/FETurbulence.cpp: (WebCore::FETurbulence::computeStitching const): (WebCore::FETurbulence::calculateTurbulenceValueForPoint const): (WebCore::FETurbulence::fillRegion const): (WebCore::FETurbulence::fillRegionWorker): (WebCore::FETurbulence::platformApplySoftware): (WebCore::operator<<): * platform/graphics/filters/FETurbulence.h: (WebCore::FETurbulence::PaintingData::PaintingData): (WebCore::FETurbulence::StitchData::StitchData): Deleted. * svg/SVGAnimatedEnumeration.cpp: (WebCore::enumerationValueForTargetAttribute): * svg/SVGFETurbulenceElement.cpp: (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement): (WebCore::SVGFETurbulenceElement::parseAttribute): * svg/SVGFETurbulenceElement.h: (WebCore::SVGPropertyTraits::highestEnumValue): (WebCore::SVGPropertyTraits::toString): (WebCore::SVGPropertyTraits::fromString): 2017-11-18 Simon Fraser feTurbulence with stitchTiles is broken https://bugs.webkit.org/show_bug.cgi?id=179862 Reviewed by Zalan Bujtas. The "stitchTiles" logic was broken, and not equivalent to the spec sample code, because it didn't compute and wrap the bx1 and by1 equivalents separately from bx0 and by0. Annotated the code with the equivalent sample code from the spec for ease of comparison. Also make some functions const. Test: svg/filters/feTurbulence-stitchTiles.html * platform/graphics/filters/FETurbulence.cpp: (WebCore::FETurbulence::noise2D const): (WebCore::FETurbulence::calculateTurbulenceValueForPoint const): (WebCore::FETurbulence::fillRegion const): (WebCore::checkNoise): Deleted. (WebCore::FETurbulence::noise2D): Deleted. (WebCore::FETurbulence::calculateTurbulenceValueForPoint): Deleted. (WebCore::FETurbulence::fillRegion): Deleted. * platform/graphics/filters/FETurbulence.h: * platform/graphics/filters/FilterEffect.h: (WebCore::FilterEffect::filter const): 2017-11-18 Antti Koivisto REGRESSION (r220646): REGRESSION (r220646): RenderTreePosition::computeNextSibling hits assertion with certain first-letter mutations https://bugs.webkit.org/show_bug.cgi?id=179855 Reviewed by Zalan Bujtas. Test: fast/css-generated-content/first-letter-update-crash.html * style/RenderTreeUpdaterFirstLetter.cpp: (WebCore::styleForFirstLetter): (WebCore::updateFirstLetterStyle): (WebCore::createFirstLetterRenderer): Tighten these to take RenderBlock. (WebCore::supportsFirstLetter): Test exact conditions where first letter renderer is allowed for fast rejection. (WebCore::RenderTreeUpdater::FirstLetter::update): If update was called on a block that doesn't support first letter, getFirstLetter could in some cases return an ancestor of the block and we would end up mutating a first letter renderer that wasn't current block's descendant. This violates assumptions of the RenderTreeUpdater and could cause cached render tree position to become invalid. Fix by ensuring we are always updating first letter for the current block only. 2017-11-17 Chris Dumez [Service Workers] Implement "Notify Controller Change" algorithm https://bugs.webkit.org/show_bug.cgi?id=179822 Reviewed by Youenn Fablet. Implement "Notify Controller Change" algorithm: - https://w3c.github.io/ServiceWorker/#notify-controller-change Use it to support step 7 of "Activate" algorithm: - https://w3c.github.io/ServiceWorker/#activate Test: http/tests/workers/service/controller-change.html * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::scheduleTaskToFireControllerChangeEvent): * workers/service/ServiceWorkerContainer.h: * workers/service/server/SWClientConnection.cpp: (WebCore::SWClientConnection::notifyClientsOfControllerChange): * workers/service/server/SWClientConnection.h: * workers/service/server/SWServer.h: * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::activate): * workers/service/server/SWServerRegistration.cpp: (WebCore::SWServerRegistration::notifyClientsOfControllerChange): * workers/service/server/SWServerRegistration.h: 2017-11-17 Chris Dumez Unreviewed attempt to fix build after r225006. * platform/network/cf/NetworkStorageSessionCFNet.cpp: (WebCore::NetworkStorageSession::setStorageAccessGranted): 2017-11-17 Simon Fraser FETurbulence: compute all 4 channels at once https://bugs.webkit.org/show_bug.cgi?id=179833 Reviewed by Sam Weinig. Introduce some new helper classes for storing float color components, and use them in calculateTurbulenceValueForPoint() and noise2D() for all the channels in one pass. This makes FETurbulence about twice as fast. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/ColorUtilities.cpp: Added. (WebCore::ColorComponents::ColorComponents): * platform/graphics/ColorUtilities.h: Added. (WebCore::FloatComponents::FloatComponents): (WebCore::FloatComponents::operator +=): (WebCore::FloatComponents::operator + const): (WebCore::FloatComponents::operator / const): (WebCore::FloatComponents::operator * const): (WebCore::FloatComponents::abs const): (WebCore::clampedColorComponent): * platform/graphics/filters/FETurbulence.cpp: (WebCore::FETurbulence::noise2D): (WebCore::FETurbulence::calculateTurbulenceValueForPoint): (WebCore::FETurbulence::fillRegion): (WebCore::FETurbulence::platformApplySoftware): * platform/graphics/filters/FETurbulence.h: 2017-11-17 Chris Dumez Use a strongly typed identifier for SWServer::Connection https://bugs.webkit.org/show_bug.cgi?id=179848 Reviewed by Brady Eidson. Use a strongly typed identifier for SWServer::Connection, for clarity. * workers/service/ServiceWorker.cpp: (WebCore::ServiceWorker::postMessage): * workers/service/ServiceWorkerClient.cpp: (WebCore::ServiceWorkerClient::ServiceWorkerClient): (WebCore::ServiceWorkerClient::id const): (WebCore::ServiceWorkerClient::postMessage): * workers/service/ServiceWorkerClient.h: (WebCore::ServiceWorkerClient::create): (WebCore::ServiceWorkerClient::identifier const): * workers/service/ServiceWorkerClientData.cpp: (WebCore::ServiceWorkerClientData::isolatedCopy const): (WebCore::ServiceWorkerClientData::from): * workers/service/ServiceWorkerClientData.h: (WebCore::ServiceWorkerClientData::encode const): (WebCore::ServiceWorkerClientData::decode): * workers/service/ServiceWorkerClientIdentifier.h: (WebCore::ServiceWorkerClientIdentifier::toString const): (WebCore::ServiceWorkerClientIdentifier::decode): * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::addRegistration): (WebCore::ServiceWorkerContainer::removeRegistration): (WebCore::ServiceWorkerContainer::updateRegistration): (WebCore::ServiceWorkerContainer::connectionIdentifier): * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerFetchResult.h: (WebCore::ServiceWorkerFetchResult::decode): * workers/service/ServiceWorkerJobClient.h: * workers/service/ServiceWorkerJobData.cpp: (WebCore::ServiceWorkerJobData::ServiceWorkerJobData): * workers/service/ServiceWorkerJobData.h: (WebCore::ServiceWorkerJobData::connectionIdentifier const): (WebCore::ServiceWorkerJobData::decode): * workers/service/ServiceWorkerTypes.h: * workers/service/ServiceWorkerWindowClient.cpp: (WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient): * workers/service/ServiceWorkerWindowClient.h: * workers/service/context/SWContextManager.cpp: (WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope): * workers/service/context/SWContextManager.h: * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope): * workers/service/context/ServiceWorkerThread.h: * workers/service/server/SWClientConnection.h: * workers/service/server/SWServer.cpp: (WebCore::SWServer::Connection::Connection): (WebCore::SWServer::Connection::scheduleJobInServer): (WebCore::SWServer::rejectJob): (WebCore::SWServer::resolveRegistrationJob): (WebCore::SWServer::startScriptFetch): (WebCore::SWServer::scriptFetchFinished): * workers/service/server/SWServer.h: (WebCore::SWServer::Connection::identifier const): (WebCore::SWServer::getConnection): * workers/service/server/SWServerRegistration.cpp: (WebCore::SWServerRegistration::forEachConnection): (WebCore::SWServerRegistration::addClientServiceWorkerRegistration): (WebCore::SWServerRegistration::removeClientServiceWorkerRegistration): (WebCore::SWServerRegistration::unregisterServerConnection): * workers/service/server/SWServerRegistration.h: 2017-11-17 John Wilander Storage Access API: UI process should update network process about granted access https://bugs.webkit.org/show_bug.cgi?id=176943 Reviewed by Alex Christensen. Tests: http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-non-recent-user-interaction.html http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-recent-user-interaction.html * platform/network/NetworkStorageSession.h: * platform/network/cf/NetworkStorageSessionCFNet.cpp: (WebCore::NetworkStorageSession::setStorageAccessAPIEnabled): (WebCore::NetworkStorageSession::cookieStoragePartition const): Now also checks if the resource has been granted storage access under this partition and if so, does not return a partition. (WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies): Now clears storage access when it is told to clear first. (WebCore::NetworkStorageSession::isStorageAccessGranted const): (WebCore::NetworkStorageSession::setStorageAccessGranted): 2017-11-17 Simon Fraser Inadvertently swapped m_baseFrequencyX and m_baseFrequencyY in the previous commit. * platform/graphics/filters/FETurbulence.h: (WebCore::FETurbulence::baseFrequencyY const): (WebCore::FETurbulence::baseFrequencyX const): 2017-11-17 Alex Christensen REGRESSION(224348): [mac-wk1] LayoutTest media/video-src-remove.html is a flaky timeout https://bugs.webkit.org/show_bug.cgi?id=179806 Reviewed by Jer Noble. In r224348 I used callOnMainThread to fix UIWebView which uses the web thread, but Mac doesn't use the web thread. Something about the timing of operations in the media stack requires that dispatch_async be used instead of performSelectorOnMainThread. * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]): Use callOnMainThread on iOS, dispatch_async on Mac. 2017-11-17 Per Arne Vollan [Win] Compile error in InbandTextTrackPrivateAVCF::readNativeSampleBuffer. https://bugs.webkit.org/show_bug.cgi?id=179845 Reviewed by Jer Noble. * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp: (WebCore::InbandTextTrackPrivateAVCF::readNativeSampleBuffer): 2017-11-17 Chris Fleizach AX: VoiceOver in Safari does not read table header for first cell in first body row https://bugs.webkit.org/show_bug.cgi?id=179780 Reviewed by Joanmarie Diggs. A table cell shouldn't be considered a row header if it's in a row of other headers. Test: accessibility/table-header-calculation-for-header-rows.html * accessibility/AccessibilityTableRow.cpp: (WebCore::AccessibilityTableRow::headerObject): 2017-11-17 Simon Fraser Don't invert a matrix for every channel of every pixel of an FETurbulence filter https://bugs.webkit.org/show_bug.cgi?id=179829 Reviewed by Dean Jackson. FETurbulence::fillRegion() called filter().mapAbsolutePointToLocalPoint(point) for each of the 4 channels on a point, which is stupid. Fix to invert the matrix once, and then map the point once for each pixel. This reduces the time in fillRegion() function by about 30%. * platform/graphics/filters/FETurbulence.cpp: (WebCore::FETurbulence::fillRegion): * platform/graphics/filters/Filter.h: (WebCore::Filter::absoluteTransform const): (WebCore::Filter::mapAbsolutePointToLocalPoint const): Deleted. 2017-11-17 Brent Fulgham REGRESSION(r224390): Revert unneeded Ref use. https://bugs.webkit.org/show_bug.cgi?id=179844 Reviewed by Chris Dumez. A Ref was added to a simple code path used for type checking, which introduced a nullptr deref. The original change was not needed, so let's revert it. * html/HTMLFrameOwnerElement.cpp: (WebCore::HTMLFrameOwnerElement::contentDocument const): Use 'nullptr' instead of 0. (WebCore::HTMLFrameOwnerElement::contentWindow const): Ditto. (WebCore::HTMLFrameOwnerElement::getSVGDocument const): Revert to original code here. 2017-11-17 Nan Wang AX: AOM: Implement boolean type properties https://bugs.webkit.org/show_bug.cgi?id=179496 Reviewed by Chris Fleizach. Accessibility Object Model Explainer: https://wicg.github.io/aom/explainer.html Spec: https://wicg.github.io/aom/spec/ Implemented the boolean type properties for Accessibility Object Modal. Test: accessibility/mac/AOM-bool-properties.html * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::AXObjectCache): (WebCore::AXObjectCache::~AXObjectCache): (WebCore::AXObjectCache::findModalNodes): (WebCore::AXObjectCache::updateCurrentModalNode): (WebCore::AXObjectCache::modalNode): (WebCore::AXObjectCache::remove): (WebCore::AXObjectCache::handleMenuItemSelected): (WebCore::AXObjectCache::focusModalNode): (WebCore::AXObjectCache::focusModalNodeTimerFired): (WebCore::AXObjectCache::handleAttributeChanged): (WebCore::AXObjectCache::handleModalChange): (WebCore::isNodeAriaVisible): (WebCore::AXObjectCache::findAriaModalNodes): Deleted. (WebCore::AXObjectCache::updateCurrentAriaModalNode): Deleted. (WebCore::AXObjectCache::ariaModalNode): Deleted. (WebCore::AXObjectCache::focusAriaModalNode): Deleted. (WebCore::AXObjectCache::focusAriaModalNodeTimerFired): Deleted. (WebCore::AXObjectCache::handleAriaModalChange): Deleted. * accessibility/AXObjectCache.h: (WebCore::AXObjectCache::AXObjectCache): (WebCore::AXObjectCache::modalNode): (WebCore::AXObjectCache::focusModalNodeTimerFired): (WebCore::AXObjectCache::handleModalChange): (WebCore::AXObjectCache::ariaModalNode): Deleted. (WebCore::AXObjectCache::focusAriaModalNodeTimerFired): Deleted. (WebCore::AXObjectCache::handleAriaModalChange): Deleted. * accessibility/AccessibilityARIAGrid.cpp: (WebCore::AccessibilityARIAGrid::isMultiSelectable const): * accessibility/AccessibilityARIAGridCell.cpp: (WebCore::AccessibilityARIAGridCell::readOnlyValue const): (WebCore::AccessibilityARIAGridCell::ariaReadOnlyValue const): Deleted. * accessibility/AccessibilityARIAGridCell.h: * accessibility/AccessibilityListBoxOption.cpp: (WebCore::AccessibilityListBoxOption::isEnabled const): * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::isEnabled const): (WebCore::AccessibilityNodeObject::isMultiSelectable const): (WebCore::AccessibilityNodeObject::isRequired const): (WebCore::shouldUseAccessibilityObjectInnerText): (WebCore::AccessibilityNodeObject::canSetValueAttribute const): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::supportsReadOnly const): (WebCore::AccessibilityObject::readOnlyValue const): (WebCore::AccessibilityObject::ariaIsMultiline const): (WebCore::AccessibilityObject::isModalDescendant const): (WebCore::AccessibilityObject::isModalNode const): (WebCore::AccessibilityObject::ignoredFromModalPresence const): (WebCore::AccessibilityObject::boolValueForProperty const): (WebCore::AccessibilityObject::supportsARIAAttributes const): (WebCore::AccessibilityObject::supportsExpanded const): (WebCore::AccessibilityObject::isExpanded const): (WebCore::AccessibilityObject::isAXHidden const): (WebCore::AccessibilityObject::defaultObjectInclusion const): (WebCore::AccessibilityObject::setIsIgnoredFromParentDataForChild): (WebCore::AccessibilityObject::supportsARIAReadOnly const): Deleted. (WebCore::AccessibilityObject::ariaReadOnlyValue const): Deleted. (WebCore::AccessibilityObject::isAriaModalDescendant const): Deleted. (WebCore::AccessibilityObject::isAriaModalNode const): Deleted. (WebCore::AccessibilityObject::ignoredFromARIAModalPresence const): Deleted. (WebCore::AccessibilityObject::isARIAHidden const): Deleted. * accessibility/AccessibilityObject.h: (WebCore::AccessibilityObject::isHidden const): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::defaultObjectInclusion const): (WebCore::AccessibilityRenderObject::isSelected const): (WebCore::AccessibilityRenderObject::canSetExpandedAttribute const): (WebCore::AccessibilityRenderObject::liveRegionAtomic const): (WebCore::AccessibilityRenderObject::isBusy const): * accessibility/AccessibleNode.cpp: (WebCore::ariaAttributeMap): (WebCore::isPropertyValueBoolean): (WebCore::AccessibleNode::effectiveBoolValueForElement): (WebCore::AccessibleNode::boolValueForProperty): (WebCore::AccessibleNode::setBoolProperty): (WebCore::AccessibleNode::atomic const): (WebCore::AccessibleNode::setAtomic): (WebCore::AccessibleNode::busy const): (WebCore::AccessibleNode::setBusy): (WebCore::AccessibleNode::disabled const): (WebCore::AccessibleNode::setDisabled): (WebCore::AccessibleNode::expanded const): (WebCore::AccessibleNode::setExpanded): (WebCore::AccessibleNode::hidden const): (WebCore::AccessibleNode::setHidden): (WebCore::AccessibleNode::modal const): (WebCore::AccessibleNode::setModal): (WebCore::AccessibleNode::multiline const): (WebCore::AccessibleNode::setMultiline): (WebCore::AccessibleNode::multiselectable const): (WebCore::AccessibleNode::setMultiselectable): (WebCore::AccessibleNode::readOnly const): (WebCore::AccessibleNode::setReadOnly): (WebCore::AccessibleNode::required const): (WebCore::AccessibleNode::setRequired): (WebCore::AccessibleNode::selected const): (WebCore::AccessibleNode::setSelected): * accessibility/AccessibleNode.h: * accessibility/AccessibleNode.idl: * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (webkitAccessibleGetAttributes): (setAtkStateSetFromCoreObject): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties): 2017-11-17 Alex Christensen Clean up URL.h https://bugs.webkit.org/show_bug.cgi?id=179710 Reviewed by Brady Eidson. No change in behavior. * Modules/fetch/FetchRequest.cpp: (WebCore::FetchRequest::urlString const): * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::url const): * platform/URL.cpp: (WebCore::URL::serialize const): Deleted. * platform/URL.h: * platform/mac/URLMac.mm: (WebCore::URL::createCFURL const): 2017-11-17 Alex Christensen Use RunLoop and Mode from NetworkingContext if they are given https://bugs.webkit.org/show_bug.cgi?id=179800 Reviewed by Brady Eidson. * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (callOnMainThreadOrSchedule): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]): 2017-11-17 Simon Fraser FETurbulence const and inline cleanup https://bugs.webkit.org/show_bug.cgi?id=179832 Reviewed by Dean Jackson. Pass the PaintingData& around as const, and remove some 'inline', letting the compiler decide. Also declare a few variables closer to first use. Speeds up FETurbulence by about 1%. * platform/graphics/filters/FETurbulence.cpp: (WebCore::FETurbulence::initPaint): (WebCore::FETurbulence::noise2D): (WebCore::FETurbulence::calculateTurbulenceValueForPoint): (WebCore::FETurbulence::fillRegion): * platform/graphics/filters/FETurbulence.h: 2017-11-17 Antti Koivisto Move destroyLeftoverChildren call to RenderObject::destroy https://bugs.webkit.org/show_bug.cgi?id=179819 Reviewed by Zalan Bujtas. This is currently called inconsistenly from various willBeDestroyed implementations. We should always call it before invoking willBeDestroyed. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::willBeDestroyed): * rendering/RenderElement.cpp: (WebCore::RenderElement::willBeDestroyed): * rendering/RenderElement.h: (WebCore::RenderElement::setLastChild): * rendering/RenderInline.cpp: (WebCore::RenderInline::willBeDestroyed): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::~RenderLayer): Add some release asserts verifying layer has been detached before destruction. This would reveal cases where destroyLeftoverChildren was called too late. * rendering/RenderObject.cpp: (WebCore::RenderObject::destroy): Call destroyLeftoverChildren. 2017-11-17 Said Abou-Hallawa SVG scrolling anchor should be reset if the fragmentIdentifier does not exist or is not provided https://bugs.webkit.org/show_bug.cgi?id=176577 Reviewed by Simon Fraser. Because the SVGImage can be cached only once but used multiple times with different fragmentIdentifiers, SVGImage has to call FrameView::scrollToFragment() before the image is displayed. If the fragmentIdentifier is not provided in the URL or it does not exist in the SVGImage, FrameView::scrollToFragment() has to reset the scrolling anchor of the SVG as if it was not displayed before. We do not want the previous scrolling anchor to be used when the FrameView of SVGImage can't scroll to the current fragmentIdentifier for any reason. Test: http/tests/svg/svg-fragment-url-special-cases.html * page/FrameView.cpp: (WebCore::FrameView::scrollToFragment): (WebCore::FrameView::scrollToAnchor): (WebCore::FrameView::resetScrollAnchor): * page/FrameView.h: * platform/URL.cpp: (WebCore::URL::fragmentIdentifier const): Call hasFragmentIdentifier() instead of repeating the same condition. (WebCore::decodeURLEscapeSequences): * svg/SVGSVGElement.cpp: (WebCore::SVGSVGElement::findViewAnchor const): (WebCore::SVGSVGElement::findRootAnchor const): (WebCore::SVGSVGElement::scrollToAnchor): We want to know whether the SVG root element could scroll to the fragmentIdentifier or not. If it could not, FrameView::scrollToAnchor() can still try one last time to do the scrolling only if anchorElement is not nullptr. (WebCore::SVGSVGElement::resetScrollAnchor): Reset the FrameView scrolling state to its initial value. * svg/SVGSVGElement.h: 2017-11-17 Youenn Fablet ServiceWorker intercepted FetchRequest should have their referrer set appropriately. https://bugs.webkit.org/show_bug.cgi?id=179803 Reviewed by Chris Dumez. Covered by updated tests. * workers/service/context/ServiceWorkerFetch.cpp: (WebCore::ServiceWorkerFetch::dispatchFetchEvent): 2017-11-17 Joanmarie Diggs AX: [GTK] Regression: accessibility/gtk/aria-keyshortcuts.html fails after r224953 https://bugs.webkit.org/show_bug.cgi?id=179824 Reviewed by Chris Fleizach. The failure was due to AXPropertyName::KeyShortcuts not being included in the group of properties whose value is a string. As a result, the new method to get string values, AccessibleNode::effectiveStringValueForElement(), was returning an empty String. This was not caught by the shared set of tests because at the present time, only WebKitGtk supports aria-keyshortcuts. No new tests needed. The regression was caught by an existing test. * accessibility/AccessibleNode.cpp: (WebCore::isPropertyValueString): 2017-11-17 Ryan Haddad Unreviewed, rolling out r224952. This change introduced LayoutTest failures on WK1. Reverted changeset: "Use RunLoop and Mode from NetworkingContext if they are given" https://bugs.webkit.org/show_bug.cgi?id=179800 https://trac.webkit.org/changeset/224952 2017-11-16 Antoine Quint [Web Animations] Force a stacking context during animations that animate properties that will force a stacking context https://bugs.webkit.org/show_bug.cgi?id=179811 Reviewed by Dean Jackson. The Web Animations specification mandates in section 4.7 (w3c.github.io/web-animations/#side-effects-section) that "for every property targeted by at least one animation effect that is current or in effect, the user agent must act as if the will-change property ([css-will-change-1]) on the target element includes the property." After parsing new keyframes, we check if any of the CSS properties that get animated would end up forcing a stacking context, and if so, enforce a stacking context during the entire active lifetime of the animation. Test: webanimations/animation-opacity-animation-crash.html * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::processKeyframes): (WebCore::KeyframeEffect::computeStackingContextImpact): (WebCore::KeyframeEffect::applyAtLocalTime): * animation/KeyframeEffect.h: 2017-11-17 Ali Juma Update feature status for Visual Viewport API to "In Development" https://bugs.webkit.org/show_bug.cgi?id=179818 Reviewed by Frédéric Wang. Work on this feature has started, tracked by bug 170982. No new tests since there's no change in behavior. * features.json: 2017-11-16 Yousuke Kimoto [WinCairo] Add network (curl) files for wincairo webkit https://bugs.webkit.org/show_bug.cgi?id=179474 Reviewed by Alex Christensen. No new behvaior, no new tests. * PlatformWinCairo.cmake: * platform/Curl.cmake: * platform/network/curl/CookieStorageCurl.cpp: Added. (WebCore::startObservingCookieChanges): (WebCore::stopObservingCookieChanges): * platform/network/curl/NetworkStorageSessionCurl.cpp: Added. (WebCore::NetworkStorageSession::~NetworkStorageSession): (WebCore::NetworkStorageSession::context const): (WebCore::defaultSession): (WebCore::NetworkStorageSession::ensureSession): (WebCore::NetworkStorageSession::switchToNewTestingSession): (WebCore::NetworkStorageSession::setCookies): (WebCore::NetworkStorageSession::setCookie): (WebCore::NetworkStorageSession::deleteCookie): (WebCore::NetworkStorageSession::getAllCookies): (WebCore::NetworkStorageSession::getCookies): (WebCore::NetworkStorageSession::flushCookieStore): 2017-11-16 Alex Christensen Fix occasional crash when adding and removing videos https://bugs.webkit.org/show_bug.cgi?id=179792 Reviewed by Geoffrey Garen. In taskCompleted we null out session, and in resume we call _restart on the main thread. If _restart is called after taskCompleted, we want to do nothing. Right now we are calling a method on self.session.loader which is a PlatformMediaResourceLoader& but in ObjC if session is null it will call PlatformMediaResourceLoader::requestResource with a null this pointer, which crashes. Let's not crash. * platform/network/cocoa/WebCoreNSURLSession.mm: (-[WebCoreNSURLSessionDataTask _restart]): Early return if we don't have a session. 2017-11-16 Don Olmstead [WinCairo] Update WinCairoRequirements https://bugs.webkit.org/show_bug.cgi?id=179790 Reviewed by Alex Christensen. No new tests. No change in behavior. * PlatformWin.cmake: 2017-11-16 Antoine Quint [Web Animations] Allow KeyframeEffect to support CSS property animation blending https://bugs.webkit.org/show_bug.cgi?id=179810 Reviewed by Tim Horton. We used to pass nullptr instead of a valid AnimationBase when calling CSSPropertyAnimation::blendProperties() in KeyframeEffect::applyAtLocalTime() when blending CSS styles during a keyframe animation. Without this AnimationBase, some blending functions would crash as certain supporting calls couldn't be made. We now add a new CSSPropertyBlendingClient virtual interface that both KeyframeEffect and AnimationBase implement and that CSSPropertyAnimation::blendProperties() take as a parameter in order to support blending code. * WebCore.xcodeproj/project.pbxproj: * animation/CSSPropertyBlendingClient.h: Added. * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::applyAtLocalTime): (WebCore::KeyframeEffect::renderer const): (WebCore::KeyframeEffect::currentStyle const): * animation/KeyframeEffect.h: * page/animation/AnimationBase.h: (WebCore::AnimationBase::isAccelerated const): (WebCore::AnimationBase::transformFunctionListsMatch const): (WebCore::AnimationBase::filterFunctionListsMatch const): (WebCore::AnimationBase::backdropFilterFunctionListsMatch const): * page/animation/CSSPropertyAnimation.cpp: (WebCore::blendFunc): (WebCore::blendFilterOperations): (WebCore::blendFilter): (WebCore::crossfadeBlend): (WebCore::PropertyWrapperAcceleratedBackdropFilter::blend const): (WebCore::PropertyWrapperShadow::blendSimpleOrMatchedShadowLists const): (WebCore::PropertyWrapperShadow::blendMismatchedShadowLists const): (WebCore::CSSPropertyAnimation::blendProperties): * page/animation/CSSPropertyAnimation.h: 2017-11-16 Youenn Fablet Service Worker should get the body of intercepted requests https://bugs.webkit.org/show_bug.cgi?id=179776 Reviewed by Alex Christensen. Test: http/tests/workers/service/service-worker-request-with-body.https.html Make use of FetchBodyConsumer to store raw data for FetchRequest. This is used when setting FetchRequest body from a FormData. If FormData is only bytes (no blob, no file), FetchBodyConsumer will store that data. This allows Service Worker to get access to simple request bodies. * Modules/fetch/FetchBody.cpp: (WebCore::FetchBody::fromFormData): (WebCore::FetchBody::consume): (WebCore::FetchBody::bodyAsFormData const): Making sure body is set appropriately when used to make fetch load. * Modules/fetch/FetchBody.h: Making some methods private. * Modules/fetch/FetchBodyConsumer.h: Adding accessors. (WebCore::FetchBodyConsumer::hasData const): (WebCore::FetchBodyConsumer::data const): * Modules/fetch/FetchRequest.h: (WebCore::FetchRequest::FetchRequest): * platform/network/FormData.cpp: (WebCore::FormData::asSharedBuffer const): * platform/network/FormData.h: * workers/service/context/ServiceWorkerFetch.cpp: (WebCore::ServiceWorkerFetch::dispatchFetchEvent): Setting FetchRequest body based on given FormData. 2017-11-16 Chris Dumez Make sure service workers get terminated between tests https://bugs.webkit.org/show_bug.cgi?id=179774 Reviewed by Alex Christensen. Make sure service workers get terminated between tests. Previously, we would merely clear all registrations and job queues but it would not cause the registrations' service workers to get terminated. * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::updateExtendedEventsSet): * workers/service/server/SWServer.cpp: (WebCore::SWServer::clearAll): * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::scriptFetchFinished): (WebCore::SWServerJobQueue::scriptContextFailedToStart): (WebCore::SWServerJobQueue::didFinishInstall): (WebCore::SWServerJobQueue::tryClearRegistration): (WebCore::SWServerJobQueue::clearRegistration): * workers/service/server/SWServerJobQueue.h: 2017-11-16 Youenn Fablet FetchLoader should unregister its blob URL https://bugs.webkit.org/show_bug.cgi?id=179768 Reviewed by Alex Christensen. No observable change. Keep the blob URL used for reading and unregister it in destructor. * Modules/fetch/FetchLoader.cpp: (WebCore::FetchLoader::~FetchLoader): (WebCore::FetchLoader::start): * Modules/fetch/FetchLoader.h: 2017-11-16 Nan Wang AX: AOM: Implement string type properties https://bugs.webkit.org/show_bug.cgi?id=179495 Reviewed by Chris Fleizach. Implemented the rest of the string type properties for Accessibility Object Model. Test: accessibility/mac/AOM-string-properties.html * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::handleLiveRegionCreated): * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::childrenChanged): (WebCore::AccessibilityNodeObject::isPressed const): (WebCore::AccessibilityNodeObject::isChecked const): (WebCore::AccessibilityNodeObject::valueDescription const): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex): (WebCore::AccessibilityObject::supportsAutoComplete const): (WebCore::AccessibilityObject::autoCompleteValue const): (WebCore::AccessibilityObject::invalidStatus const): (WebCore::AccessibilityObject::supportsCurrent const): (WebCore::AccessibilityObject::currentState const): (WebCore::AccessibilityObject::currentValue const): (WebCore::AccessibilityObject::roleDescription const): (WebCore::AccessibilityObject::keyShortcutsValue const): (WebCore::AccessibilityObject::placeholderValue const): (WebCore::AccessibilityObject::isInsideLiveRegion const): (WebCore::AccessibilityObject::liveRegionAncestor const): (WebCore::AccessibilityObject::supportsARIAAttributes const): (WebCore::AccessibilityObject::supportsLiveRegion const): (WebCore::AccessibilityObject::sortDirection const): (WebCore::AccessibilityObject::supportsHasPopup const): (WebCore::AccessibilityObject::hasPopupValue const): (WebCore::AccessibilityObject::supportsPressed const): (WebCore::AccessibilityObject::checkboxOrRadioValue const): (WebCore::AccessibilityObject::pressedIsPresent const): (WebCore::AccessibilityObject::buttonRoleType const): (WebCore::AccessibilityObject::supportsARIAAutoComplete const): Deleted. (WebCore::AccessibilityObject::ariaAutoCompleteValue const): Deleted. (WebCore::AccessibilityObject::supportsARIACurrent const): Deleted. (WebCore::AccessibilityObject::ariaCurrentState const): Deleted. (WebCore::AccessibilityObject::ariaCurrentValue const): Deleted. (WebCore::AccessibilityObject::ariaKeyShortcutsValue const): Deleted. (WebCore::AccessibilityObject::isInsideARIALiveRegion const): Deleted. (WebCore::AccessibilityObject::ariaLiveRegionAncestor const): Deleted. (WebCore::AccessibilityObject::supportsARIALiveRegion const): Deleted. (WebCore::AccessibilityObject::supportsARIAHasPopup const): Deleted. (WebCore::AccessibilityObject::ariaPopupValue const): Deleted. (WebCore::AccessibilityObject::supportsARIAPressed const): Deleted. (WebCore::AccessibilityObject::ariaPressedIsPresent const): Deleted. * accessibility/AccessibilityObject.h: (WebCore::AccessibilityObject::hasPopup const): (WebCore::AccessibilityObject::liveRegionStatus const): (WebCore::AccessibilityObject::liveRegionRelevant const): (WebCore::AccessibilityObject::liveRegionAtomic const): (WebCore::AccessibilityObject::ariaHasPopup const): Deleted. (WebCore::AccessibilityObject::ariaLiveRegionStatus const): Deleted. (WebCore::AccessibilityObject::ariaLiveRegionRelevant const): Deleted. (WebCore::AccessibilityObject::ariaLiveRegionAtomic const): Deleted. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::hasPopup const): (WebCore::AccessibilityRenderObject::determineAccessibilityRole): (WebCore::AccessibilityRenderObject::orientation const): (WebCore::AccessibilityRenderObject::textChanged): (WebCore::AccessibilityRenderObject::liveRegionStatus const): (WebCore::AccessibilityRenderObject::liveRegionRelevant const): (WebCore::AccessibilityRenderObject::liveRegionAtomic const): (WebCore::AccessibilityRenderObject::ariaHasPopup const): Deleted. (WebCore::AccessibilityRenderObject::ariaLiveRegionStatus const): Deleted. (WebCore::AccessibilityRenderObject::ariaLiveRegionRelevant const): Deleted. (WebCore::AccessibilityRenderObject::ariaLiveRegionAtomic const): Deleted. * accessibility/AccessibilityRenderObject.h: * accessibility/AccessibleNode.cpp: (WebCore::ariaAttributeMap): (WebCore::isPropertyValueString): (WebCore::AccessibleNode::notifyAttributeChanged): (WebCore::AccessibleNode::autocomplete const): (WebCore::AccessibleNode::setAutocomplete): (WebCore::AccessibleNode::checked const): (WebCore::AccessibleNode::setChecked): (WebCore::AccessibleNode::current const): (WebCore::AccessibleNode::setCurrent): (WebCore::AccessibleNode::hasPopUp const): (WebCore::AccessibleNode::setHasPopUp): (WebCore::AccessibleNode::invalid const): (WebCore::AccessibleNode::setInvalid): (WebCore::AccessibleNode::keyShortcuts const): (WebCore::AccessibleNode::setKeyShortcuts): (WebCore::AccessibleNode::live const): (WebCore::AccessibleNode::setLive): (WebCore::AccessibleNode::setLabel): (WebCore::AccessibleNode::orientation const): (WebCore::AccessibleNode::setOrientation): (WebCore::AccessibleNode::placeholder const): (WebCore::AccessibleNode::setPlaceholder): (WebCore::AccessibleNode::pressed const): (WebCore::AccessibleNode::setPressed): (WebCore::AccessibleNode::relevant const): (WebCore::AccessibleNode::setRelevant): (WebCore::AccessibleNode::role const): (WebCore::AccessibleNode::setRole): (WebCore::AccessibleNode::roleDescription const): (WebCore::AccessibleNode::setRoleDescription): (WebCore::AccessibleNode::sort const): (WebCore::AccessibleNode::setSort): (WebCore::AccessibleNode::valueText const): (WebCore::AccessibleNode::setValueText): * accessibility/AccessibleNode.h: (WebCore::AXPropertyHashTraits::constructDeletedValue): (WebCore::AXPropertyHashTraits::isDeletedValue): * accessibility/AccessibleNode.idl: * accessibility/atk/AXObjectCacheAtk.cpp: (WebCore::AXObjectCache::postPlatformNotification): * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (webkitAccessibleGetAttributes): (atkRole): (setAtkStateSetFromCoreObject): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityHasPopup]): (-[WebAccessibilityObjectWrapper accessibilityARIALiveRegionStatus]): (-[WebAccessibilityObjectWrapper accessibilityARIARelevantStatus]): (-[WebAccessibilityObjectWrapper accessibilityARIALiveRegionIsAtomic]): (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAPressed]): (-[WebAccessibilityObjectWrapper accessibilityARIACurrentStatus]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]): (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties): 2017-11-16 Alex Christensen Use RunLoop and Mode from NetworkingContext if they are given https://bugs.webkit.org/show_bug.cgi?id=179800 Reviewed by Brady Eidson. We used to call [NSURLConnection scheduleInRunLoop:forMode:] before r224267. That change broke WebKitLegacy clients using custom run loop modes, which I partially fixed in r224687 and r224896, but that hangs if there are any non-scheduled calls to callOnMainThread and it ignores the CFRunLoop part of the SchedulePair. This is a more elegant solution that fixes all known bugs with custom run loop modes and makes the behavior as close to the pre-r224267 behavior as possible by using all parameters in a good way. I verified the bug in the radar is fixed, the API test WebKitLegacy.ScheduleInRunLoop still passes, and UIWebView still works on iOS. * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (callOnMainThreadOrSchedule): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]): 2017-11-16 Daniel Bates Add feature define for alternative presentation button element https://bugs.webkit.org/show_bug.cgi?id=179692 Part of Reviewed by Andy Estes. Only enabled on Cocoa platforms by default. * Configurations/FeatureDefines.xcconfig: 2017-11-16 Chris Dumez [Service Worker] Implement "Try Clear Registration" algorithm https://bugs.webkit.org/show_bug.cgi?id=179791 Reviewed by Youenn Fablet. Implement "Try Clear Registration" algorithm: - https://w3c.github.io/ServiceWorker/#try-clear-registration-algorithm In particular, a SWServerRegistration now knows if it is "in use" by a given service worker client (i.e. The registration's active service worker is controlling the service worker client). See: - https://w3c.github.io/ServiceWorker/#selection (last paragraph) No new tests, rebaselined existing tests. * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::setActiveServiceWorker): * workers/service/server/SWClientConnection.h: * workers/service/server/SWServer.cpp: (WebCore::SWServer::Connection::serviceWorkerStartedControllingClient): (WebCore::SWServer::Connection::serviceWorkerStoppedControllingClient): (WebCore::SWServer::serviceWorkerStartedControllingClient): (WebCore::SWServer::serviceWorkerStoppedControllingClient): * workers/service/server/SWServer.h: * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::tryClearRegistration): * workers/service/server/SWServerRegistration.h: (WebCore::SWServerRegistration::hasClientsUsingRegistration const): (WebCore::SWServerRegistration::addClientUsingRegistration): (WebCore::SWServerRegistration::removeClientUsingRegistration): 2017-11-16 Michael Catanzaro REGRESSION(r224179): layer flush now requires sync IPC to compute undo/redo availability in EditorState https://bugs.webkit.org/show_bug.cgi?id=179797 Reviewed by Simon Fraser. Editor::canUndo and Editor::CanRedo no longer need to be exported. * editing/Editor.h: 2017-11-16 Chris Dumez Dispatching an event on a ServiceWorkerRegistration may fail or crash due to GC https://bugs.webkit.org/show_bug.cgi?id=179751 Reviewed by Geoffrey Garen. Dispatching an event on a ServiceWorkerRegistration may fail or crash due to GC. We need to make sure that a ServiceWorkerRegistration's wrapper stays alive as long as we may dispatch events on it. Keep the wrapper alive by making ServiceWorker an ActiveDOMObject and making sure the implementation object keeps a PendingActivity alive while it may dispatch JS events. The only event dispatched on ServiceWorkerRegistration objects is the "updatefound" one. We may dispatch updatefound events on a ServiceWorkerRegistration until the registration gets cleared on server side, in which case the ServiceWorkerRegistration object ends up with no service worker. We therefore take a PendingActivity when the ServiceWorkerRegistration is constructed and we release it once the registration has no more associated ServiceWorker or the ActiveDOMObject is stopped (to avoid leaks on navigation). Test: http/tests/workers/service/service-worker-registration-gc-event.html * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::scheduleTaskToFireUpdateFoundEvent): * workers/service/ServiceWorkerRegistration.cpp: (WebCore::ServiceWorkerRegistration::getOrCreate): (WebCore::ServiceWorkerRegistration::updateStateFromServer): (WebCore::ServiceWorkerRegistration::scheduleTaskToFireUpdateFoundEvent): (WebCore::ServiceWorkerRegistration::stop): (WebCore::ServiceWorkerRegistration::updatePendingActivityForEventDispatch): * workers/service/ServiceWorkerRegistration.h: * workers/service/ServiceWorkerRegistration.idl: 2017-11-16 Chris Dumez Crash in WebCore::SWServerJobQueue::scriptFetchFinished(WebCore::SWServer::Connection&, WebCore::ServiceWorkerFetchResult const&) + 77 https://bugs.webkit.org/show_bug.cgi?id=179394 Reviewed by Youenn Fablet. In SWServerJobQueue::scriptFetchFinished(), make sure the job queue is still processing the job that triggered the fetch. If it is not, ignore the callback. This could happen when calling SWServer::clear() while a script fetch was pending. No new tests, already covered by existing tests that sometimes crash on the bots. * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::isCurrentlyProcessingJob const): (WebCore::SWServerJobQueue::scriptFetchFinished): * workers/service/server/SWServerJobQueue.h: 2017-11-16 Brady Eidson Crash in worker tests handling the m_stoppedCallback. and https://bugs.webkit.org/show_bug.cgi?id=179798 Reviewed by Chris Dumez. No new tests (Covered by existing tests). Protect manipulation of m_stoppedCallback with m_threadCreationAndWorkerGlobalScopeMutex. * workers/WorkerThread.cpp: (WebCore::WorkerThread::workerThread): (WebCore::WorkerThread::stop): 2017-11-16 Antoine Quint [Web Animations] Express time in milliseconds through the API https://bugs.webkit.org/show_bug.cgi?id=179799 Reviewed by Simon Fraser. While internally we use seconds to specify times and durations, the Web Animations API uses milliseconds, so we have to convert times and durations from and to milliseconds. * animation/AnimationEffectTiming.h: * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::bindingsCurrentTime): * animation/WebAnimation.cpp: (WebCore::WebAnimation::bindingsStartTime const): (WebCore::WebAnimation::setBindingsStartTime): (WebCore::WebAnimation::bindingsCurrentTime const): (WebCore::WebAnimation::setBindingsCurrentTime): * testing/Internals.cpp: (WebCore::Internals::setTimelineCurrentTime): 2017-11-16 Michael Catanzaro REGRESSION(r224887): GCC 5 build broken https://bugs.webkit.org/show_bug.cgi?id=179750 Reviewed by Jer Noble. Add a legacy FourCC constructor that will be used only when building with GCC 5. This is bad, but it seems acceptable for use with a fallback codepath. Unfortunately, this requires adjusting some initializations to avoid ambiguity with the uint32_t constructor. * platform/graphics/FourCC.h: (WebCore::FourCC::FourCC): * platform/graphics/iso/ISOBox.cpp: (WebCore::ISOBox::peekBox): * platform/graphics/iso/ISOBox.h: * platform/graphics/iso/ISOOriginalFormatBox.h: * platform/graphics/iso/ISOSchemeTypeBox.h: 2017-11-16 Andy Estes [Payment Request] Update feature status to "Supported In Preview" https://bugs.webkit.org/show_bug.cgi?id=179793 Reviewed by Tim Horton. * features.json: 2017-11-16 Antoine Quint Clean up KeyframeEffect https://bugs.webkit.org/show_bug.cgi?id=179777 Reviewed by Daniel Bates. A few review comments came in after https://bugs.webkit.org/show_bug.cgi?id=179707 landed, addressing them with this follow-up patch. * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::create): Use "keyframeEffect" instead of "result" for clarity. (WebCore::KeyframeEffect::processKeyframes): Use consistent index and length types while iterating over properties in PropertyNameArray and explicitly size the properties array since we already know its final size. * dom/Element.cpp: (WebCore::Element::getAnimations): 2017-11-16 Zalan Bujtas Always invoke RenderObject::insertedIntoTree/willBeRemovedFromTree https://bugs.webkit.org/show_bug.cgi?id=178007 Reviewed by Antti Koivisto. Based on Antti Koivisto's patch: These call are currently skipped in some cases making them bug prone and difficult to reason about. This is done as an optimization that doesn't appear to be valuable anymore. Covered by existing tests. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::makeChildrenNonInline): (WebCore::RenderBlock::dropAnonymousBoxChild): (WebCore::RenderBlock::takeChild): * rendering/RenderBlock.h: (WebCore::RenderBlock::moveAllChildrenIncludingFloatsTo): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::styleDidChange): (WebCore::RenderBlockFlow::moveAllChildrenIncludingFloatsTo): * rendering/RenderBlockFlow.h: * rendering/RenderBox.cpp: (WebCore::RenderBox::splitAnonymousBoxesAroundChild): * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::moveChildTo): (WebCore::RenderBoxModelObject::moveChildrenTo): * rendering/RenderBoxModelObject.h: (WebCore::RenderBoxModelObject::moveChildTo): (WebCore::RenderBoxModelObject::moveAllChildrenTo): (WebCore::RenderBoxModelObject::moveChildrenTo): * rendering/RenderElement.cpp: (WebCore::RenderElement::addChild): (WebCore::RenderElement::takeChild): (WebCore::RenderElement::insertChildInternal): (WebCore::RenderElement::takeChildInternal): (WebCore::RenderElement::handleDynamicFloatPositionChange): * rendering/RenderElement.h: * rendering/RenderInline.cpp: (WebCore::RenderInline::splitInlines): (WebCore::RenderInline::splitFlow): (WebCore::RenderInline::childBecameNonInline): * rendering/RenderMultiColumnFlow.cpp: (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted): * rendering/RenderRubyBase.cpp: (WebCore::RenderRubyBase::moveInlineChildren): (WebCore::RenderRubyBase::moveBlockChildren): * rendering/RenderRubyRun.cpp: (WebCore::RenderRubyRun::takeChild): * rendering/RenderTableRow.cpp: (WebCore::RenderTableRow::collapseAndDestroyAnonymousSiblingRows): * style/RenderTreeUpdaterMultiColumn.cpp: (WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow): (WebCore::RenderTreeUpdater::MultiColumn::destroyFragmentedFlow): 2017-11-14 Dean Jackson Add a base class for HTMLCanvasElement and OffscreenCanvas https://bugs.webkit.org/show_bug.cgi?id=179701 Reviewed by Sam Weinig. In order for OffscreenCanvas to be able to create a WebGLRenderingContext, there needs to be a shared base class with HTMLCanvasElement. Add such a class called CanvasBase. There is a lot of potential for functionality to move into the base class, but unfortunately HTMLCanvasElement is a bit messy. It implements a lot of the 2d rendering context functionality, and also many const functions that actually cause changes. Thus, things like the canvas size have to remain in the subclasses for now. The existence of the new base class meant the canvas() accessor in CanvasRenderingContext had to move out into the subclasses, and do the correct casting. Eventually, at least for WebGLRenderingContext, this will have a change in behaviour, but for now we only ever use HTMLCanvasElements, so most of these changes are just for the sake of compilation. No behaviour change - covered by existing tests. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * html/CanvasBase.cpp: Copied from Source/WebCore/html/canvas/GPUBasedCanvasRenderingContext.h. (WebCore::CanvasBase::CanvasBase): New base class. (WebCore::CanvasBase::asHTMLCanvasElement): Casts to an HTMLCanvasElement*, which many of the rendering context code uses. * html/CanvasBase.h: Copied from Source/WebCore/html/canvas/GPUBasedCanvasRenderingContext.h. (WebCore::CanvasBase::isHTMLCanvasElement const): (WebCore::CanvasBase::isOffscreenCanvas const): (WebCore::CanvasBase::setOriginClean): (WebCore::CanvasBase::setOriginTainted): (WebCore::CanvasBase::originClean const): (WebCore::CanvasBase::securityOrigin const): (WebCore::CanvasBase::scriptExecutionContext const): * html/HTMLCanvasElement.cpp: Use the base class methods where possible. (WebCore::HTMLCanvasElement::HTMLCanvasElement): (WebCore::HTMLCanvasElement::toDataURL): (WebCore::HTMLCanvasElement::toBlob): (WebCore::HTMLCanvasElement::createImageBuffer const): Be explict as to which of the derived classes scriptExecutionContext() method we are calling. * html/HTMLCanvasElement.h: Use the base class, mark a few things as virtual, and remove the parts that are now in CanvasBase. * html/OffscreenCanvas.cpp: Use the base class. (WebCore::OffscreenCanvas::OffscreenCanvas): (WebCore::OffscreenCanvas::size const): (WebCore::OffscreenCanvas::setSize): * html/OffscreenCanvas.h: * html/canvas/CanvasRenderingContext.cpp: (WebCore::CanvasRenderingContext::CanvasRenderingContext): (WebCore::CanvasRenderingContext::ref): Call the correct ref/deref functions, depending on the base class type. (WebCore::CanvasRenderingContext::deref): (WebCore::CanvasRenderingContext::wouldTaintOrigin): We no longer have a canvas() method. (WebCore::CanvasRenderingContext::checkOrigin): * html/canvas/CanvasRenderingContext.h: (WebCore::CanvasRenderingContext::canvasBase const): Add this accessor to the base canvas object to replace the canvas() call. (WebCore::CanvasRenderingContext::checkOrigin): (WebCore::CanvasRenderingContext::ref): Deleted. (WebCore::CanvasRenderingContext::deref): Deleted. (WebCore::CanvasRenderingContext::canvas const): Deleted. * html/canvas/CanvasRenderingContext2D.cpp: Use the base class. (WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D): * html/canvas/CanvasRenderingContext2D.h: * html/canvas/GPUBasedCanvasRenderingContext.h: (WebCore::GPUBasedCanvasRenderingContext::GPUBasedCanvasRenderingContext): * html/canvas/ImageBitmapRenderingContext.cpp: (WebCore::ImageBitmapRenderingContext::ImageBitmapRenderingContext): (WebCore::ImageBitmapRenderingContext::canvas const): (WebCore::ImageBitmapRenderingContext::setOutputBitmap): * html/canvas/ImageBitmapRenderingContext.h: * html/canvas/PlaceholderRenderingContext.cpp: (WebCore::PlaceholderRenderingContext::PlaceholderRenderingContext): * html/canvas/PlaceholderRenderingContext.h: * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::WebGL2RenderingContext): * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::WebGLRenderingContext): * html/canvas/WebGLRenderingContext.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::create): Assume that we're still getting an HTMLCanvasElement, but protect some of the logic just in case we don't. (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase): (WebCore::WebGLRenderingContextBase::canvas): (WebCore::WebGLRenderingContextBase::checkForContextLossHandling): (WebCore::WebGLRenderingContextBase::registerWithWebGLStateTracker): (WebCore::WebGLRenderingContextBase::setupFlags): (WebCore::WebGLRenderingContextBase::addActivityStateChangeObserverIfNecessary): (WebCore::WebGLRenderingContextBase::removeActivityStateChangeObserver): (WebCore::WebGLRenderingContextBase::markContextChanged): (WebCore::WebGLRenderingContextBase::markContextChangedAndNotifyCanvasObserver): (WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas): (WebCore::WebGLRenderingContextBase::reshape): (WebCore::WebGLRenderingContextBase::compileShader): (WebCore::WebGLRenderingContextBase::isContextLostOrPending): (WebCore::WebGLRenderingContextBase::readPixels): (WebCore::WebGLRenderingContextBase::loseContextImpl): (WebCore::WebGLRenderingContextBase::printToConsole): (WebCore::WebGLRenderingContextBase::dispatchContextLostEvent): (WebCore::WebGLRenderingContextBase::maybeRestoreContext): (WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent): (WebCore::WebGLRenderingContextBase::clampedCanvasSize): * html/canvas/WebGLRenderingContextBase.h: * html/canvas/WebGLRenderingContextBase.idl: * html/canvas/WebGPURenderingContext.cpp: (WebCore::WebGPURenderingContext::create): (WebCore::WebGPURenderingContext::WebGPURenderingContext): (WebCore::WebGPURenderingContext::canvas const): (WebCore::WebGPURenderingContext::clampedCanvasSize const): * html/canvas/WebGPURenderingContext.h: * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::recordCanvasAction): (WebCore::InspectorInstrumentation::didEnableExtension): (WebCore::InspectorInstrumentation::didCreateProgram): (WebCore::InspectorInstrumentation::willDeleteProgram): (WebCore::InspectorInstrumentation::isShaderProgramDisabled): * inspector/agents/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::recordCanvasAction): (WebCore::InspectorCanvasAgent::didEnableExtension): (WebCore::InspectorCanvasAgent::didCreateProgram): 2017-11-16 Colin Bendell Added mime type check to the picture source preloader to avoid downloading incompatible resources. https://bugs.webkit.org/show_bug.cgi?id=179231 Reviewed by Alex Christensen. Test: http/tests/loading/preload-picture-type.html * html/parser/HTMLPreloadScanner.cpp: (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): include type match state when selecting candidate imgs (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): added type attribute evaluation and matching 2017-11-16 Chris Dumez Dispatching an event on a ServiceWorker may fail or crash due to GC https://bugs.webkit.org/show_bug.cgi?id=179745 Reviewed by Geoffrey Garen. Dispatching an event on a ServiceWorker may fail or crash due to GC. We need to make sure that a ServiceWorker's wrapper stays alive as long as we may dispatch events on it. Keep the wrapper alive by making ServiceWorker an ActiveDOMObject and making sure the implementation object keeps a PendingActivity alive while it may dispatch JS events. The only event dispatched on ServiceWorker objects is the "statechange" one. We may dispatch statechange events on a ServiceWorker until its state becomes "redundant". We therefore take a PendingActivity when the ServiceWorker's state is or becomes non-redundant (becoming non redundant can only happen when switching initially from redundant to installing, at which point the ServiceWorker object is not exposed to the JS yet). We release the PendingActivity when the ServiceWorker's state becomes redundant or the ActiveDOMObject is stopped (to avoid leaks on navigation). Test: http/tests/workers/service/service-worker-gc-event.html * workers/service/ServiceWorker.cpp: (WebCore::mutableAllWorkers): (WebCore::ServiceWorker::removeFromAllWorkers): (WebCore::ServiceWorker::getOrCreate): (WebCore::ServiceWorker::ServiceWorker): (WebCore::ServiceWorker::~ServiceWorker): (WebCore::ServiceWorker::scheduleTaskToUpdateState): (WebCore::ServiceWorker::activeDOMObjectName const): (WebCore::ServiceWorker::canSuspendForDocumentSuspension const): (WebCore::ServiceWorker::stop): (WebCore::ServiceWorker::updatePendingActivityForEventDispatch): * workers/service/ServiceWorker.h: * workers/service/ServiceWorker.idl: 2017-11-16 Frederic Wang Consider non-main frames for frameViewRootLayerDidChange https://bugs.webkit.org/show_bug.cgi?id=178508 Reviewed by Antonio Gomes. No new tests, behavior unchanged. AsyncScrollingCoordinator::frameViewRootLayerDidChange assumes that frameView is always a main-frame. It calls ensureRootStateNodeForFrameView, which always attaches a frame node with null parent ID. It also has an ASSERT to check m_scrollingStateTree->rootStateNode(), instead of m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()). This patch makes the ASSERT more generic. It also adds an early return into ensureRootStateNodeForFrameView when the node already exists so that the call to attachToStateTree can be skipped. It turns out that that call is actually only necessary for main frame, so another ASSERT is added to verify it. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange): Modify the ASSERT to verify the availability of a scrolling node for the frame, not just the root node. (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView): Add an early return to skip the call to attachToStateTree when the node is actually already available. Add an ASSERT to ensure that attaching a new node is only necessary for main frames. 2017-11-16 Miguel Gomez [TexMap] Remove use of GraphicsContext3D https://bugs.webkit.org/show_bug.cgi?id=174860 Reviewed by Žan Doberšek. Remove remaining uses of GC3D that are not WebGL related: - Remove the option to create a GC3D to render to the curren OpenGL context. - Remove the remaining usage of GC3D inside MediaPlayerPrivateGStreamerBase. - Replace the usage inside TextureMapper with direct OpenGL calls, and use a VAO when the OpenGL version is higher than 3.2. This also modifies TextureMapperContextAttributes so all the tested features are supported when using OpenGL, and we only check for the extensions when using GLES2. No new tests as there's no behavior change. * platform/graphics/GraphicsContext3D.h: * platform/graphics/GraphicsContext3DPrivate.cpp: (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate): * platform/graphics/GraphicsContext3DPrivate.h: * platform/graphics/cairo/GraphicsContext3DCairo.cpp: (WebCore::GraphicsContext3D::~GraphicsContext3D): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: * platform/graphics/texmap/TextureMapper.h: * platform/graphics/texmap/TextureMapperContextAttributes.cpp: (WebCore::TextureMapperContextAttributes::initialize): * platform/graphics/texmap/TextureMapperContextAttributes.h: * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp: (WebCore::TextureMapperGC3DPlatformLayer::TextureMapperGC3DPlatformLayer): (WebCore::TextureMapperGC3DPlatformLayer::makeContextCurrent): (WebCore::TextureMapperGC3DPlatformLayer::platformContext): (WebCore::TextureMapperGC3DPlatformLayer::swapBuffersIfNeeded): (WebCore::TextureMapperGC3DPlatformLayer::paintToTextureMapper): * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h: * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGLData::SharedGLData::currentSharedGLData): (WebCore::TextureMapperGLData::TextureMapperGLData): (WebCore::TextureMapperGLData::~TextureMapperGLData): (WebCore::TextureMapperGLData::initializeStencil): (WebCore::TextureMapperGLData::getStaticVBO): (WebCore::TextureMapperGLData::getVAO): (WebCore::TextureMapperGLData::getShaderProgram): (WebCore::TextureMapperGL::TextureMapperGL): (WebCore::TextureMapperGL::beginPainting): (WebCore::TextureMapperGL::endPainting): (WebCore::TextureMapperGL::drawBorder): (WebCore::prepareFilterProgram): (WebCore::TextureMapperGL::drawTexture): (WebCore::TextureMapperGL::drawSolidColor): (WebCore::TextureMapperGL::clearColor): (WebCore::TextureMapperGL::drawEdgeTriangles): (WebCore::TextureMapperGL::drawUnitRect): (WebCore::TextureMapperGL::draw): (WebCore::TextureMapperGL::drawTexturedQuadWithProgram): (WebCore::TextureMapperGL::drawFiltered): (WebCore::TextureMapperGL::bindDefaultSurface): (WebCore::TextureMapperGL::beginClip): (WebCore::TextureMapperGL::createTexture): * platform/graphics/texmap/TextureMapperGL.h: 2017-11-16 Frederic Wang ASSERTION FAILED: !isAnonymous() in WebCore::RenderMathMLOperator::updateTokenContent https://bugs.webkit.org/show_bug.cgi?id=166011 Reviewed by Alejandro G. Castro. RenderMathMLFencedOperator does not support mathvariant or displaystyle transforms. This is one of several issues of the mfenced element (see bug 160509). However, MathMLStyle::updateStyleIfNeeded() still tries to use the implementation of the parent RenderMathMLOperator class, which only works for non-anonymous operators. This patch skips the updateTokenContent() calls for anonymous mfenced operators in order to avoid ASSERTION failures. Test: mathml/mfenced-displaystyle-and-mathvariant-crash.html * rendering/mathml/MathMLStyle.cpp: (WebCore::MathMLStyle::updateStyleIfNeeded): Skip anonymous token elements. 2017-11-15 Brady Eidson Implement basics of "Terminate Service Worker" algorithm. https://bugs.webkit.org/show_bug.cgi?id=179551 Reviewed by Chris Dumez. No new tests (No observable behavior change yet). * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::stopIndexedDatabase): * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::workerThreadCreated): (WebCore::WorkerMessagingProxy::terminateWorkerGlobalScope): * workers/WorkerThread.cpp: (WebCore::WorkerThread::workerThread): (WebCore::WorkerThread::stop): * workers/WorkerThread.h: * workers/service/context/SWContextManager.cpp: (WebCore::SWContextManager::terminateWorker): * workers/service/context/SWContextManager.h: * workers/service/server/SWServer.cpp: (WebCore::SWServer::workerContextTerminated): (WebCore::SWServer::terminateWorker): * workers/service/server/SWServer.h: * workers/service/server/SWServerToContextConnection.cpp: (WebCore::SWServerToContextConnection::workerTerminated): * workers/service/server/SWServerToContextConnection.h: * workers/service/server/SWServerWorker.cpp: (WebCore::SWServerWorker::terminate): (WebCore::SWServerWorker::contextTerminated): * workers/service/server/SWServerWorker.h: 2017-11-15 Eric Carlson Log media readyState and networkState as strings https://bugs.webkit.org/show_bug.cgi?id=179732 Reviewed by Youenn Fablet. * html/HTMLMediaElement.cpp: (WebCore::convertEnumerationToString): (WebCore::HTMLMediaElement::scheduleDelayedAction): Fix logic error. (WebCore::HTMLMediaElement::pendingActionTimerFired): Fix incorrect log string. (WebCore::HTMLMediaElement::setNetworkState): Don't cast to int for logging. (WebCore::HTMLMediaElement::setReadyState): Ditto. Log when autoplay is blocked. * html/HTMLMediaElementEnums.h: (PAL::LogArgument::toString): New. (PAL::LogArgument::toString): New. * platform/graphics/MediaPlayer.cpp: (WebCore::convertEnumerationToString): * platform/graphics/MediaPlayerEnums.h: (PAL::LogArgument::toString): (PAL::LogArgument::toString): * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::updateStates): Log strings. 2017-11-15 Youenn Fablet Service Worker fetch should handle empty responses https://bugs.webkit.org/show_bug.cgi?id=179740 Reviewed by Alex Christensen. Covered by updated test. * Modules/streams/ReadableStreamSink.cpp: (WebCore::ReadableStreamToSharedBufferSink::enqueue): Not create a buffer until actually needed. * workers/service/context/ServiceWorkerFetch.cpp: (WebCore::ServiceWorkerFetch::processResponse): Check for null buffers. 2017-11-15 Youenn Fablet ReloadFromOrigin loads should not select any service worker https://bugs.webkit.org/show_bug.cgi?id=179736 Reviewed by Brady Eidson. Test: http/tests/workers/service/shift-reload-navigation.html In case of ReloadFromOrigin (equivalent of shift reload), do not select any service worker. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::startLoadingMainResource): * loader/FrameLoader.h: (WebCore::FrameLoader::isReloadingFromOrigin const): 2017-11-15 Zalan Bujtas AX triggers sync layout while building the render tree on www.macrumors.com. https://bugs.webkit.org/show_bug.cgi?id=179741 rdar://problem/35462531 Reviewed by Antti Koivisto. It's unsafe to issue layout while mutating the render tree. If a mutation requires AX to issue a layout, it needs to be issued in a delayed manner (which the render tree mutation will trigger anyway). Unable to reproduce. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::updateBackingStore): 2017-11-15 Antoine Quint [Web Animations] Implement basic to-from animations https://bugs.webkit.org/show_bug.cgi?id=179707 We can now actually perform an animation, in software only, when provided two keyframes on an AnimationEffect. To parse a keyframes object from JS, we use the StyleResolver to create RenderStyle objects based on the strings provided for the property names and values. Then, when the DocumentTimeline indicates that animations are ready to be updated, we invalidate the style of elements with animations, so that during style resolution we can perform blending between the RenderStyles for each keyframe. Reviewed by Dean Jackson. * animation/AnimationEffect.h: (WebCore::AnimationEffect::~AnimationEffect): Deleted. * animation/AnimationTimeline.h: (WebCore::AnimationTimeline::elementToAnimationsMap const): * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::animationResolutionTimerFired): (WebCore::DocumentTimeline::updateAnimations): Renamed from resolveAnimations() since we're not actually resolving animations, merely invalidating styles in preparation for resolution. (WebCore::DocumentTimeline::resolveAnimations): Deleted. * animation/DocumentTimeline.h: * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::create): Pass the keyframes argument to setKeyframes() and forward the exception in case one was raised in the setter. (WebCore::KeyframeEffect::setKeyframes): Pass the keyframes argument to processKeyframes() and forward the exception in case one was raised during processing. (WebCore::KeyframeEffect::processKeyframes): Deal with exactly two keyframes, set at 0 and 1 offsets, specified in array forms for the keyframes object. As we parse the content of the provided JS object, we create RenderStyle objects using the element's StyleResolver from a CSS text string we create based on the property and values as strings. (WebCore::KeyframeEffect::applyAtLocalTime): Compute the progress based on the local time and duration, using the existing CSSPropertyAnimation::blendProperties() mechanics to perform the blend between the from and to keyframes. * animation/KeyframeEffect.h: * animation/KeyframeEffect.idl: * animation/WebAnimation.cpp: (WebCore::WebAnimation::resolve): * animation/WebAnimation.h: * bindings/IDLTypes.h: (WebCore::IDLObject::nullValue): Make JSC::Strong an optional type. * dom/Document.h: (WebCore::Document::existingTimeline const): Provide an explicit method for call sites to check existence of a timeline before forcing one to be created if missing by calling timeline(). * dom/Element.cpp: (WebCore::Element::getAnimations): Do not force the creation of a timeline if one isn't already created. * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::createAnimatedElementUpdate): When applying styles, account for any Web Animation applied to the provided element. 2017-11-15 Frederic Wang ASSERTION FAILED: !renderer->needsLayout() in WebCore::RenderBlock::checkPositionedObjectsNeedLayout with MathML https://bugs.webkit.org/show_bug.cgi?id=178865 Reviewed by Manuel Rego Casasnovas. MathML token elements can contain HTML elements and hence MathML elements can contain out-of-flow positioned descendants. Also all MathML elements can be containing block and hence should position their out-of-flow positioned descendants before calling clearNeedsLayout(). This patch does that in all places in the MathML renderer classes, except a few of them: - RenderMathMLSpace, which can not have descendants. - RenderMathMLToken and RenderMathMLOperator, since they will use the layout implementation of RenderMathMLBlock when they contain non-text children. The patch also fixes an ASSERTION failure in WebCore::RenderBlock::checkPositionedObjectsNeedLayout due to some descendants that are not laid out. Test: mathml/out-of-flow-in-token-crash.html * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::RenderMathMLBlock::layoutBlock): Call layoutPositionedObjects. (WebCore::RenderMathMLBlock::layoutInvalidMarkup): Ditto and pass the relayoutChildren boolean. * rendering/mathml/RenderMathMLBlock.h: Add a relayoutChildren boolean to layoutInvalidMarkup. * rendering/mathml/RenderMathMLFraction.cpp: (WebCore::RenderMathMLFraction::layoutBlock): Pass the relayoutChildren boolean to layoutInvalidMarkup and call layoutPositionedObjects. * rendering/mathml/RenderMathMLRoot.cpp: (WebCore::RenderMathMLRoot::layoutBlock): Ditto. * rendering/mathml/RenderMathMLScripts.cpp: (WebCore::RenderMathMLScripts::layoutBlock): Ditto. * rendering/mathml/RenderMathMLUnderOver.cpp: (WebCore::RenderMathMLUnderOver::layoutBlock): Ditto. * rendering/mathml/RenderMathMLMenclose.cpp: (WebCore::RenderMathMLMenclose::layoutBlock): Call layoutPositionedObjects. * rendering/mathml/RenderMathMLPadded.cpp: (WebCore::RenderMathMLPadded::layoutBlock): Ditto. * rendering/mathml/RenderMathMLRow.cpp: (WebCore::RenderMathMLRow::layoutBlock): Ditto. 2017-11-15 Youenn Fablet Add ServiceWorker to WebProcess plumbery for FormData fetch responses https://bugs.webkit.org/show_bug.cgi?id=179694 Reviewed by Alex Christensen. No observable changes since we are not actually loading FormData right now. * workers/service/context/ServiceWorkerFetch.cpp: (WebCore::ServiceWorkerFetch::processResponse): * workers/service/context/ServiceWorkerFetch.h: 2017-11-15 Jer Noble Add a compile-time-checked string literal initializer for FourCC. https://bugs.webkit.org/show_bug.cgi?id=179706 Reviewed by Alex Christensen. Add a contexpr constructor for FourCC that takes a string literal and static_asserts that it is exactly 4 chars long. Use this string literal constructor everywhere instead of multi- character literals. * platform/graphics/FourCC.h: (WebCore::FourCC::FourCC): * platform/graphics/iso/ISOBox.cpp: (WebCore::ISOBox::parse): * platform/graphics/iso/ISOOriginalFormatBox.h: (WebCore::ISOOriginalFormatBox::boxTypeName): * platform/graphics/iso/ISOProtectionSchemeInfoBox.h: (WebCore::ISOProtectionSchemeInfoBox::boxTypeName): * platform/graphics/iso/ISOSchemeInformationBox.h: (WebCore::ISOSchemeInformationBox::boxTypeName): * platform/graphics/iso/ISOSchemeTypeBox.h: (WebCore::ISOSchemeTypeBox::boxTypeName): * platform/graphics/iso/ISOTrackEncryptionBox.h: (WebCore::ISOTrackEncryptionBox::boxTypeName): * platform/graphics/iso/ISOVTTCue.h: (WebCore::ISOWebVTTCue::boxTypeName): 2017-11-15 Adrian Perez de Castro [Cairo] Clang warns about mismatched declaration type tag for GraphicsContextState https://bugs.webkit.org/show_bug.cgi?id=179729 Reviewed by Michael Catanzaro. No new tests needed. * platform/graphics/cairo/CairoOperations.h: Make the forward declaration use "struct" as the actual implementation of the type does. 2017-11-15 Chris Dumez [Service Workers] Implement Client API https://bugs.webkit.org/show_bug.cgi?id=179709 Reviewed by Alex Christensen. Implement Client API as per: - https://w3c.github.io/ServiceWorker/#client-interface Tests: http/tests/workers/service/Client-properties.html http/tests/workers/service/Client-properties-subframe.html http/tests/workers/service/Client-properties-auxiliary.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * workers/service/ServiceWorker.cpp: (WebCore::ServiceWorker::postMessage): * workers/service/ServiceWorkerClient.cpp: (WebCore::ServiceWorkerClient::ServiceWorkerClient): (WebCore::ServiceWorkerClient::url const): (WebCore::ServiceWorkerClient::type const): (WebCore::ServiceWorkerClient::frameType const): (WebCore::ServiceWorkerClient::id const): (WebCore::ServiceWorkerClient::postMessage): * workers/service/ServiceWorkerClient.h: (WebCore::ServiceWorkerClient::create): * workers/service/ServiceWorkerClientData.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerWindowClient.cpp. (WebCore::toServiceWorkerClientFrameType): (WebCore::ServiceWorkerClientData::isolatedCopy const): (WebCore::ServiceWorkerClientData::from): * workers/service/ServiceWorkerClientData.h: Copied from Source/WebCore/workers/service/ServiceWorkerClient.h. (WebCore::ServiceWorkerClientData::encode const): (WebCore::ServiceWorkerClientData::decode): * workers/service/ServiceWorkerClientIdentifier.h: (WebCore::ServiceWorkerClientIdentifier::encode const): (WebCore::ServiceWorkerClientIdentifier::decode): * workers/service/ServiceWorkerTypes.h: * workers/service/ServiceWorkerWindowClient.cpp: (WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient): * workers/service/ServiceWorkerWindowClient.h: * workers/service/context/SWContextManager.cpp: (WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope): * workers/service/context/SWContextManager.h: * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope): * workers/service/context/ServiceWorkerThread.h: * workers/service/server/SWClientConnection.h: 2017-11-15 Ryan Haddad Unreviewed, rolling out r224863. Introduced LayoutTest crashes on iOS Simulator. Reverted changeset: "Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h" https://bugs.webkit.org/show_bug.cgi?id=173793 https://trac.webkit.org/changeset/224863 2017-11-15 Youenn Fablet Remove service worker selection based on registration https://bugs.webkit.org/show_bug.cgi?id=179705 Reviewed by Alex Christensen. Covered by updated tests. Selection is now handled at navigation time. We can remove the selection/unselection of worker based on registration. * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult): * workers/service/ServiceWorkerRegistration.cpp: (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration): 2017-11-15 Zan Dobersek [Cairo] GraphicsContext::setPlatformShadow() has to update state's shadow offset when ignoring transforms https://bugs.webkit.org/show_bug.cgi?id=179725 Reviewed by Carlos Garcia Campos. In r224753, GraphicsContext::setPlatformShadow() stopped updating the shadow offset value that's kept in GraphicsContextState. This regressed a few tests, so the adjustment of the shadow offset value in the GraphicsContext state is brought back. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::State::setShadowValues): * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::setPlatformShadow): 2017-11-15 Gabriel Ivascu [GTK] Automatically adjust font size when gtk-xft-dpi changes https://bugs.webkit.org/show_bug.cgi?id=142673 Some follow-up fixes for the previous patch. Reviewed by Carlos Garcia Campos. * platform/PlatformScreen.h: * platform/gtk/PlatformScreenGtk.cpp: (WebCore::screenDPIObserverHandlersMap): (WebCore::gtkXftDPIChangedCallback): (WebCore::setScreenDPIObserverHandler): * platform/wpe/PlatformScreenWPE.cpp: (WebCore::setScreenDPIObserverHandler): 2017-11-14 Nan Wang AX: AOM: Implement AccessibleNode class and support label and role attributes https://bugs.webkit.org/show_bug.cgi?id=179494 Reviewed by Ryosuke Niwa. Accessibility Object Model Explainer: https://wicg.github.io/aom/explainer.html Spec: https://wicg.github.io/aom/spec/ This change adds an accessibleNode getter on Element, and implements the role and label properties of AccessibleNode. In existing accessibility code, places where we previously retrieve an ARIA attribute are replaced with a new function that first checks the AOM property and then checks the equivalent ARIA attribute. Test: accessibility/accessibility-object-model.html * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AXObjectCache.cpp: (WebCore::nodeHasRole): (WebCore::AXObjectCache::handleLiveRegionCreated): * accessibility/AccessibilityAllInOne.cpp: * accessibility/AccessibilityImageMapLink.cpp: (WebCore::AccessibilityImageMapLink::roleValue const): (WebCore::AccessibilityImageMapLink::accessibilityDescription const): * accessibility/AccessibilityListBoxOption.cpp: (WebCore::AccessibilityListBoxOption::stringValue const): * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::ariaAccessibilityDescription const): (WebCore::siblingWithAriaRole): (WebCore::AccessibilityNodeObject::textForLabelElement const): (WebCore::AccessibilityNodeObject::alternativeText const): (WebCore::AccessibilityNodeObject::alternativeTextForWebArea const): (WebCore::AccessibilityNodeObject::stringValue const): (WebCore::accessibleNameForNode): (WebCore::AccessibilityNodeObject::determineAriaRoleAttribute const): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::hasProperty const): (WebCore::AccessibilityObject::stringValueForProperty const): (WebCore::AccessibilityObject::supportsARIAAttributes const): * accessibility/AccessibilityObject.h: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::stringValue const): (WebCore::AccessibilityRenderObject::exposesTitleUIElement const): (WebCore::AccessibilityRenderObject::determineAccessibilityRole): * accessibility/AccessibleNode.cpp: Added. (WebCore::ariaAttributeMap): (WebCore::isPropertyValueString): (WebCore::AccessibleNode::hasProperty): (WebCore::AccessibleNode::valueForProperty): (WebCore::AccessibleNode::effectiveStringValueForElement): (WebCore::AccessibleNode::stringValueForProperty): (WebCore::AccessibleNode::setStringProperty): (WebCore::AccessibleNode::role const): (WebCore::AccessibleNode::setRole): (WebCore::AccessibleNode::label const): (WebCore::AccessibleNode::setLabel): * accessibility/AccessibleNode.h: Added. (WebCore::AXPropertyHashTraits::emptyValue): (WebCore::AXPropertyHashTraits::constructDeletedValue): (WebCore::AXPropertyHashTraits::isDeletedValue): (WebCore::AccessibleNode::AccessibleNode): (WebCore::AccessibleNode::ref): (WebCore::AccessibleNode::deref): * accessibility/AccessibleNode.idl: Added. * bindings/js/WebCoreBuiltinNames.h: * dom/Element.cpp: (WebCore::Element::canContainRangeEndPoint const): (WebCore::Element::accessibleNode): (WebCore::Element::existingAccessibleNode const): * dom/Element.h: * dom/Element.idl: * dom/ElementRareData.cpp: * dom/ElementRareData.h: (WebCore::ElementRareData::accessibleNode const): (WebCore::ElementRareData::setAccessibleNode): * editing/TextIterator.cpp: (WebCore::isRendererReplacedElement): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setAccessibilityObjectModelEnabled): (WebCore::RuntimeEnabledFeatures::accessibilityObjectModelEnabled const): * rendering/RenderMenuList.cpp: (RenderMenuList::itemAccessibilityText const): 2017-11-14 Zan Dobersek [Cairo] Add GraphicsContextImplCairo stub https://bugs.webkit.org/show_bug.cgi?id=179658 Reviewed by Carlos Garcia Campos. Add the GraphicsContextImplCairo class, which at this point is still an empty implementation of the GraphicsContextImpl interface. Plan for the near future is to start mapping method invocations to CairoOperation functions, essentially mirroring what the Cairo-specific GraphicsContext methods do today. In the future this implementation would hopefully allow us to apply a recorded list of GraphicsContext commands against a PlatformContextCairo instance. * platform/SourcesCairo.txt: * platform/graphics/cairo/GraphicsContextImplCairo.cpp: Added. (WebCore::GraphicsContextImplCairo::GraphicsContextImplCairo): (WebCore::m_platformContext): (WebCore::GraphicsContextImplCairo::updateState): (WebCore::GraphicsContextImplCairo::clearShadow): (WebCore::GraphicsContextImplCairo::setLineCap): (WebCore::GraphicsContextImplCairo::setLineDash): (WebCore::GraphicsContextImplCairo::setLineJoin): (WebCore::GraphicsContextImplCairo::setMiterLimit): (WebCore::GraphicsContextImplCairo::fillRect): (WebCore::GraphicsContextImplCairo::fillRoundedRect): (WebCore::GraphicsContextImplCairo::fillRectWithRoundedHole): (WebCore::GraphicsContextImplCairo::fillPath): (WebCore::GraphicsContextImplCairo::fillEllipse): (WebCore::GraphicsContextImplCairo::strokeRect): (WebCore::GraphicsContextImplCairo::strokePath): (WebCore::GraphicsContextImplCairo::strokeEllipse): (WebCore::GraphicsContextImplCairo::clearRect): (WebCore::GraphicsContextImplCairo::drawGlyphs): (WebCore::GraphicsContextImplCairo::drawImage): (WebCore::GraphicsContextImplCairo::drawTiledImage): (WebCore::GraphicsContextImplCairo::drawNativeImage): (WebCore::GraphicsContextImplCairo::drawPattern): (WebCore::GraphicsContextImplCairo::drawRect): (WebCore::GraphicsContextImplCairo::drawLine): (WebCore::GraphicsContextImplCairo::drawLinesForText): (WebCore::GraphicsContextImplCairo::drawLineForDocumentMarker): (WebCore::GraphicsContextImplCairo::drawEllipse): (WebCore::GraphicsContextImplCairo::drawPath): (WebCore::GraphicsContextImplCairo::drawFocusRing): (WebCore::GraphicsContextImplCairo::save): (WebCore::GraphicsContextImplCairo::restore): (WebCore::GraphicsContextImplCairo::translate): (WebCore::GraphicsContextImplCairo::rotate): (WebCore::GraphicsContextImplCairo::scale): (WebCore::GraphicsContextImplCairo::concatCTM): (WebCore::GraphicsContextImplCairo::beginTransparencyLayer): (WebCore::GraphicsContextImplCairo::endTransparencyLayer): (WebCore::GraphicsContextImplCairo::clip): (WebCore::GraphicsContextImplCairo::clipOut): (WebCore::GraphicsContextImplCairo::clipPath): (WebCore::GraphicsContextImplCairo::applyDeviceScaleFactor): * platform/graphics/cairo/GraphicsContextImplCairo.h: Added. 2017-11-14 Zan Dobersek [Cairo] Clean up CairoOperations, GradientCairo, GraphicsContextCairo implementation files https://bugs.webkit.org/show_bug.cgi?id=179679 Reviewed by Michael Catanzaro. Clean up random tidbits in the CairoOperations, GradientCairo and GraphicsContextCairo implementation files that I've been ravaging through over the last few days. No new tests -- no change in behavior. * platform/graphics/cairo/CairoOperations.cpp: Add a missing include, drop an unnecessary empty line. (WebCore::Cairo::drawLine): * platform/graphics/cairo/GradientCairo.cpp: Add a missing CairoOperations.h include. * platform/graphics/cairo/GraphicsContextCairo.cpp: Drop unnecessary includes and a bunch of redundant helper functions. (WebCore::GraphicsContext::drawLineForText): Inline the DashArray object construction into the relay call. (WebCore::GraphicsContext::drawLinesForText): size_t can't be negative, so just check for DashArray being empty. (WebCore::fillRectWithColor): Deleted. (): Deleted. (WebCore::drawPathShadow): Deleted. (WebCore::fillCurrentCairoPath): Deleted. (WebCore::shadowAndFillCurrentCairoPath): Deleted. (WebCore::shadowAndStrokeCurrentCairoPath): Deleted. 2017-11-14 Michael Catanzaro Unreviewed, another attempt to fix builds after r224707 https://bugs.webkit.org/show_bug.cgi?id=179499 * PlatformWin.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2017-11-14 Ryan Haddad Unreviewed, rolling out r224860. This change broke the macOS and iOS builds. Reverted changeset: "Unreviewed, fix CMake debug builds after r224707" https://bugs.webkit.org/show_bug.cgi?id=179499 https://trac.webkit.org/changeset/224860 2017-11-14 Antti Koivisto Media query with :host inside a custom elements doesn't get updated on window resize https://bugs.webkit.org/show_bug.cgi?id=176101 Reviewed by Simon Fraser. If a media query containing :host or ::slotted stops applying we fail to update the style. * style/StyleScope.cpp: (WebCore::Style::invalidateHostAndSlottedStyleIfNeeded): Factor into function. (WebCore::Style::Scope::updateActiveStyleSheets): (WebCore::Style::Scope::scheduleUpdate): Invalidate elements that may match :host and ::slotted before clearing style resolver for full update. 2017-11-14 Carlos Garcia Campos Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h https://bugs.webkit.org/show_bug.cgi?id=173793 Reviewed by Brian Burg. Based on patch by Brian Burg. * ForwardingHeaders/inspector/InspectorValues.h: Removed. * Modules/encryptedmedia/InitDataRegistry.cpp: (WebCore::extractKeyIDsKeyids): (WebCore::sanitizeKeyids): * html/parser/XSSAuditorDelegate.cpp: (WebCore::XSSAuditorDelegate::generateViolationReport): * inspector/CommandLineAPIHost.cpp: (WebCore::CommandLineAPIHost::inspect): * inspector/CommandLineAPIHost.h: * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::recordAction): (WebCore::InspectorCanvas::releaseData): (WebCore::InspectorCanvas::indexForData): (WebCore::buildArrayForVector): (WebCore::InspectorCanvas::buildInitialState): (WebCore::InspectorCanvas::buildAction): (WebCore::InspectorCanvas::buildArrayForCanvasGradient): (WebCore::InspectorCanvas::buildArrayForCanvasPattern): (WebCore::InspectorCanvas::buildArrayForImageData): (WebCore::InspectorCanvas::buildArrayForImageBitmap): * inspector/InspectorCanvas.h: * inspector/InspectorDatabaseResource.cpp: * inspector/InspectorOverlay.cpp: (WebCore::evaluateCommandInOverlay): (WebCore::InspectorOverlay::evaluateInOverlay): * inspector/InspectorOverlay.h: * inspector/InspectorShaderProgram.h: * inspector/InspectorStyleSheet.h: (WebCore::InspectorCSSId::InspectorCSSId): * inspector/TimelineRecordFactory.cpp: (WebCore::TimelineRecordFactory::createGenericRecord): (WebCore::TimelineRecordFactory::createFunctionCallData): (WebCore::TimelineRecordFactory::createConsoleProfileData): (WebCore::TimelineRecordFactory::createProbeSampleData): (WebCore::TimelineRecordFactory::createEventDispatchData): (WebCore::TimelineRecordFactory::createGenericTimerData): (WebCore::TimelineRecordFactory::createTimerInstallData): (WebCore::TimelineRecordFactory::createEvaluateScriptData): (WebCore::TimelineRecordFactory::createTimeStampData): (WebCore::TimelineRecordFactory::createAnimationFrameData): (WebCore::createQuad): (WebCore::TimelineRecordFactory::createPaintData): (WebCore::TimelineRecordFactory::appendLayoutRoot): * inspector/TimelineRecordFactory.h: * inspector/agents/InspectorApplicationCacheAgent.cpp: * inspector/agents/InspectorApplicationCacheAgent.h: * inspector/agents/InspectorCSSAgent.cpp: (WebCore::computePseudoClassMask): (WebCore::InspectorCSSAgent::setStyleText): (WebCore::InspectorCSSAgent::setRuleSelector): (WebCore::InspectorCSSAgent::forcePseudoState): * inspector/agents/InspectorCSSAgent.h: * inspector/agents/InspectorDOMAgent.cpp: (WebCore::parseColor): (WebCore::parseConfigColor): (WebCore::parseQuad): (WebCore::InspectorDOMAgent::performSearch): (WebCore::InspectorDOMAgent::setSearchingForNode): (WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject): (WebCore::InspectorDOMAgent::setInspectModeEnabled): (WebCore::InspectorDOMAgent::highlightRect): (WebCore::InspectorDOMAgent::highlightQuad): (WebCore::InspectorDOMAgent::innerHighlightQuad): (WebCore::InspectorDOMAgent::highlightSelector): (WebCore::InspectorDOMAgent::highlightNode): (WebCore::InspectorDOMAgent::highlightNodeList): (WebCore::InspectorDOMAgent::highlightFrame): * inspector/agents/InspectorDOMAgent.h: * inspector/agents/InspectorDOMDebuggerAgent.cpp: (WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr): (WebCore::InspectorDOMDebuggerAgent::willInsertDOMNode): (WebCore::InspectorDOMDebuggerAgent::willRemoveDOMNode): (WebCore::InspectorDOMDebuggerAgent::willModifyDOMAttr): (WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent): (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded): (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest): * inspector/agents/InspectorDOMDebuggerAgent.h: * inspector/agents/InspectorDOMStorageAgent.cpp: (WebCore::InspectorDOMStorageAgent::getDOMStorageItems): (WebCore::InspectorDOMStorageAgent::setDOMStorageItem): (WebCore::InspectorDOMStorageAgent::removeDOMStorageItem): (WebCore::InspectorDOMStorageAgent::findStorageArea): * inspector/agents/InspectorDOMStorageAgent.h: * inspector/agents/InspectorDatabaseAgent.cpp: * inspector/agents/InspectorIndexedDBAgent.cpp: (WebCore::Inspector::idbKeyFromInspectorObject): (WebCore::Inspector::idbKeyRangeFromKeyRange): (WebCore::InspectorIndexedDBAgent::requestData): * inspector/agents/InspectorIndexedDBAgent.h: * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::buildObjectForHeaders): (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse): (WebCore::InspectorNetworkAgent::setExtraHTTPHeaders): * inspector/agents/InspectorNetworkAgent.h: * inspector/agents/InspectorPageAgent.cpp: * inspector/agents/InspectorPageAgent.h: * inspector/agents/InspectorTimelineAgent.cpp: (WebCore::InspectorTimelineAgent::setInstruments): (WebCore::InspectorTimelineAgent::internalStart): (WebCore::InspectorTimelineAgent::didInvalidateLayout): (WebCore::InspectorTimelineAgent::willLayout): (WebCore::InspectorTimelineAgent::didScheduleStyleRecalculation): (WebCore::InspectorTimelineAgent::willRecalculateStyle): (WebCore::InspectorTimelineAgent::willComposite): (WebCore::InspectorTimelineAgent::willPaint): (WebCore::InspectorTimelineAgent::addRecordToTimeline): (WebCore::InspectorTimelineAgent::setFrameIdentifier): (WebCore::InspectorTimelineAgent::appendRecord): (WebCore::InspectorTimelineAgent::sendEvent): (WebCore::InspectorTimelineAgent::createRecordEntry): (WebCore::InspectorTimelineAgent::pushCurrentRecord): * inspector/agents/InspectorTimelineAgent.h: * page/csp/ContentSecurityPolicy.cpp: (WebCore::ContentSecurityPolicy::reportViolation const): * platform/encryptedmedia/clearkey/CDMClearKey.cpp: (WebCore::parseJSONObject): (WebCore::parseLicenseFormat): (WebCore::parseLicenseReleaseAcknowledgementFormat): (WebCore::CDMInstanceClearKey::updateLicense): (WebCore::CDMInstanceClearKey::removeSessionData): * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp: (WebCore::extractSinfData): * testing/Internals.cpp: 2017-11-14 Michael Catanzaro Unreviewed, fix CMake debug builds after r224707 https://bugs.webkit.org/show_bug.cgi?id=179499 * PlatformWin.cmake: * Sources.txt: 2017-11-14 Michael Catanzaro Another attempt to fix GTK/WPE debug builds https://bugs.webkit.org/show_bug.cgi?id=179660 * platform/graphics/cairo/NativeImageCairo.cpp: (WebCore::drawNativeImage): 2017-11-14 Alex Christensen Fix Windows build. * html/canvas/WebGLRenderingContext.h: 2017-11-14 Chris Dumez [Service Workers] Implement container.getRegistrations() https://bugs.webkit.org/show_bug.cgi?id=179672 Reviewed by Brady Eidson. Implement container.getRegistrations(): - https://w3c.github.io/ServiceWorker/#dom-serviceworkercontainer-getregistrations No new tests, rebaselined existing test. * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::getRegistration): (WebCore::ServiceWorkerContainer::getRegistrations): (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration): * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerRegistration.cpp: (WebCore::ServiceWorkerRegistration::getOrCreate): * workers/service/ServiceWorkerRegistration.h: * workers/service/ServiceWorkerRegistrationKey.cpp: (WebCore::ServiceWorkerRegistrationKey::isMatching const): (WebCore::ServiceWorkerRegistrationKey::originIsMatching const): * workers/service/ServiceWorkerRegistrationKey.h: * workers/service/server/SWClientConnection.h: * workers/service/server/SWServer.cpp: (WebCore::SWServer::getRegistrations): * workers/service/server/SWServer.h: 2017-11-14 Alex Christensen Fix Windows build. * html/canvas/WebGLRenderingContext.h: 2017-11-14 Michael Catanzaro Unreviewed, fix GTK/WPE debug builds even better after r224813 https://bugs.webkit.org/show_bug.cgi?id=179660 * platform/graphics/cairo/NativeImageCairo.cpp: (WebCore::drawNativeImage): 2017-11-14 Michael Catanzaro Unreviewed, fix GTK/WPE debug builds after r224813 https://bugs.webkit.org/show_bug.cgi?id=179660 * platform/graphics/cairo/NativeImageCairo.cpp: (WebCore::drawNativeImage): 2017-11-14 Youenn Fablet Implement ServiceWorker handle fetch for navigation loads https://bugs.webkit.org/show_bug.cgi?id=179404 Reviewed by Alex Christensen and Chris Dumez. Covered by rebased tests. Step 11 of https://w3c.github.io/ServiceWorker/#on-fetch-request-algorithm is implemented in DocumentLoader as it centralizes main request loading and knows about the context of it. For each main resource load in document loader, we first check whether there is a matching service worker. The fetch request is updated accordingly so that there is no difference in the handling of navigation vs. subresource requests after that point. Updated DocumentThreadableLoader::didReceiveResponse since it can now receive responses from service worker with various response types. A follow-up patch should properly handle cross origin responses. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::commitData): (WebCore::DocumentLoader::startLoadingMainResource): (WebCore::DocumentLoader::doLoadingMainResource): * loader/DocumentLoader.h: * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::didReceiveResponse): * loader/cache/CachedResourceRequest.cpp: (WebCore::CachedResourceRequest::setNavigationServiceWorkerRegistrationData): * loader/cache/CachedResourceRequest.h: * platform/MIMETypeRegistry.h: * platform/network/cocoa/WebCoreNSURLSession.mm: (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): 2017-11-14 Alex Christensen Log moveFile failure errors https://bugs.webkit.org/show_bug.cgi?id=179695 Reviewed by Brady Eidson. Content extension tests are flaky. In r224790 I added logs to find out why, and they indicate that moveFile is failing. To further understand why, I'm adding logs to see what's happening sometimes on the bots. * platform/cocoa/FileSystemCocoa.mm: (WebCore::FileSystem::moveFile): 2017-11-14 Dean Jackson Fix Windows build. * html/OffscreenCanvas.cpp: * html/OffscreenCanvas.h: * html/OffscreenCanvas.idl: 2017-11-14 Alex Christensen Remove Cocoa CFURLConnection loading code https://bugs.webkit.org/show_bug.cgi?id=179688 Reviewed by Antti Koivisto. CFURLConnection is only used on the AppleWin port now. * PlatformMac.cmake: * SourcesCocoa.txt: * SourcesIOS.txt: * WebCore.xcodeproj/project.pbxproj: * loader/DocumentLoader.h: * loader/EmptyFrameLoaderClient.h: * loader/FrameLoaderClient.h: * loader/ResourceLoader.cpp: * loader/ResourceLoader.h: * loader/SubresourceLoader.h: * loader/cf/ResourceLoaderCFNet.cpp: * loader/cocoa/SubresourceLoaderCocoa.mm: * loader/mac/DocumentLoaderMac.cpp: * loader/mac/ResourceLoaderMac.mm: * page/mac/PageMac.mm: (WebCore::Page::platformInitialize): (WebCore::Page::addSchedulePair): (WebCore::Page::removeSchedulePair): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge): (WebCore::WebCoreNSURLAuthenticationChallengeClient::create): Deleted. (WebCore::WebCoreNSURLAuthenticationChallengeClient::WebCoreNSURLAuthenticationChallengeClient): Deleted. (): Deleted. * platform/network/ProtectionSpaceBase.cpp: * platform/network/ResourceHandle.h: * platform/network/ResourceHandleInternal.h: * platform/network/cf/AuthenticationCF.cpp: (WebCore::AuthenticationChallenge::AuthenticationChallenge): (WebCore::createCF): (WebCore::core): (): Deleted. * platform/network/cf/AuthenticationCF.h: * platform/network/cf/CookieJarCFNet.cpp: (WebCore::copyCookiesForURLWithFirstPartyURL): (WebCore::createCookies): (WebCore::deleteAllCookiesModifiedSince): * platform/network/cf/CookieStorageCFNet.cpp: * platform/network/cf/CredentialStorageCFNet.cpp: (WebCore::CredentialStorage::getFromPersistentStorage): * platform/network/cf/ResourceErrorCF.cpp: (WebCore::ResourceError::setCertificate): (WebCore::ResourceError::platformLazyInit): (WebCore::ResourceError::doPlatformIsolatedCopy): (WebCore::ResourceError::cfError const): * platform/network/cf/ResourceHandleCFNet.cpp: * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp: * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp: (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::setupRequest): (WebCore::installHookToRemoveCFNetworkMessageBlockingMainThread): (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::setupConnectionScheduling): (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse): (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse): (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace): * platform/network/cocoa/CredentialCocoa.mm: (WebCore::Credential::cfCredential const): Deleted. * platform/network/cocoa/ProtectionSpaceCocoa.mm: (WebCore::ProtectionSpace::cfSpace const): Deleted. * platform/network/cocoa/ResourceRequestCocoa.mm: (WebCore::ResourceRequest::nsURLRequest const): (WebCore::ResourceRequest::clearOrUpdateNSURLRequest): Deleted. * platform/network/cocoa/ResourceResponseCocoa.mm: (WebCore::ResourceResponse::platformCertificateInfo const): (WebCore::ResourceResponse::ResourceResponse): Deleted. * platform/network/ios/ResourceHandleIOS.mm: Removed. * platform/network/mac/AuthenticationMac.mm: (WebCore::AuthenticationChallenge::authenticationClient const): (WebCore::mac): (-[WebCoreAuthenticationClientAsChallengeSender setCFChallenge:]): Deleted. (-[WebCoreAuthenticationClientAsChallengeSender cfChallenge]): Deleted. * platform/network/mac/ResourceHandleMac.mm: (WebCore::synchronousWillSendRequestEnabled): * platform/network/mac/ResourceRequestMac.mm: Removed. 2017-11-14 Daniel Bates Update comment in FeatureDefines.xcconfig to reflect location of Visual Studio property files for feature defines Following r195498 and r201917 the Visual Studio property files for feature defines have moved from directory WebKitLibraries/win/tools/vsprops to directory Source/cmake/tools/vsprops. Update the comment in FeatureDefines.xcconfig to reflect the new location and names of these files. * Configurations/FeatureDefines.xcconfig: 2017-11-14 Antti Koivisto Remove StyleResolver::State::document() https://bugs.webkit.org/show_bug.cgi?id=179678 Reviewed by Antoine Quint. We don't need both StyleResolver::document() and StyleResolver::State::document(). * css/StyleResolver.cpp: (WebCore::StyleResolver::State::updateConversionData): (WebCore::StyleResolver::resolvedVariableValue): (WebCore::StyleResolver::colorFromPrimitiveValue const): (WebCore::StyleResolver::createFilterOperations): * css/StyleResolver.h: (WebCore::StyleResolver::State::document const): Deleted. 2017-11-14 Dean Jackson Stub implementations of OffscreenCanvas getContext and transferToImageBitmap https://bugs.webkit.org/show_bug.cgi?id=179671 Reviewed by Antoine Quint. Empty implementations of getContext and transferToImageBitmap. At the moment only return a WebGLRenderingContext from getContext, since we don't have an Offscreen 2d context type yet. Tests: http/wpt/offscreen-canvas/getContext-webgl.html http/wpt/offscreen-canvas/transferToImageBitmap.html * html/OffscreenCanvas.cpp: (WebCore::OffscreenCanvas::getContext): (WebCore::OffscreenCanvas::transferToImageBitmap): * html/OffscreenCanvas.h: * html/OffscreenCanvas.idl: * html/canvas/GPUBasedCanvasRenderingContext.h: Drive-by parameter rename. (WebCore::GPUBasedCanvasRenderingContext::GPUBasedCanvasRenderingContext): 2017-11-14 Youenn Fablet WebSWClientConnection should do IPC to StorageProcess if its WebSWOriginTable is not yet initialized https://bugs.webkit.org/show_bug.cgi?id=179668 Reviewed by Chris Dumez. Covered by existing updated tests. Removing hasServiceWorkerRegisteredForOrigin and using hasServiceWorkerRegistration instead. The former is only checking the shared map which might not be initialized at the time the function is called. The latter is going to the StorageProcess if the map is not yet initialized. * testing/Internals.cpp: (WebCore::Internals::hasServiceWorkerRegisteredForOrigin): Deleted. * testing/Internals.h: * testing/Internals.idl: * workers/service/server/SWClientConnection.h: 2017-11-14 Joseph Pecoraro Web Inspector: Add a ServiceWorker domain to get information about an inspected ServiceWorker https://bugs.webkit.org/show_bug.cgi?id=179640 Reviewed by Devin Rousso. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * inspector/InspectorAllInOne.cpp: New files. * inspector/WorkerInspectorController.cpp: (WebCore::WorkerInspectorController::createLazyAgents): Add a ServiceWorkerAgent when the Worker is a ServiceWorker. * inspector/agents/worker/ServiceWorkerAgent.h: Added. * inspector/agents/worker/ServiceWorkerAgent.cpp: Added. (WebCore::ServiceWorkerAgent::ServiceWorkerAgent): (WebCore::ServiceWorkerAgent::didCreateFrontendAndBackend): (WebCore::ServiceWorkerAgent::willDestroyFrontendAndBackend): (WebCore::ServiceWorkerAgent::getInitializationInfo): Populate initialization info. 2017-11-14 Brady Eidson Remove some accidentally checked-in commented-out code. Unreviewed. * workers/service/server/SWServer.cpp: (WebCore::SWServer::fireInstallEvent): (WebCore::SWServer::fireActivateEvent): 2017-11-14 Alex Christensen Clean up old URL parser remnants https://bugs.webkit.org/show_bug.cgi?id=179573 Reviewed by Darin Adler. When we transitioned to the new URLParser, we kept the old character tables which were less spec-conformant. Removing them and transitioning to URLParser's table makes more web platform tests pass! * fileapi/BlobURL.cpp: (WebCore::BlobURL::createBlobURL): There's no need to percent-encode an origin. It's already ascii, and if it's not, then the URLParser will escape it. * loader/appcache/ApplicationCacheHost.cpp: (WebCore::ApplicationCacheHost::createFileURL): Removed comment that no longer applies. * platform/URL.cpp: (WebCore::URL::setProtocol): (WebCore::percentEncodeCharacters): (WebCore::URL::setUser): (WebCore::URL::setPass): Percent encode the userinfo character set from the URLParser according to https://url.spec.whatwg.org/#set-the-username and https://url.spec.whatwg.org/#set-the-password (WebCore::URL::setPath): A ? or a # are the only two characters that need to be pre-encoded when setting the path because they indicate the beginning of a query or fragment. All other characters will be encoded if necessary during parsing. (WebCore::protocolIsInternal): (): Deleted. (WebCore::isSchemeFirstChar): Deleted. (WebCore::isSchemeChar): Deleted. (WebCore::isBadChar): Deleted. (WebCore::isTabNewline): Deleted. (WebCore::appendEscapedChar): Deleted. (WebCore::encodeWithURLEscapeSequences): Encode characters needed. I used the user info set of characters because that was most similar to the BadChar set of the old parser. This isn't standardized, and it's only used for the search context menu item which certainly isn't standardized. (WebCore::isValidProtocol): Deleted. Remove a bunch of old unused functions. * platform/URLParser.cpp: (WebCore::URLParser::isInUserInfoEncodeSet): (WebCore::URLParser::parseAuthority): * platform/URLParser.h: Expose a few functions for URL.cpp to use. 2017-11-14 Antti Koivisto Enable display:contents by default https://bugs.webkit.org/show_bug.cgi?id=179655 Reviewed by Sam Weinig. * page/RuntimeEnabledFeatures.h: 2017-11-14 Zan Dobersek [Cairo] Move drawLine operation from GraphicsContextCairo to CairoOperations https://bugs.webkit.org/show_bug.cgi?id=179669 Reviewed by Carlos Garcia Campos. Move the drawLine operation implementation into the CairoOperations implementation file, with the Cairo::drawLine() function only expecting a PlatformContextCairo object, two FloatingPoints, and a const reference to a GraphicsContextState object. As with drawLinesForText(), the drawLine() implementation utilized a few private GraphicsContext methods that we for now reimplement in the Cairo namespace as static functions, providing necessary state values to perform the computations. The GraphicsContext methods should be changed to become static public functions -- after that we'll be able to remove the new duplicated helper functions. No new tests -- no change in behavior. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::dashedLineCornerWidthForStrokeWidth): (WebCore::Cairo::dashedLinePatternWidthForStrokeWidth): (WebCore::Cairo::dashedLinePatternOffsetForPatternAndStrokeWidth): (WebCore::Cairo::centerLineAndCutOffCorners): (WebCore::Cairo::drawLine): * platform/graphics/cairo/CairoOperations.h: * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::drawLine): 2017-11-14 Tim Horton Long pressing a phone number with spaces in it results in a link sheet instead of a data detectors sheet https://bugs.webkit.org/show_bug.cgi?id=179646 Reviewed by Simon Fraser. * editing/cocoa/DataDetection.h: * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::canBePresentedByDataDetectors): (WebCore::DataDetection::isDataDetectorLink): Expose canBePresentedByDataDetectors, which tests if the URL's scheme is one of Data Detectors' known long-press schemes. 2017-11-14 Michael Catanzaro [GTK][WPE] Don't require brotli https://bugs.webkit.org/show_bug.cgi?id=178122 Reviewed by Frédéric Wang. Remove stray remaining use of brotli CMake variable. * CMakeLists.txt: 2017-11-14 Zan Dobersek [Cairo] Move drawLinesForText operation from GraphicsContextCairo to CairoOperations https://bugs.webkit.org/show_bug.cgi?id=179661 Reviewed by Carlos Garcia Campos. Encapsulate the drawLinesForText() operation in the WebCore::Cairo namespace. Apart from moving gist of the code from GraphicsContextCairo to CairoOperations, we also (for the moment) have to duplicate the GraphicsContext::computeLineBoundsAndAntialiasingModeForText() code. This is necessary because the given method is private on the GraphicsContext class, and relies on an underlying GraphicsContext object to retrieve the current CTM and stroke thickness values. The adjusted reimplementation uses PlatformContextCairo to retrieve the CTM (just like Cairo's GraphicsContext::getCTM() does), and requires the stroke thickness value to be passed in as an argument. Similar modifications will be proposed for the existing GraphicsContext::computeLineBoundsAndAntialiasingModeForText() code, and once that's approved the duplicated code will be eliminated. No new tests -- no change in behavior. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::computeLineBoundsAndAntialiasingModeForText): (WebCore::Cairo::drawLinesForText): * platform/graphics/cairo/CairoOperations.h: * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::drawLinesForText): 2017-11-14 Zan Dobersek [Cairo] Move native image drawing operation to CairoOperations https://bugs.webkit.org/show_bug.cgi?id=179660 Reviewed by Carlos Garcia Campos. Unify the native image drawing operation behavior between the Cairo-specific GraphicsContext and drawNativeImage() implementations and then move the code into the Cairo::drawNativeImage() function, inside the CairoOperations implementation file. No new tests -- no change in behavior. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::cairoSurfaceHasAlpha): (WebCore::Cairo::drawNativeImage): * platform/graphics/cairo/CairoOperations.h: * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::drawNativeImage): * platform/graphics/cairo/NativeImageCairo.cpp: (WebCore::drawNativeImage): 2017-11-14 Zan Dobersek [Cairo] Perform GraphicsContextPlatformPrivate method calls from CairoOperations https://bugs.webkit.org/show_bug.cgi?id=179657 Reviewed by Carlos Garcia Campos. To enable encapsulating remaining Cairo operations in static functions inside the WebCore::Cairo namespace, we have to work around the GraphicsContextPlatformPrivate methods that are invoked in the current GraphicsContext implementation for Cairo. A pointer to the GraphicsContextPlatformPrivate object is now kept on the PlatformContextCairo instance, and we take care of setting it up and clearing it out appropriate to the GraphicsContextPlatformPrivate lifetime (as managed in Cairo-specific GraphicsContext implementation). The GraphicsContextPlatformPrivate method invocations are then moved to the appropriate CairoOperations functions. No new tests -- no change in behavior. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::State::setCTM): (WebCore::Cairo::save): (WebCore::Cairo::restore): (WebCore::Cairo::translate): (WebCore::Cairo::rotate): (WebCore::Cairo::scale): (WebCore::Cairo::concatCTM): (WebCore::Cairo::clip): (WebCore::Cairo::clipPath): * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::GraphicsContext): (WebCore::GraphicsContext::platformInit): (WebCore::GraphicsContext::platformDestroy): (WebCore::GraphicsContext::savePlatformState): (WebCore::GraphicsContext::restorePlatformState): (WebCore::GraphicsContext::clip): (WebCore::GraphicsContext::clipPath): (WebCore::GraphicsContext::translate): (WebCore::GraphicsContext::concatCTM): (WebCore::GraphicsContext::setCTM): (WebCore::GraphicsContext::rotate): (WebCore::GraphicsContext::scale): * platform/graphics/cairo/PlatformContextCairo.h: (WebCore::PlatformContextCairo::graphicsContextPrivate): (WebCore::PlatformContextCairo::setGraphicsContextPrivate): 2017-11-14 Zan Dobersek [Cairo] Move simpler draw operations from GraphicsContextCairo to CairoOperations https://bugs.webkit.org/show_bug.cgi?id=179614 Reviewed by Carlos Garcia Campos. Move operations that perform simpler drawing to the CairoOperations file. This isolates the Cairo code and encapsulates operation work into a limited scope. This patch only covers drawing patterns, rectangles, document marker lines and ellipses. A missing forward declaration for the drawGlyphs() function is also added in the CairoOperations header. No new tests -- no change in behavior. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::drawPattern): (WebCore::Cairo::drawRect): (WebCore::Cairo::drawLineForDocumentMarker): (WebCore::Cairo::drawEllipse): * platform/graphics/cairo/CairoOperations.h: * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::drawRect): (WebCore::GraphicsContext::drawEllipse): (WebCore::GraphicsContext::drawLineForDocumentMarker): (WebCore::GraphicsContext::drawPattern): 2017-11-13 Joseph Pecoraro Give a ServiceWorker WebContentProcess a different display name https://bugs.webkit.org/show_bug.cgi?id=179653 Reviewed by Brady Eidson. * English.lproj/Localizable.strings: 2017-11-13 Chris Dumez Send ServiceWorkerData structs to the WebProcesses instead of ServiceWorkerIdentifiers https://bugs.webkit.org/show_bug.cgi?id=179649 Reviewed by Brady Eidson. Send ServiceWorkerData structs to the WebProcesses instead of ServiceWorkerIdentifiers so that the WebProcesses can correctly construct ServiceWorker objects, with the right attributes / state. No new tests, rebaselined existing tests. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * workers/service/ServiceWorker.cpp: (WebCore::ServiceWorker::getOrCreate): (WebCore::ServiceWorker::ServiceWorker): (WebCore::ServiceWorker::~ServiceWorker): (WebCore::ServiceWorker::scheduleTaskToUpdateState): (WebCore::ServiceWorker::postMessage): * workers/service/ServiceWorker.h: * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::scheduleTaskToUpdateRegistrationState): * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerData.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerRegistrationData.cpp. (WebCore::ServiceWorkerData::isolatedCopy const): * workers/service/ServiceWorkerData.h: Copied from Source/WebCore/workers/service/server/SWServerWorker.cpp. (WebCore::ServiceWorkerData::encode const): (WebCore::ServiceWorkerData::decode): * workers/service/ServiceWorkerRegistration.cpp: (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration): (WebCore::ServiceWorkerRegistration::updateStateFromServer): * workers/service/ServiceWorkerRegistration.h: * workers/service/ServiceWorkerRegistrationData.cpp: (WebCore::ServiceWorkerRegistrationData::isolatedCopy const): * workers/service/ServiceWorkerRegistrationData.h: (WebCore::ServiceWorkerRegistrationData::encode const): (WebCore::ServiceWorkerRegistrationData::decode): * workers/service/server/SWClientConnection.cpp: (WebCore::SWClientConnection::postMessageToServiceWorkerClient): (WebCore::SWClientConnection::updateRegistrationState): * workers/service/server/SWClientConnection.h: * workers/service/server/SWServer.h: * workers/service/server/SWServerRegistration.cpp: (WebCore::SWServerRegistration::updateRegistrationState): (WebCore::SWServerRegistration::data const): * workers/service/server/SWServerWorker.cpp: (WebCore::SWServerWorker::SWServerWorker): (WebCore::m_script): * workers/service/server/SWServerWorker.h: (WebCore::SWServerWorker::scriptURL const): (WebCore::SWServerWorker::type const): (WebCore::SWServerWorker::identifier const): (WebCore::SWServerWorker::state const): (WebCore::SWServerWorker::setState): (WebCore::SWServerWorker::data const): 2017-11-13 Ryosuke Niwa iOS: Enable release asserts in updateStyleIfNeeded() and updateLayout() for WebKit2 https://bugs.webkit.org/show_bug.cgi?id=179651 Reviewed by Antti Koivisto. r224604 disabled the release assertions on iOS entirely even though the underlying bug only affected iOS WebKit1 port due to various time constraints. Enable them back on iOS WebKit2 port. * dom/Document.cpp: (WebCore::isSafeToUpdateStyleOrLayout): (WebCore::Document::updateStyleIfNeeded): (WebCore::Document::updateLayout): 2017-11-13 Brady Eidson Massive "Server-process-to-context-process" connection overhaul. https://bugs.webkit.org/show_bug.cgi?id=179554 Reviewed by Chris Dumez. No new tests (Refactor, no behavior change). Having the SWServer::Connection object be overloaded to mean both client->server and server->context was the wrong design and was starting to crumble under its own weight. So this patch introduces a SWServerToContextConnection to manage the StorageProcess-side of connections to context processes. Any message that is specifically about the connection between the StorageProcess and context process should use this connection going forward. Right now there is only one context process, but this design keeps us ready for that to change. This patch also gets rid of a lot of "server connection identifier" integers being passed amongst processes that were actually pointless. This patch is also a prerequisite for many things that are coming up soon, such as termination. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * workers/service/ServiceWorkerContextData.cpp: (WebCore::ServiceWorkerContextData::isolatedCopy const): * workers/service/ServiceWorkerContextData.h: (WebCore::ServiceWorkerContextData::encode const): (WebCore::ServiceWorkerContextData::decode): * workers/service/ServiceWorkerGlobalScope.cpp: (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope): * workers/service/ServiceWorkerGlobalScope.h: (WebCore::ServiceWorkerGlobalScope::serverConnectionIdentifier const): Deleted. * workers/service/ServiceWorkerTypes.h: * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::ServiceWorkerThread): (WebCore::ServiceWorkerThread::createWorkerGlobalScope): * workers/service/context/ServiceWorkerThread.h: (WebCore::ServiceWorkerThread::serverConnectionIdentifier const): Deleted. * workers/service/context/ServiceWorkerThreadProxy.cpp: (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy): (WebCore::ServiceWorkerThreadProxy::create): Deleted. * workers/service/context/ServiceWorkerThreadProxy.h: * workers/service/server/SWServer.cpp: (WebCore::generateServiceWorkerIdentifier): (WebCore::SWServer::~SWServer): (WebCore::SWServer::SWServer): (WebCore::SWServer::scriptContextFailedToStart): (WebCore::SWServer::scriptContextStarted): (WebCore::SWServer::didFinishInstall): (WebCore::SWServer::didFinishActivation): (WebCore::SWServer::didResolveRegistrationPromise): (WebCore::SWServer::updateWorker): (WebCore::SWServer::serverToContextConnectionCreated): (WebCore::SWServer::installContextData): (WebCore::SWServer::fireInstallEvent): (WebCore::SWServer::fireActivateEvent): (WebCore::SWServer::Connection::didFinishInstall): Deleted. (WebCore::SWServer::Connection::didFinishActivation): Deleted. (WebCore::SWServer::Connection::setServiceWorkerHasPendingEvents): Deleted. (WebCore::SWServer::Connection::scriptContextFailedToStart): Deleted. (WebCore::SWServer::Connection::scriptContextStarted): Deleted. (WebCore::SWServer::setServiceWorkerHasPendingEvents): Deleted. * workers/service/server/SWServer.h: * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::scriptContextFailedToStart): (WebCore::SWServerJobQueue::scriptContextStarted): (WebCore::SWServerJobQueue::install): (WebCore::SWServerJobQueue::didResolveRegistrationPromise): (WebCore::SWServerJobQueue::didFinishInstall): (WebCore::SWServerJobQueue::tryActivate): (WebCore::SWServerJobQueue::activate): * workers/service/server/SWServerJobQueue.h: * workers/service/server/SWServerRegistration.cpp: (WebCore::generateServiceWorkerRegistrationIdentifier): * workers/service/server/SWServerToContextConnection.cpp: Added. (WebCore::generateServerToContextConnectionIdentifier): (WebCore::SWServerToContextConnection::SWServerToContextConnection): (WebCore::SWServerToContextConnection::~SWServerToContextConnection): (WebCore::SWServerToContextConnection::connectionForIdentifier): (WebCore::SWServerToContextConnection::globalServerToContextConnection): (WebCore::SWServerToContextConnection::scriptContextFailedToStart): (WebCore::SWServerToContextConnection::scriptContextStarted): (WebCore::SWServerToContextConnection::didFinishInstall): (WebCore::SWServerToContextConnection::didFinishActivation): (WebCore::SWServerToContextConnection::setServiceWorkerHasPendingEvents): * workers/service/server/SWServerToContextConnection.h: Copied from Source/WebCore/workers/service/server/SWServerWorker.h. (WebCore::SWServerToContextConnection::identifier const): * workers/service/server/SWServerWorker.cpp: (WebCore::SWServerWorker::existingWorkerForIdentifier): (WebCore::SWServerWorker::SWServerWorker): (WebCore::SWServerWorker::~SWServerWorker): (WebCore::SWServerWorker::scriptContextFailedToStart): (WebCore::SWServerWorker::scriptContextStarted): (WebCore::SWServerWorker::didFinishInstall): (WebCore::SWServerWorker::didFinishActivation): * workers/service/server/SWServerWorker.h: (WebCore::SWServerWorker::create): (WebCore::SWServerWorker::registrationKey const): (WebCore::SWServerWorker::contextConnectionIdentifier const): 2017-11-13 Don Olmstead Unreviewed build fix after r224791. * platform/network/NetworkStorageSessionStub.cpp: (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession): Deleted. 2017-11-13 Simon Fraser Minor DisplayRefreshMonitor-related cleanup https://bugs.webkit.org/show_bug.cgi?id=179648 Reviewed by Alex Christensen. Use more "#pragma once" and C++ initializers. Make more member functions of DisplayRefreshMonitor protected. Improve the ordering of member variables. Don't mix member variables and member functions in the declaration of ScriptedAnimationController. * dom/ScriptedAnimationController.h: * platform/graphics/DisplayRefreshMonitor.cpp: (WebCore::DisplayRefreshMonitor::DisplayRefreshMonitor): (WebCore::DisplayRefreshMonitor::displayDidRefresh): * platform/graphics/DisplayRefreshMonitor.h: (WebCore::DisplayRefreshMonitor::mutex): * platform/graphics/DisplayRefreshMonitorManager.h: * platform/graphics/mac/DisplayRefreshMonitorMac.cpp: (WebCore::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac): * platform/graphics/mac/DisplayRefreshMonitorMac.h: 2017-11-13 Simon Fraser When navigating back to a page, compositing layers may not use accelerated drawing https://bugs.webkit.org/show_bug.cgi?id=178749 rdar://problem/35158946 Reviewed by Dean Jackson. There were two issues with setting GraphicsLayerCA's "acceleratesDrawing" state which occurred on back navigation, related to the ordering of style recalcs and layout. First, at style recalc time, we created a RenderLayerCompositor but hadn't yet called its cacheAcceleratedCompositingFlags(), so any layers created during style update didn't get accelerated drawing. Fix by making cacheAcceleratedCompositingFlags() internal to RenderLayerCompositor and calling it from willRecalcStyle() and updateCompositingLayers(). We have to be careful to avoid m_forceCompositingMode flip-flopping between cacheAcceleratedCompositingFlags() and cacheAcceleratedCompositingFlagsAfterLayout(), since, for subframes, it depends on layout. Secondly, GraphicsLayerCA::commitLayerChangesBeforeSublayers() needs to updateAcceleratesDrawing() before updating tiles, so that new tiles fetch the right acceleratesDrawing state from the TileController. Test: compositing/accelerated-layers-after-back.html * page/FrameView.cpp: (WebCore::FrameView::updateCompositingLayersAfterLayout): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::willRecalcStyle): (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout): (WebCore::RenderLayerCompositor::updateCompositingLayers): * rendering/RenderLayerCompositor.h: 2017-11-13 Youenn Fablet matchRegistration does not need to go to StorageProcess if no service worker is registered https://bugs.webkit.org/show_bug.cgi?id=179480 Reviewed by Chris Dumez. Covered by existing tests. Moving the origin store in SWServer since they share the same session ID. This allows updating the origin store based on each registration map update. This also allows clearing the origin store when clearing the SWServer. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * workers/service/server/SWOriginStore.cpp: Added. (WebCore::SWOriginStore::add): (WebCore::SWOriginStore::remove): (WebCore::SWOriginStore::clear): (WebCore::SWOriginStore::clearAll): * workers/service/server/SWOriginStore.h: Added. * workers/service/server/SWServer.cpp: (WebCore::SWServer::addRegistration): (WebCore::SWServer::removeRegistration): (WebCore::SWServer::OriginStore::add): (WebCore::SWServer::OriginStore::remove): (WebCore::SWServer::OriginStore::clear): (WebCore::SWServer::OriginStore::clearAll): (WebCore::SWServer::clearAll): (WebCore::SWServer::clear): (WebCore::SWServer::SWServer): * workers/service/server/SWServer.h: (WebCore::SWServer::originStore): 2017-11-13 Alex Christensen Merge NetworkProcess::EnsurePrivateBrowsingSession and NetworkProcess::AddWebsiteDataStore into one message type https://bugs.webkit.org/show_bug.cgi?id=178751 Reviewed by Brady Eidson. The creation of private browsing sessions and persistent browsing sessions has evolved to be the same thing with differences in parameters, like no sandbox extensions or paths to persistent storage locations for private browsing. These should be united to simplify future development of WebsiteDataStore construction. * platform/network/NetworkStorageSession.h: * platform/network/cf/NetworkStorageSessionCFNet.cpp: (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession): Deleted. * platform/network/soup/NetworkStorageSessionSoup.cpp: (WebCore::NetworkStorageSession::ensureSession): (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession): Deleted. 2017-11-07 Brian Burg Web Automation: inViewCenterPoint should not include topContentInset when computed in viewport coordinates https://bugs.webkit.org/show_bug.cgi?id=179129 Reviewed by Simon Fraser. Add or export some helpers needed to compute element layout for WebDriver. * dom/Element.h: Export the non-DOM version of getClientBounds(). * page/FrameView.h: * page/FrameView.cpp: (WebCore::FrameView::clientToDocumentRect const): Added. This does the same thing as clientToDocumentPoint. Export it, too. 2017-11-13 Joseph Pecoraro Web Inspector: Include a NetworkAgent in ServiceWorkers for network debugging https://bugs.webkit.org/show_bug.cgi?id=179513 Reviewed by Brian Burg. In order to show Network requests for a ServiceWorker, we need to add inspector networking hooks for Worker loads. While we show Network requests for DedicatedWorkers, we do that through the Page during Page inspection. In ServiceWorker inspection, the remote connection is connected to the ServiceWorkerThreadProxy, and interacts with the WorkerGlobalScope without making any assumptions about a Page existing. We don't want to make any assumptions about a Page/Document being needed for Network hooks, so we should add new hooks that will work in the WorkerGlobalScope's context. This patch adds InspectorInstrumentation networking hooks for workers inside of the WorkerThreadableLoader bridge. This is where the majority of Worker initiated network requests happen (Fetch/XHR, but not WebSockets). The hooks are simpler versions of the existing network hooks for a Page, and allow for complete inspector networking information (will send, did receive response, did receive data, success, failure, and timing metrics). This patch generalizes InspectorNetworkAgent to work for a Page and Worker. Some of the existing functionality was specific to a Page (frameId/loaderId) but did not make sense for a Worker. In order to handle these cases, all of the unique logic was extracted out into virtual methods that subclasses PageNetworkAgent and WorkerNetworkAgent provide as appropriate. The majority of NetworkAgent remains unchanged and algorithms are shared. We needed to change the existing InspectorInstrumentation networking hooks to allow for an optional DocumentLoader. This way we can keep all of the same hooks leading inside of NetworkAgent, but loads for a Page will have a DocumentLoader, and loads for a ServiceWorker will not. While the WorkerNetworkAgent would work for a DedicatedWorker, we still only create it for a ServiceWorker. The existing behavior of showing Network loads for a DedicatedWorker will continue to go through the Page inspector so we can avoid creating a NetworkAgent for DedicatedWorkers. If we created a way to directly inspect a DedicatedWorker we could look at making this always available, but it would require extra work to function perfectly. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * inspector/InspectorAllInOne.cpp: Add new files. * inspector/InspectorController.cpp: (WebCore::InspectorController::InspectorController): (WebCore::InspectorController::createLazyAgents): Switch from InspectorNetworkAgent to PageNetworkAgent. * inspector/WorkerInspectorController.h: * inspector/WorkerInspectorController.cpp: (WebCore::WorkerInspectorController::WorkerInspectorController): (WebCore::WorkerInspectorController::workerAgentContext): (WebCore::WorkerInspectorController::createLazyAgents): Create a WorkerNetworkAgent when inside of a ServiceWorker. Also start the lazy agent pattern for agents that can defer creation until a frontend attached. (WebCore::WorkerInspectorController::connectFrontend): (WebCore::WorkerInspectorController::disconnectFrontend): When frontends connect/disconnect toggle the necessary states. Also start the execution stopwatch, otherwise it will always be at 0. * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::willSendRequestImpl): (WebCore::InspectorInstrumentation::willSendRequestOfTypeImpl): (WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCacheImpl): (WebCore::InspectorInstrumentation::didReceiveResourceResponseImpl): (WebCore::InspectorInstrumentation::didFinishLoadingImpl): (WebCore::InspectorInstrumentation::didFailLoadingImpl): (WebCore::InspectorInstrumentation::frameDetachedFromParentImpl): * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::willSendRequest): (WebCore::InspectorInstrumentation::didReceiveResourceResponse): (WebCore::InspectorInstrumentation::didReceiveData): (WebCore::InspectorInstrumentation::didFinishLoading): (WebCore::InspectorInstrumentation::didFailLoading): Add Worker networking hooks that pass through to the same general hooks. * loader/WorkerThreadableLoader.cpp: (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveResponse): (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveData): (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishLoading): (WebCore::WorkerThreadableLoader::MainThreadBridge::didFail): (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishTiming): * loader/WorkerThreadableLoader.h: Use the new worker networking instrumentation hooks. * loader/ThreadableLoader.cpp: (WebCore::ThreadableLoader::create): Drive-by: use a move. * inspector/agents/InspectorNetworkAgent.h: * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::InspectorNetworkAgent): (WebCore::InspectorNetworkAgent::willSendRequest): (WebCore::InspectorNetworkAgent::willSendRequestOfType): (WebCore::InspectorNetworkAgent::didReceiveResponse): (WebCore::InspectorNetworkAgent::didFinishLoading): (WebCore::InspectorNetworkAgent::didFailLoading): (WebCore::InspectorNetworkAgent::didLoadResourceFromMemoryCache): (WebCore::InspectorNetworkAgent::buildInitiatorObject): (WebCore::InspectorNetworkAgent::enable): (WebCore::InspectorNetworkAgent::disable): (WebCore::InspectorNetworkAgent::setResourceCachingDisabled): (WebCore::InspectorNetworkAgent::loadResource): (WebCore::InspectorNetworkAgent::webSocketForRequestId): (WebCore::InspectorNetworkAgent::resolveWebSocket): (WebCore::InspectorNetworkAgent::mainFrameNavigated): Extract logic for subclasses. Transition to DocumentLoader being null. * inspector/agents/page/PageNetworkAgent.h: * inspector/agents/page/PageNetworkAgent.cpp: Added. (WebCore::PageNetworkAgent::PageNetworkAgent): (WebCore::PageNetworkAgent::loaderIdentifier): (WebCore::PageNetworkAgent::frameIdentifier): (WebCore::PageNetworkAgent::setResourceCachingDisabled): (WebCore::PageNetworkAgent::scriptExecutionContext): Extracted Page implementation. This is just moving from the original. * inspector/agents/worker/WorkerNetworkAgent.h: * inspector/agents/worker/WorkerNetworkAgent.cpp: (WebCore::WorkerNetworkAgent::WorkerNetworkAgent): (WebCore::WorkerNetworkAgent::loaderIdentifier): (WebCore::WorkerNetworkAgent::frameIdentifier): (WebCore::WorkerNetworkAgent::setResourceCachingDisabled): (WebCore::WorkerNetworkAgent::scriptExecutionContext): Implement for a worker. * inspector/agents/worker/WorkerDebuggerAgent.cpp: (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent): * inspector/agents/worker/WorkerConsoleAgent.cpp: (WebCore::WorkerConsoleAgent::WorkerConsoleAgent): * inspector/agents/worker/WorkerRuntimeAgent.cpp: (WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent): Add some assertions for all Worker agents for clarify. * workers/WorkerDebuggerProxy.h: * workers/WorkerGlobalScope.h: (WebCore::WorkerGlobalScope::identifier const): (WebCore::WorkerGlobalScope::createUniqueIdentifier): Provide a way to get unique identifiers in a worker. For the Page this is done through the Page's ProgressTracker. For a Worker we just put this on the WorkerGlobalScope. This is used for request ids. * workers/WorkerMessagingProxy.h: * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::setResourceCachingDisabled): * workers/service/context/ServiceWorkerThreadProxy.h: * workers/service/context/ServiceWorkerThreadProxy.cpp: (WebCore::ServiceWorkerThreadProxy::setResourceCachingDisabled): Add a debug method for disabling the resource cache from a worker. In service workers this sets the override flag on the hidden page. 2017-11-08 Keith Miller Async iteration should only fetch the next method once and add feature flag https://bugs.webkit.org/show_bug.cgi?id=179451 Reviewed by Geoffrey Garen. Add feature flag for Async iteration. * Configurations/FeatureDefines.xcconfig: 2017-11-13 Alex Christensen Call willPerformHTTPRedirection on WebCoreNSURLSession's delegate https://bugs.webkit.org/show_bug.cgi?id=179539 Reviewed by Jer Noble. This is now possible! This will allow AVFoundation to fix redirect-related bugs. * platform/network/cocoa/WebCoreNSURLSession.mm: (-[WebCoreNSURLSession addDelegateOperation:]): (-[WebCoreNSURLSession resetWithCompletionHandler:]): (-[WebCoreNSURLSession flushWithCompletionHandler:]): (WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived): (-[WebCoreNSURLSessionDataTask resource:shouldCacheResponse:]): (-[WebCoreNSURLSessionDataTask resource:receivedData:length:]): (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:completionHandler:]): (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:]): Deleted. 2017-11-13 Chris Dumez Add some more assertions in SWServerJobQueue https://bugs.webkit.org/show_bug.cgi?id=179626 Reviewed by Alex Christensen. Add some more assertions in SWServerJobQueue for extra safety. * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::didResolveRegistrationPromise): (WebCore::SWServerJobQueue::didFinishInstall): 2017-11-13 Per Arne Vollan The css properties stroke-width/stroke-color and -webkit-text-stroke-width/-webkit-text-stroke-color should not be mixed. https://bugs.webkit.org/show_bug.cgi?id=174737 Reviewed by Antti Koivisto. Previously, the stroke width and stroke color would independently fall back to the -webkit-text-stroke-width and -webkit-text-stroke-color values if stroke-width and/or stroke-color were not explicitly specified. This is problematic, since we might end up mixing the new stroke properties with the legacy Webkit stroke properties. The new strategy is to use the stroke-width and stroke-color value combination only if stroke-color has been explicitly specified. This should work well, since there will be no visible stroke when specifying only stroke-width (because stroke-color by default is transparent). We can then safely fall back to the legacy Webkit stroke value combination. In the case where only stroke-color is specified, we should use the stroke-width/ stroke-color combination, since stroke-width by default is 1, and we will then have a visible stroke. No new tests, existing tests have been updated to reflect behavior changes. * rendering/TextDecorationPainter.cpp: (WebCore::decorationColor): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): (WebCore::computeTextSelectionPaintStyle): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::computedStrokeWidth const): (WebCore::RenderStyle::hasPositiveStrokeWidth const): (WebCore::RenderStyle::computedStrokeColor const): * rendering/style/RenderStyle.h: 2017-11-13 Gabriel Ivascu [GTK] Automatically adjust font size when gtk-xft-dpi changes https://bugs.webkit.org/show_bug.cgi?id=142673 Reviewed by Michael Catanzaro. * platform/PlatformScreen.h: * platform/gtk/PlatformScreenGtk.cpp: (WebCore::gtkXftDPIChangedCallback): (WebCore::setScreenDPIObserverHandler): * platform/wpe/PlatformScreenWPE.cpp: (WebCore::setScreenDPIObserverHandler): 2017-11-13 Commit Queue Unreviewed, rolling out r224763. https://bugs.webkit.org/show_bug.cgi?id=179632 test fails on iOS (Requested by alexchristensen on #webkit). Reverted changeset: "Add tests to ensure that tags are only preloaded when the `type`" https://bugs.webkit.org/show_bug.cgi?id=179231 https://trac.webkit.org/changeset/224763 2017-11-13 Antti Koivisto Don't eliminate whitespace renderer if the previous sibling is a text renderer https://bugs.webkit.org/show_bug.cgi?id=179620 Reviewed by Zalan Bujtas. Currently whitespace elimination code doesn't consider runs of text renderers. We should always make whitespace renderer if the previous renderer is a text renderer. The behavior should be the same as if those were a single renderer with merged text. This situation can happen easily with display:contents. This fixes the remaining flexbox failures in display:contents tests. * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::textRendererIsNeeded): We need a renderer if the previous rendere is RenderText. 2017-11-13 Chris Dumez Implement "Service Worker Has No Pending Events" / "Update Service Worker Extended Events Set" algorithms https://bugs.webkit.org/show_bug.cgi?id=179618 Reviewed by Brady Eidson. Implement "Service Worker Has No Pending Events" / "Update Service Worker Extended Events Set" algorithms: - https://w3c.github.io/ServiceWorker/#service-worker-has-no-pending-events-algorithm - https://w3c.github.io/ServiceWorker/#update-service-worker-extended-events-set-algorithm Test: http/tests/workers/service/basic-unregister-then-register-again-reuse.html * workers/service/context/SWContextManager.h: * workers/service/context/ServiceWorkerFetch.cpp: (WebCore::ServiceWorkerFetch::dispatchFetchEvent): * workers/service/context/ServiceWorkerFetch.h: * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::postFetchTask): (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope): (WebCore::ServiceWorkerThread::updateExtendedEventsSet): * workers/service/context/ServiceWorkerThread.h: * workers/service/server/SWServer.cpp: (WebCore::SWServer::Connection::setServiceWorkerHasPendingEvents): (WebCore::SWServer::setServiceWorkerHasPendingEvents): * workers/service/server/SWServer.h: * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::tryActivate): (WebCore::SWServerJobQueue::tryClearRegistration): * workers/service/server/SWServerWorker.h: (WebCore::SWServerWorker::hasPendingEvents const): (WebCore::SWServerWorker::setHasPendingEvents): 2017-11-13 Colin Bendell Added mime type check to the picture source preloader to avoid downloading incompatible resources. https://bugs.webkit.org/show_bug.cgi?id=179231 Reviewed by Alex Christensen. Test: http/tests/loading/preload-picture-type.html * html/parser/HTMLPreloadScanner.cpp: (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): include type match state when selecting candidate imgs (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): added type attribute evaluation and matching 2017-11-13 Antoine Quint [Web Animations] Implement getAnimations() https://bugs.webkit.org/show_bug.cgi?id=179535 Reviewed by Simon Fraser. We now allow a list of animations for a document, with Document.getAnimations(), or for an element, with Animatable.getAnimations(), to be returned. In order to support this, we maintain a map on AnimationTimeline of all animations for a given element. This map is invalidated when an animation's timeline changes and when an animation's effect changes. Note that the Web Animations spec mandates that an AnimationEffect can only be a single animation's effect. Tests: http/wpt/wk-web-animations/interfaces/document-get-animations.html http/wpt/wk-web-animations/interfaces/element-get-animations.html http/wpt/wk-web-animations/timing-model/animation-effect-unique-relationship.html * CMakeLists.txt: Add Animatable.idl. * DerivedSources.make: Add Animatable.idl. * WebCore.xcodeproj/project.pbxproj: Add Animatable.idl. * animation/Animatable.idl: A new interface that Element implements and which currently only exposes getAnimations(), the animate() method will be added later. * animation/AnimationEffect.h: Add a new m_animation member to reference the animation using this effect. This relationship is required so we guarantee that an effect is associated with a single animation at most. (WebCore::AnimationEffect::animation const): (WebCore::AnimationEffect::setAnimation): * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::animationWasAddedToElement): New method to notify the timeline that an animation registered with this timeline has been associated with a new element through its effect. (WebCore::AnimationTimeline::animationWasRemovedFromElement): New method to notify the timeline that an animation registered with this timeline has been disassociated with an element through its effect. (WebCore::AnimationTimeline::animationsForElement): New method returning all animations registered with this timeline for a given element. * animation/AnimationTimeline.h: (WebCore::AnimationTimeline::animations const): All animations registered with this timeline. * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::DocumentTimeline): (WebCore::DocumentTimeline::detachFromDocument): Clear the reference between this timeline and its document. (WebCore::DocumentTimeline::currentTime): Protect against a null Document reference. (WebCore::DocumentTimeline::createDisplayRefreshMonitor const): Protect against a null Document reference. * animation/DocumentTimeline.h: * animation/WebAnimation.cpp: (WebCore::WebAnimation::create): (WebCore::WebAnimation::setEffect): As an animation's effect changes, we need to ensure that the old effect no longer has an associated animation, and that the new effect is associated with this animation. Additionally, we update the element-to-animations map on the animation's timeline. (WebCore::WebAnimation::setTimeline): Update the element-to-animations map on the former and new timeline. * dom/Document.cpp: (WebCore::Document::prepareForDestruction): Clear the relationship between this document and its timeline. (WebCore::Document::getAnimations): Obtain all animations associated with this document's timeline. * dom/Document.h: * dom/Document.idl: * dom/Element.cpp: (WebCore::Element::getAnimations): Obtain all animations associated with this element. * dom/Element.h: * dom/Element.idl: * testing/Internals.cpp: * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * animation/Animatable.idl: * animation/AnimationEffect.h: (WebCore::AnimationEffect::animation const): (WebCore::AnimationEffect::setAnimation): * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::animationWasAddedToElement): (WebCore::AnimationTimeline::animationWasRemovedFromElement): (WebCore::AnimationTimeline::animationsForElement): * animation/AnimationTimeline.h: (WebCore::AnimationTimeline::animations const): * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::DocumentTimeline): (WebCore::DocumentTimeline::detachFromDocument): (WebCore::DocumentTimeline::currentTime): (WebCore::DocumentTimeline::createDisplayRefreshMonitor const): * animation/DocumentTimeline.h: * animation/WebAnimation.cpp: (WebCore::WebAnimation::create): (WebCore::WebAnimation::setEffect): (WebCore::WebAnimation::setTimeline): * dom/Document.cpp: (WebCore::Document::prepareForDestruction): (WebCore::Document::getAnimations): * dom/Document.h: * dom/Document.idl: * dom/Element.cpp: (WebCore::Element::getAnimations): * dom/Element.h: * dom/Element.idl: * testing/Internals.cpp: 2017-11-13 Alex Christensen Make DocumentLoader::willSendRequest asynchronous https://bugs.webkit.org/show_bug.cgi?id=179549 Reviewed by Tim Horton. No change in behavior, except now redirects will wait for PolicyChecker::checkNavigationPolicy's completion handler. Before, they would just continue in DocumentLoader::redirectReceived hoping the client had responded to decidePolicyForNavigationAction synchronously or that the client would have been ok with continuing. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::redirectReceived): (WebCore::DocumentLoader::willSendRequest): (WebCore::DocumentLoader::startLoadingMainResource): * loader/DocumentLoader.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadURL): (WebCore::FrameLoader::loadWithDocumentLoader): * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): * loader/PolicyChecker.h: 2017-11-13 Wenson Hsieh [Attachment Support] Implement SPI for clients to request data for a given attachment https://bugs.webkit.org/show_bug.cgi?id=179586 Reviewed by Darin Adler. Adds support in WebCore for fetching data for a given attachment element. See per-method comments below for more detail. Test coverage by augmenting existing API tests in WKAttachmentTests, and adding 3 new tests. * dom/Document.cpp: (WebCore::Document::didInsertAttachmentElement): (WebCore::Document::didRemoveAttachmentElement): (WebCore::Document::attachmentForIdentifier const): Fetches an attachment element matching the given identifier. Using the identifier => attachment element map here allows us to avoid the cost of walking the DOM in search for HTMLAttachmentElements every time data is requested. * dom/Document.h: Add a map of attachment identifier => HTMLAttachmentElement in Document. This map is updated when attachment elements are connected to or disconnected from the document. Additionally, delegate attachment insertion and removal out to the Editor if possible. * editing/Editor.cpp: (WebCore::Editor::insertAttachmentFromFile): * editing/mac/WebContentReaderMac.mm: (WebCore::WebContentReader::readFilenames): * editing/markup.cpp: (WebCore::createFragmentFromMarkup): Tweak existing logic that transfers file-backed File objects when deserializing HTMLAttachmentElements from markup to handle the case where the attachment element is not file-backed. In this case, we construct a new File object using the deserializing constructor. To do this, we use the attachment element's blob URL to make sure that the new File references an existing blob matching that URL. * html/HTMLAttachmentElement.cpp: (WebCore::AttachmentDataReader::create): (WebCore::AttachmentDataReader::AttachmentDataReader): Introduce AttachmentDataReader, a helper class local to HTMLAttachmentElement that is responsible for loading an attachment element's file and invoking a given callback when loading has succeeded or failed. Each AttachmentDataReader is retained exclusively by its HTMLAttachmentElement, through the HTMLAttachmentElement's vector of unique_ptrs to AttachmentDataReaders. (WebCore::HTMLAttachmentElement::~HTMLAttachmentElement): (WebCore::HTMLAttachmentElement::blobURL const): Add a convenience getter for the blob URL of the attachment's backing File object. (WebCore::HTMLAttachmentElement::setFile): When setting an attachment element's file, set the blob URL attribute as well to the blob URL. Also, tweak this to take a RefPtr&& instead of a raw File*. (WebCore::HTMLAttachmentElement::insertedIntoAncestor): (WebCore::HTMLAttachmentElement::removedFromAncestor): Instead of delegating attachment insertion and removal to the Editor, just call out to the Document, which will now call out to the Editor. (WebCore::HTMLAttachmentElement::attachmentPath const): Add a convenience getter for the attachment path attribute. (WebCore::HTMLAttachmentElement::requestData): (WebCore::HTMLAttachmentElement::destroyReader): Called when a AttachmentDataReader has completed (either with success or failure), and is ready to be removed from the attachment element's list of active data readers. (WebCore::AttachmentDataReader::~AttachmentDataReader): (WebCore::AttachmentDataReader::didFinishLoading): (WebCore::AttachmentDataReader::didFail): (WebCore::AttachmentDataReader::invokeCallbackAndFinishReading): When the reader is done loading, or has failed, or is about to be destroyed, fire the callback with loaded data (if any) and cancel the FileReaderLoader. * html/HTMLAttachmentElement.h: * html/HTMLAttributeNames.in: Adds a new "webkitattachmentbloburl" attribute that keeps track of an attachment element's file's blob URL. This is used to ensure that information about an attachment element's file is not lost between certain editing operations (for instance, deleting a line break) that involve serializing and then deserializing markup into DocumentFragments to then insert. 2017-11-13 Zan Dobersek [Cairo] Remove GraphicsContext::mustUseShadowBlur() https://bugs.webkit.org/show_bug.cgi?id=179612 Reviewed by Michael Catanzaro. Remove the Cairo-specific mustUseShadowBlur() method on the GraphicsContext class. It can now be implemented as a static function in CairoOperations, using only a PlatformContextCairo object and a const reference to the relevant GraphicsContextState. No new tests -- no change in behavior. * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::mustUseShadowBlur const): Deleted. * platform/graphics/GraphicsContext.h: * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::mustUseShadowBlur): (WebCore::Cairo::drawGlyphsShadow): (WebCore::Cairo::fillRectWithRoundedHole): (WebCore::Cairo::drawGlyphs): * platform/graphics/cairo/CairoOperations.h: * platform/graphics/cairo/FontCairo.cpp: (WebCore::FontCascade::drawGlyphs): * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::fillRectWithRoundedHole): 2017-11-13 Zan Dobersek [Cairo] Move state change operations from GraphicsContextCairo to CairoOperations https://bugs.webkit.org/show_bug.cgi?id=179610 Reviewed by Carlos Garcia Campos. Move operations that perform Cairo state changes to the CairoOperations file. This enforces only using the PlatformContextCairo object to achieve the state change, leveraging the cairo_t and ShadowBlur objects that are owned by PlatformContextCairo. Along with state modification operations, various state query operations are also placed under the Cairo::State namespace, again limited to the PlatformContextCairo object. No new tests -- no change in behavior. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::State::setStrokeThickness): (WebCore::Cairo::State::setGlobalAlpha): (WebCore::Cairo::State::setCompositeOperation): (WebCore::Cairo::State::setShouldAntialias): (WebCore::Cairo::State::setImageInterpolationQuality): (WebCore::Cairo::State::setCTM): (WebCore::Cairo::State::getCTM): (WebCore::Cairo::State::setShadowValues): (WebCore::Cairo::State::clearShadow): (WebCore::Cairo::State::getClipBounds): (WebCore::Cairo::State::roundToDevicePixels): (WebCore::Cairo::State::isAcceleratedContext): * platform/graphics/cairo/CairoOperations.h: * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::getCTM const): (WebCore::GraphicsContext::restorePlatformState): (WebCore::GraphicsContext::clipBounds const): (WebCore::GraphicsContext::roundToDevicePixels): (WebCore::GraphicsContext::setPlatformStrokeThickness): (WebCore::GraphicsContext::setCTM): (WebCore::GraphicsContext::setPlatformShadow): (WebCore::GraphicsContext::clearPlatformShadow): (WebCore::GraphicsContext::setPlatformAlpha): (WebCore::GraphicsContext::setPlatformCompositeOperation): (WebCore::GraphicsContext::setPlatformShouldAntialias): (WebCore::GraphicsContext::setPlatformImageInterpolationQuality): (WebCore::GraphicsContext::isAcceleratedContext const): 2017-11-13 Zan Dobersek [Cairo] Move glyph drawing operations from FontCairo to CairoOperations https://bugs.webkit.org/show_bug.cgi?id=179609 Reviewed by Carlos Garcia Campos. Move operations that perform glyph drawing to the CairoOperations file. This limits operations to only work with a PlatformContextCairo object, along with other required parameters, and will help with future work that will rely on isolated Cairo-specific code. Along with moving the drawGlyphs() code, the helper functions are moved and adjusted to work specifically on a PlatformContextCairo object and a const GraphicsContextState reference, only using a GraphicsContext reference for any required shadowed glyph drawing. No new tests -- no change in behavior. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::drawGlyphsToContext): (WebCore::Cairo::drawGlyphsShadow): (WebCore::Cairo::drawGlyphs): * platform/graphics/cairo/FontCairo.cpp: (WebCore::FontCascade::drawGlyphs): (WebCore::drawGlyphsToContext): Deleted. (WebCore::drawGlyphsShadow): Deleted. 2017-11-13 Zan Dobersek [Cairo] Move focus ring drawing operations from GraphicsContextCairo to CairoOperations https://bugs.webkit.org/show_bug.cgi?id=179603 Reviewed by Carlos Garcia Campos. Move operations that perform focus ring drawing to the CairoOperations file. This limits operations to only work with a PlatformContextCairo object, along with other required parameters, and will help with future work in this area. The Cairo::State namespace is introduced, with the setStrokeStyle() function placed there. The namespace will be used for operations that only change an aspect of the Cairo state. More functions will be added soon, and existing line and miter operations will likely move there as well. No new tests -- no change in behavior. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::adjustFocusRingColor): (WebCore::Cairo::adjustFocusRingLineWidth): (WebCore::Cairo::focusRingStrokeStyle): (WebCore::Cairo::State::setStrokeStyle): (WebCore::Cairo::drawFocusRing): * platform/graphics/cairo/CairoOperations.h: * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::drawFocusRing): (WebCore::GraphicsContext::setPlatformStrokeStyle): (WebCore::adjustFocusRingColor): Deleted. (WebCore::adjustFocusRingLineWidth): Deleted. (WebCore::focusRingStrokeStyle): Deleted. 2017-11-13 Carlos Garcia Campos Unreviewed. Fix debug build with Touch Events enabled after r224740. * dom/EventContext.cpp: (WebCore::TouchEventContext::checkReachability const): 2017-11-12 Maciej Stachowiak Remove support for UTF-32 variant text encodings https://bugs.webkit.org/show_bug.cgi?id=179435 Reviewed by Darin Adler. Non-support for these encodings is covered by WPT tests. * platform/text/TextCodecICU.cpp: Remove UTF-32 variants. Technically, we should also ensure that UTF-32LE with a BOM gets sniffed as UTF-16LE instead of windows-1252. Chrome does this but Firefox doesn't yet. WPT tests cover it, and we can fix it later. 2017-11-12 Zan Dobersek [Cairo] Move rectangle and path filling, stroking, clearing operations in GraphicsContextCairo to CairoOperations https://bugs.webkit.org/show_bug.cgi?id=179599 Reviewed by Carlos Garcia Campos. Move operations that perform filling, stroking and clearing for specified rectangles and paths to the CairoOperations file. This limits operations to only work with a PlatformContextCairo object, along with any required parameter, and will help with future work in this area. Helper functions are copied along for the time being, but will later be removed from the GraphicsContextCairo implementation file. No new tests -- no change in behavior. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::fillRectWithColor): (WebCore::Cairo::drawPathShadow): (WebCore::Cairo::fillCurrentCairoPath): (WebCore::Cairo::fillRect): (WebCore::Cairo::fillRoundedRect): (WebCore::Cairo::fillRectWithRoundedHole): (WebCore::Cairo::fillPath): (WebCore::Cairo::strokeRect): (WebCore::Cairo::strokePath): (WebCore::Cairo::clearRect): * platform/graphics/cairo/CairoOperations.h: * platform/graphics/cairo/GradientCairo.cpp: (WebCore::Gradient::fill): * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::fillPath): (WebCore::GraphicsContext::strokePath): (WebCore::GraphicsContext::fillRect): (WebCore::GraphicsContext::clearRect): (WebCore::GraphicsContext::strokeRect): (WebCore::GraphicsContext::platformFillRoundedRect): (WebCore::GraphicsContext::fillRectWithRoundedHole): 2017-11-12 Zan Dobersek [Cairo] Move state stack, CTM, transparency layer operations in GraphicsContextCairo to CairoOperations https://bugs.webkit.org/show_bug.cgi?id=179598 Reviewed by Carlos Garcia Campos. Move operations that save and restore state, adjust CTM and modify the transparency layer stack to the CairoOperations file. This limits operations to only work with a PlatformContextCairo object, along with any required parameter, and will help with future work in this area. No new tests -- no change in behavior. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::save): (WebCore::Cairo::restore): (WebCore::Cairo::translate): (WebCore::Cairo::rotate): (WebCore::Cairo::scale): (WebCore::Cairo::concatCTM): (WebCore::Cairo::beginTransparencyLayer): (WebCore::Cairo::endTransparencyLayer): * platform/graphics/cairo/CairoOperations.h: * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::savePlatformState): (WebCore::GraphicsContext::restorePlatformState): (WebCore::GraphicsContext::translate): (WebCore::GraphicsContext::concatCTM): (WebCore::GraphicsContext::beginPlatformTransparencyLayer): (WebCore::GraphicsContext::endPlatformTransparencyLayer): (WebCore::GraphicsContext::rotate): (WebCore::GraphicsContext::scale): 2017-11-12 Zan Dobersek [Cairo] Move line, miter operations in GraphicsContextCairo to CairoOperations https://bugs.webkit.org/show_bug.cgi?id=179597 Reviewed by Carlos Garcia Campos. Move operations that adjust line cap, line dash, line join and miter limit to the CairoOperations file. This limits operations to only work with a PlatformContextCairo object, along with any required parameter, and will help with future work in this area. No new tests -- no change in behavior. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::setLineCap): (WebCore::Cairo::setLineDash): (WebCore::Cairo::setLineJoin): (WebCore::Cairo::setMiterLimit): * platform/graphics/cairo/CairoOperations.h: * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::setLineCap): (WebCore::GraphicsContext::setLineDash): (WebCore::GraphicsContext::setLineJoin): (WebCore::GraphicsContext::setMiterLimit): (WebCore::isDashArrayAllZero): Deleted. 2017-11-12 Chris Dumez [Service Workers] Activate algorithm says terminate the active worker if it exists https://bugs.webkit.org/show_bug.cgi?id=179559 Reviewed by Darin Adler. Activate algorithm says terminate the active worker if it exists: - https://w3c.github.io/ServiceWorker/#activation-algorithm (Step 2.1) No new tests, no-op for now as the terminate() function is not implemented yet. * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::activate): 2017-11-12 Darin Adler More is<> and downcast<>, less static_cast<> https://bugs.webkit.org/show_bug.cgi?id=179600 Reviewed by Chris Dumez. * Modules/fetch/FetchBody.cpp: (WebCore::FetchBody::extract): Use downcast instead of static_cast. (WebCore::FetchBody::bodyAsFormData const): Ditto. * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::putOrAdd): Ditto. * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp: (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged): Ditto. * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::libWebRTCProvider): Ditto. * accessibility/AccessibilityMediaControls.cpp: (WebCore::AccessibilityMediaTimeDisplay::stringValue const): Got rid of local variable and used std::abs instead of fabsf. Did not use downcast here because it doesn't exist for this class. * bindings/js/JSEventTargetCustom.h: (WebCore::IDLOperation::call): Use downcast instead of toDOMWindow. * dom/DocumentEventQueue.cpp: (WebCore::DocumentEventQueue::dispatchEvent): Ditto. * dom/Element.h: Added is/downcast for EventTarget. * dom/EventContext.cpp: (WebCore::TouchEventContext::checkReachability const): Use downcast instead of toNode. * dom/EventContext.h: (WebCore::EventContext::isUnreachableNode const): Ditto. * dom/EventPath.cpp: (WebCore::shouldEventCrossShadowBoundary): Ditto. (WebCore::EventPath::setRelatedTarget): Ditto. (WebCore::EventPath::retargetTouch): Ditto. (WebCore::EventPath::EventPath): Ditto. * dom/EventTarget.cpp: (WebCore::EventTarget::toNode): Deleted. (WebCore::EventTarget::isNode const): Added. (WebCore::EventTarget::toDOMWindow): Deleted. (WebCore::EventTarget::isMessagePort const): Deleted. This was not used. (WebCore::EventTarget::addEventListener): Use downcast instead of toDOMWindow and toNode. * dom/EventTarget.h: Updated for the above. * dom/MessagePort.h: Deleted unused isMessagePort. * dom/MouseEvent.cpp: (WebCore::MouseEvent::toElement const): Use downcast instead of toNode. Also refactored to make function a little smaller. (WebCore::MouseEvent::fromElement const): Ditto. * dom/MouseRelatedEvent.cpp: (WebCore::MouseRelatedEvent::computeRelativePosition): Use downcast instead of toNode. * dom/Node.cpp: (WebCore::Node::isNode const): Added. (WebCore::Node::toNode): Deleted. * dom/Node.h: Updated for the above. Also added SPECIALIZE_TYPE_TRAITS so we can do is/downcast. * dom/ScopedEventQueue.cpp: (WebCore::ScopedEventQueue::enqueueEvent): Use is instead of toNode. (WebCore::ScopedEventQueue::dispatchEvent const): Use downcast instead of toNode. * dom/make_names.pl: (printTypeHelpers): Added support for is/downcast from EventTarget. * editing/Editor.cpp: (WebCore::Editor::selectionForCommand): Use is/downcast instead of toNode. * editing/EditorCommand.cpp: (WebCore::targetFrame): Ditto. * html/HTMLAnchorElement.cpp: (WebCore::appendServerMapMousePosition): Ditto. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createContextWebGL): Use downcast instead of static_cast. (WebCore::HTMLCanvasElement::getContextWebGL): Ditto. (WebCore::HTMLCanvasElement::getImageData): Ditto. * html/HTMLElement.h: Added support for is/downcast from EventTarget. * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::handleLocalEvents): Use is instead of toNode. (WebCore::submitElementFromEvent): Deleted. Was a duplicate of findSubmitButton. (WebCore::HTMLFormElement::prepareForSubmission): Rewrote code that calls submitElementFromEvent to call findSubmitButton instead. Also don't bother finding the submit button unless we are going to validate, since all we do after finding it is reconsider whether we should validate. (WebCore::HTMLFormElement::findSubmitButton const): Rewrote to use is, downcast, and lineageOfType rather than a handwritten loop and toNode. Relies on the fact that the target is an element, never a text node. * html/HTMLLabelElement.cpp: (WebCore::HTMLLabelElement::defaultEventHandler): Use is and downcast instead of toNode. * html/HTMLPlugInImageElement.cpp: (WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay const): Changed argument type to EventTarget so we can do the type checking and casting here instead of at each of the callers. * html/HTMLPlugInImageElement.h: Updated for the above. * html/HTMLSummaryElement.cpp: (WebCore::isClickableControl): Changed argument type to EventTarget so we can do the type checking and casting here instead of at each of the callers. (WebCore::HTMLSummaryElement::defaultEventHandler): Removed call to toNode. * html/HTMLTextFormControlElement.h: Added support for is/downcast from EventTarget. * html/MediaDocument.cpp: (WebCore::MediaDocument::defaultEventHandler): Use is/downcast instead of toNode. * html/RangeInputType.cpp: (WebCore::RangeInputType::handleMouseDownEvent): Ditto. * html/shadow/MediaControlElements.cpp: (WebCore::MediaControlVolumeSliderContainerElement::defaultEventHandler): Ditto. (WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler): Ditto. Also use get instead of find/end. * html/shadow/MediaControls.cpp: (WebCore::MediaControls::containsRelatedTarget): Use is/downcast instead of toNode. * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::dispatchEventAsContextMenuEvent): Ditto. * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::didAddEventListener): Ditto. (WebCore::InspectorDOMAgent::willRemoveEventListener): Ditto. * page/ContextMenuController.cpp: (WebCore::ContextMenuController::maybeCreateContextMenu): Ditto. * page/DOMWindow.cpp: (WebCore::DOMWindow::toDOMWindow): Deleted. * page/DOMWindow.h: Updated for the above. Also added SPECIALIZE_TYPE_TRAITS so we can do is/downcast. * page/EventHandler.cpp: (WebCore::EventHandler::handleTouchEvent): Use is/downcast instead of toNode. * platform/graphics/WidthCache.h: (WebCore::WidthCache::add): Removed unneeded static_cast; length already returns unsigned. * rendering/RenderSnapshottedPlugIn.cpp: (WebCore::RenderSnapshottedPlugIn::handleEvent): Removed unneeded toNode now that partOfSnapshotOverlay takes an EventTarget. 2017-11-12 Gabriel Ivascu [GTK] Add functionality to handle font sizes in points https://bugs.webkit.org/show_bug.cgi?id=179285 Reviewed by Carlos Garcia Campos and Michael Catanzaro. * platform/PlatformScreen.h: * platform/gtk/PlatformScreenGtk.cpp: (WebCore::screenDPI): * platform/wpe/PlatformScreenWPE.cpp: (WebCore::screenDPI): 2017-11-12 Yusuke Suzuki [WebCore] Implement import.meta.url https://bugs.webkit.org/show_bug.cgi?id=178672 Reviewed by Darin Adler. This patch implements `import.meta.url` field, which holds a base url of the currently executing module[1]. In the case of embedded modules, this field becomes the URL of the embedding HTML file. In the case of imported modules, the URL becomes the URL of the executed module script file. [1]: https://github.com/whatwg/html/pull/3141 * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::moduleLoaderCreateImportMetaProperties): * bindings/js/JSDOMWindowBase.h: * bindings/js/ScriptModuleLoader.cpp: (WebCore::ScriptModuleLoader::moduleURL): (WebCore::ScriptModuleLoader::evaluate): (WebCore::ScriptModuleLoader::createImportMetaProperties): * bindings/js/ScriptModuleLoader.h: 2017-11-11 Dan Bernstein [Xcode] WebCore generates unified sources during installhdrs https://bugs.webkit.org/show_bug.cgi?id=179578 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Use GenerateUnifiedSources.xcconfig, which sets INSTALLHDRS_SCRIPT_PHASE to NO, for the Generate Unified Sources target. 2017-11-11 Simon Fraser Remove redundant platform-specific implementations of Image::drawPattern() https://bugs.webkit.org/show_bug.cgi?id=179580 Reviewed by Sam Weinig. Platform-specific Image files had implementations of Image::drawPattern() but they were all effectively identical, so put a single implementation into Image.cpp. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/SourcesCairo.txt: * platform/graphics/Image.cpp: (WebCore::Image::drawPattern): * platform/graphics/cairo/ImageCairo.cpp: Removed. * platform/graphics/cg/ImageCG.cpp: Removed. * platform/graphics/win/ImageDirect2D.cpp: (WebCore::Image::drawPattern): Deleted. 2017-11-11 Devin Rousso Web Inspector: Canvas tab: show detailed status during canvas recording https://bugs.webkit.org/show_bug.cgi?id=178185 Reviewed by Brian Burg. Updated existing tests to assert that the correct number of progress events are fired. * inspector/agents/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame): After each recorded frame, fire a progress event with the recorded frames as data. This will release the frames from the associated InspectorCanvas, meaning that the frames must be aggregated in the frontend before a Recording can be created. The protocol is designed with arrays so that if we decide to add throttling (e.g. one event per second) we are able to do so without modifying the protocol. * inspector/InspectorCanvas.h: * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::hasRecordingData const): (WebCore::InspectorCanvas::currentFrameHasData const): (WebCore::InspectorCanvas::recordAction): (WebCore::InspectorCanvas::finalizeFrame): (WebCore::InspectorCanvas::markCurrentFrameIncomplete): Add additional checks that the list of recorded frames is not nullptr when finalizing or marking as incomplete. 2017-11-11 Helmut Grohne [GTK] PlatformGTK.cmake: use the PKG_CONFIG_EXECUTABLE variable https://bugs.webkit.org/show_bug.cgi?id=179547 Reviewed by Michael Catanzaro. * PlatformGTK.cmake: Use PKG_CONFIG_EXECUTABLE instead of hardcoding the executable name. 2017-11-10 Chris Dumez [Service Workers] Registration promise should be rejected when the service worker fails to start https://bugs.webkit.org/show_bug.cgi?id=179566 Reviewed by Brady Eidson. Registration promise should be rejected when the service worker fails to start. Though our code intended to do this, there were several issues: - Our code failed to properly detect when the script failed to evaluate. This is because it relied on the exception message being non-null but it was always null when same origin due to a bug. - Our scriptContextFailedToStart() handler failed to rejected the promise and finish the job as per: - https://w3c.github.io/ServiceWorker/#update-algorithm (step 9.7) Test: http/tests/workers/service/worker-fails-to-start.html * bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::evaluate): * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::scriptContextFailedToStart): 2017-11-10 Jer Noble Unreviewed Win Debug build fix; add FourCC.cpp to the cmake source list for Windows. * PlatformWin.cmake: 2017-11-10 Said Abou-Hallawa [CG] PDF document cached image is regenerated every time the destination rectangle changes https://bugs.webkit.org/show_bug.cgi?id=179516 Reviewed by Tim Horton. The PDF document cached image was regenerated if m_cachedImageRect didn't contain the dirty rectangle. When moving the image, its new rectangle is invalidated. This will set a new dirty rectangle outside m_cachedImageRect which may not be fully inside m_cachedImageRect. The PDF document cached image should be reused if we still draw the same part of the image (srcRet did not change) and we use the same zooming factor (dstSize did not change). * platform/graphics/cg/PDFDocumentImage.cpp: (WebCore::PDFDocumentImage::cacheParametersMatch const): Remove a check that was added mainly to force recalculating m_cachedImageRect when the dirty rectangle changes. (WebCore::PDFDocumentImage::updateCachedImageIfNeeded): Recalculate m_cachedImageRect every time this function is called regardless the cached image will be regenerated or not. 2017-11-10 Simon Fraser Compositing layers in UIWebView are often missing content after scrolling https://bugs.webkit.org/show_bug.cgi?id=179564 rdar://problem/33885639 Reviewed by Tim Horton. When dropping backing store for layers outside the viewport, we rely on a compositing layer flush to compute layer visibility and bring the backing store back when necessary. In UIWebView, we have a mechanism to trigger flushing on user scrolling but it only triggers when there are tiled layers. Remove that condition so it triggers always, now that backing store availability also depends on this. * page/ios/FrameIOS.mm: (WebCore::Frame::viewportOffsetChanged): (WebCore::anyFrameHasTiledLayers): Deleted. 2017-11-10 Simon Fraser Contents of composited overflow-scroll are missing when newly added https://bugs.webkit.org/show_bug.cgi?id=179556 rdar://problem/20368294 Reviewed by Tim Horton. When content is appended to an oveflow:scroll, we do a subtree layout. That triggered a compositing code path that failed to call updateAfterDescendants() which is where we compute whether we can be a simple composited layer without backing store. Fix to call that after the updateGeometry() call, as we do elsewhere. Test: compositing/backing/overflow-gains-content.html * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateAfterLayout): 2017-11-10 Simon Fraser Remove the 'CompositingChildrenOnly' flag which was always on https://bugs.webkit.org/show_bug.cgi?id=179546 Reviewed by Antoine Quint. All calls to updateAfterLayout() passed the CompositingChildrenOnly flag, so all calls to updateCompositingDescendantGeometry() had compositedChildrenOnly=true, so remove these flags. Also use an OptionSet<>. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateLayerPositions): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateAfterLayout): (WebCore::RenderLayerBacking::contentChanged): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry): * rendering/RenderLayerCompositor.h: 2017-11-10 Chris Dumez Remove dead code from ServiceWorkerRegistration https://bugs.webkit.org/show_bug.cgi?id=179555 Reviewed by Ryosuke Niwa. * workers/service/ServiceWorkerRegistration.cpp: (WebCore::ServiceWorkerRegistration::setInstallingWorker): Deleted. (WebCore::ServiceWorkerRegistration::setWaitingWorker): Deleted. (WebCore::ServiceWorkerRegistration::setActiveWorker): Deleted. * workers/service/ServiceWorkerRegistration.h: 2017-11-10 Chris Dumez [Service Workers] Implement better support for "Clear Registration" algorithm https://bugs.webkit.org/show_bug.cgi?id=179441 Reviewed by Brady Eidson. Implement better support for "Clear Registration" algorithm as per: - https://w3c.github.io/ServiceWorker/#clear-registration-algorithm In particular, we now properly clear the service workers on the ServiceWorkerRegistration object and we properly update its service workers' state to "redundant". Test: http/tests/workers/service/registration-clear-redundant-worker.html * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::clearRegistration): 2017-11-10 Ryan Haddad Unreviewed, rolling out r224705. Introduced a LayoutTest crash on WK1. Reverted changeset: "[Web Animations] Implement getAnimations()" https://bugs.webkit.org/show_bug.cgi?id=179535 https://trac.webkit.org/changeset/224705 2017-11-10 Jer Noble Add a FairPlay Streaming based CDM for Modern EME https://bugs.webkit.org/show_bug.cgi?id=179499 Reviewed by Eric Carlson. Tests: platform/mac/media/encrypted-media/fps-createMediaKeys.html platform/mac/media/encrypted-media/fps-requestMediaKeySystemAccess.html Add new CDMFairPlayStreaming and CDMInstanceFairPlayStreamingAVFObjC platform classes which implement the basics of FairPlay Streaming support in Modern EME. Drive-by fixes: - Add a != operator to FourCC - Add a virtual setStorageDirectory() method to CDMInstance (and default implementations to CDMClearKey and MockCDM) - Move ISOVTTCue into the platform/graphics/iso directory and update all the places where it is called. * Modules/encryptedmedia/MediaKeySession.cpp: (WebCore::MediaKeySession::mediaKeysStorageDirectory const): * Modules/encryptedmedia/MediaKeySession.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/encryptedmedia/CDMFactory.cpp: * platform/encryptedmedia/CDMInstance.h: * platform/encryptedmedia/CDMRestrictions.h: * platform/encryptedmedia/clearkey/CDMClearKey.cpp: (WebCore::CDMInstanceClearKey::setStorageDirectory): * platform/encryptedmedia/clearkey/CDMClearKey.h: * platform/graphics/FourCC.h: (WebCore::FourCC::operator!= const): * platform/graphics/iso/ISOBox.cpp: Added. (WebCore::ISOBox::peekBox): (WebCore::ISOBox::read): (WebCore::ISOBox::parse): (WebCore::ISOFullBox::parse): * platform/graphics/iso/ISOBox.h: Added. (WebCore::ISOBox::minimumBoxSize): (WebCore::ISOBox::size const): (WebCore::ISOBox::boxType const): (WebCore::ISOBox::extendedType const): (WebCore::ISOBox::checkedRead): (WebCore::ISOFullBox::version const): (WebCore::ISOFullBox::flags const): * platform/graphics/iso/ISOOriginalFormatBox.cpp: Added. (WebCore::ISOOriginalFormatBox::parse): * platform/graphics/iso/ISOOriginalFormatBox.h: Added. (WebCore::ISOOriginalFormatBox::boxTypeName): (WebCore::ISOOriginalFormatBox::dataFormat const): * platform/graphics/iso/ISOProtectionSchemeInfoBox.cpp: Added. (WebCore::ISOProtectionSchemeInfoBox::parse): * platform/graphics/iso/ISOProtectionSchemeInfoBox.h: Added. (WebCore::ISOProtectionSchemeInfoBox::boxTypeName): (WebCore::ISOProtectionSchemeInfoBox::schemeTypeBox const): (WebCore::ISOProtectionSchemeInfoBox::schemeInformationBox const): * platform/graphics/iso/ISOSchemeInformationBox.cpp: Added. (WebCore::ISOSchemeInformationBox::parse): * platform/graphics/iso/ISOSchemeInformationBox.h: Added. (WebCore::ISOSchemeInformationBox::boxTypeName): (WebCore::ISOSchemeInformationBox::schemeSpecificData const): * platform/graphics/iso/ISOSchemeTypeBox.cpp: Added. (WebCore::ISOSchemeTypeBox::parse): * platform/graphics/iso/ISOSchemeTypeBox.h: Added. (WebCore::ISOSchemeTypeBox::boxTypeName): (WebCore::ISOSchemeTypeBox::schemeType const): (WebCore::ISOSchemeTypeBox::schemeVersion const): * platform/graphics/iso/ISOTrackEncryptionBox.cpp: Added. (WebCore::ISOTrackEncryptionBox::parse): * platform/graphics/iso/ISOTrackEncryptionBox.h: Added. (WebCore::ISOTrackEncryptionBox::boxTypeName): (WebCore::ISOTrackEncryptionBox::defaultCryptByteBlock const): (WebCore::ISOTrackEncryptionBox::defaultSkipByteBlock const): (WebCore::ISOTrackEncryptionBox::defaultIsProtected const): (WebCore::ISOTrackEncryptionBox::defaultPerSampleIVSize const): (WebCore::ISOTrackEncryptionBox::defaultKID const): (WebCore::ISOTrackEncryptionBox::defaultConstantIV const): * platform/graphics/iso/ISOVTTCue.cpp: Added. (WebCore::ISOStringBox::contents): (WebCore::vttIdBoxType): (WebCore::vttSettingsBoxType): (WebCore::vttPayloadBoxType): (WebCore::vttCurrentTimeBoxType): (WebCore::vttCueSourceIDBoxType): (WebCore::ISOWebVTTCue::ISOWebVTTCue): (WebCore::ISOWebVTTCue::parse): * platform/graphics/iso/ISOVTTCue.h: Renamed from Source/WebCore/platform/graphics/ISOVTTCue.h. (WebCore::ISOWebVTTCue::boxTypeName): (WebCore::ISOWebVTTCue::presentationTime const): (WebCore::ISOWebVTTCue::duration const): (WebCore::ISOWebVTTCue::sourceID const): (WebCore::ISOWebVTTCue::id const): (WebCore::ISOWebVTTCue::originalStartTime const): (WebCore::ISOWebVTTCue::settings const): (WebCore::ISOWebVTTCue::cueText const): * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp: Added. (WebCore::extractSinfData): (WebCore::extractSchemeAndKeyIdFromSinf): (WebCore::extractKeyIDsSinf): (WebCore::sanitizeSinf): (WebCore::CDMFactory::platformRegisterFactories): (WebCore::CDMFactoryFairPlayStreaming::singleton): (WebCore::CDMFactoryFairPlayStreaming::createCDM): (WebCore::CDMFactoryFairPlayStreaming::supportsKeySystem): (WebCore::CDMPrivateFairPlayStreaming::supportsInitDataType const): (WebCore::CDMPrivateFairPlayStreaming::supportsConfiguration const): (WebCore::CDMPrivateFairPlayStreaming::supportsConfigurationWithRestrictions const): (WebCore::CDMPrivateFairPlayStreaming::supportsSessionTypeWithConfiguration const): (WebCore::CDMPrivateFairPlayStreaming::supportsRobustness const): (WebCore::CDMPrivateFairPlayStreaming::distinctiveIdentifiersRequirement const): (WebCore::CDMPrivateFairPlayStreaming::persistentStateRequirement const): (WebCore::CDMPrivateFairPlayStreaming::distinctiveIdentifiersAreUniquePerOriginAndClearable const): (WebCore::CDMPrivateFairPlayStreaming::createInstance): (WebCore::CDMPrivateFairPlayStreaming::loadAndInitialize): (WebCore::CDMPrivateFairPlayStreaming::supportsServerCertificates const): (WebCore::CDMPrivateFairPlayStreaming::supportsSessions const): (WebCore::CDMPrivateFairPlayStreaming::supportsInitData const): (WebCore::CDMPrivateFairPlayStreaming::sanitizeResponse const): (WebCore::CDMPrivateFairPlayStreaming::sanitizeSessionId const): * platform/graphics/avfoundation/CDMFairPlayStreaming.h: Added. * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h: Added. * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: Added. (-[WebCoreFPSContentKeySessionDelegate initWithParent:]): (-[WebCoreFPSContentKeySessionDelegate invalidate]): (-[WebCoreFPSContentKeySessionDelegate contentKeySession:didProvideContentKeyRequest:]): (-[WebCoreFPSContentKeySessionDelegate contentKeySession:didProvideRenewingContentKeyRequest:]): (-[WebCoreFPSContentKeySessionDelegate contentKeySession:didProvidePersistableContentKeyRequest:]): (-[WebCoreFPSContentKeySessionDelegate contentKeySession:didUpdatePersistableContentKey:forContentKeyIdentifier:]): (-[WebCoreFPSContentKeySessionDelegate contentKeySession:contentKeyRequest:didFailWithError:]): (-[WebCoreFPSContentKeySessionDelegate contentKeySession:shouldRetryContentKeyRequest:reason:]): (-[WebCoreFPSContentKeySessionDelegate contentKeySessionContentProtectionSessionIdentifierDidChange:]): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::CDMInstanceFairPlayStreamingAVFObjC): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::~CDMInstanceFairPlayStreamingAVFObjC): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistableState): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::mimeTypeIsPlayable): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setDistinctiveIdentifiersAllowed): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setPersistentStateAllowed): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setServerCertificate): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setStorageDirectory): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::isLicenseTypeSupported const): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestLicense): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::updateLicense): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::loadSession): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::closeSession): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::removeSessionData): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::storeRecordOfKeyUsage): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::keySystem const): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequest): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRenewingRequest): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvidePersistableRequest): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didFailToProvideRequest): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::shouldRetryRequestForReason): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionIdentifierChanged): * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::InbandTextTrackPrivateAVF::processNativeSamples): (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer): * testing/MockCDMFactory.cpp: (WebCore::MockCDMInstance::setStorageDirectory): * testing/MockCDMFactory.h: 2017-11-10 Antoine Quint [Web Animations] Implement getAnimations() https://bugs.webkit.org/show_bug.cgi?id=179535 Reviewed by Simon Fraser. We now allow a list of animations for a document, with Document.getAnimations(), or for an element, with Animatable.getAnimations(), to be returned. In order to support this, we maintain a map on AnimationTimeline of all animations for a given element. This map is invalidated when an animation's timeline changes and when an animation's effect changes. Note that the Web Animations spec mandates that an AnimationEffect can only be a single animation's effect. Additionally, we ensure that the Document-to-DocumentTimeline relationship is cleared when is being prepared for teardown to avoid a ref-cycle. Tests: http/wpt/wk-web-animations/interfaces/document-get-animations.html http/wpt/wk-web-animations/interfaces/element-get-animations.html http/wpt/wk-web-animations/timing-model/animation-effect-unique-relationship.html * CMakeLists.txt: Add Animatable.idl. * DerivedSources.make: Add Animatable.idl. * WebCore.xcodeproj/project.pbxproj: Add Animatable.idl. * animation/Animatable.idl: A new interface that Element implements and which currently only exposes getAnimations(), the animate() method will be added later. * animation/AnimationEffect.h: Add a new m_animation member to reference the animation using this effect. This relationship is required so we guarantee that an effect is associated with a single animation at most. (WebCore::AnimationEffect::animation const): (WebCore::AnimationEffect::setAnimation): * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::animationWasAddedToElement): New method to notify the timeline that an animation registered with this timeline has been associated with a new element through its effect. (WebCore::AnimationTimeline::animationWasRemovedFromElement): New method to notify the timeline that an animation registered with this timeline has been disassociated with an element through its effect. (WebCore::AnimationTimeline::animationsForElement): New method returning all animations registered with this timeline for a given element. * animation/AnimationTimeline.h: (WebCore::AnimationTimeline::animations const): All animations registered with this timeline. * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::DocumentTimeline): (WebCore::DocumentTimeline::detachFromDocument): Clear the reference between this timeline and its document. * animation/DocumentTimeline.h: * animation/WebAnimation.cpp: (WebCore::WebAnimation::create): (WebCore::WebAnimation::setEffect): As an animation's effect changes, we need to ensure that the old effect no longer has an associated animation, and that the new effect is associated with this animation. Additionally, we update the element-to-animations map on the animation's timeline. (WebCore::WebAnimation::setTimeline): Update the element-to-animations map on the former and new timeline. * dom/Document.cpp: (WebCore::Document::prepareForDestruction): Clear the relationship between this document and its timeline. (WebCore::Document::getAnimations): Obtain all animations associated with this document's timeline. * dom/Document.h: * dom/Document.idl: * dom/Element.cpp: (WebCore::Element::getAnimations): Obtain all animations associated with this element. * dom/Element.h: * dom/Element.idl: * testing/Internals.cpp: 2017-11-10 Joseph Pecoraro Web Inspector: Make http status codes be "integer" instead of "number" in protocol https://bugs.webkit.org/show_bug.cgi?id=179543 Reviewed by Antoine Quint. * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse): No need for the temporary or type change. 2017-11-10 Commit Queue Unreviewed, rolling out r224602 and r224697. https://bugs.webkit.org/show_bug.cgi?id=179545 The LayoutTest for this change is flaky. (Requested by ryanhaddad on #webkit). Reverted changesets: "Add tests to ensure that tags are only preloaded when the `type`" https://bugs.webkit.org/show_bug.cgi?id=179231 https://trac.webkit.org/changeset/224602 "Fix race conditions with setBackingScaleFactor, page refresh and preloader" https://bugs.webkit.org/show_bug.cgi?id=179488 https://trac.webkit.org/changeset/224697 2017-11-10 Chris Dumez [Service Workers] Implement "Try Activate" / "Activate" algorithms https://bugs.webkit.org/show_bug.cgi?id=179436 Reviewed by Brady Eidson. Implement proper "Try Activate" / "Activate" algorithms as per: - https://w3c.github.io/ServiceWorker/#try-activate-algorithm - https://w3c.github.io/ServiceWorker/#activation-algorithm Test: http/tests/workers/service/basic-activate-event.html * workers/service/context/SWContextManager.cpp: (WebCore::SWContextManager::fireActivateEvent): * workers/service/context/SWContextManager.h: * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::fireActivateEvent): * workers/service/context/ServiceWorkerThread.h: * workers/service/server/SWServer.cpp: (WebCore::SWServer::Connection::didFinishActivation): (WebCore::SWServer::didFinishActivation): (WebCore::SWServer::fireActivateEvent): * workers/service/server/SWServer.h: * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::didFinishInstall): (WebCore::SWServerJobQueue::tryActivate): (WebCore::SWServerJobQueue::activate): (WebCore::SWServerJobQueue::didFinishActivation): * workers/service/server/SWServerJobQueue.h: 2017-11-10 Alex Christensen Fix debug build after r224700 https://bugs.webkit.org/show_bug.cgi?id=179460 * platform/text/TextEncodingRegistry.cpp: (WebCore::addToTextEncodingNameMap): 2017-11-10 Maciej Stachowiak Remove TEC decoders that duplicate ICU decoders https://bugs.webkit.org/show_bug.cgi?id=179460 Reviewed by Darin Adler. Test: fast/encoding/duplicate-tec-encodings.html * platform/text/TextEncodingRegistry.cpp: (WebCore::checkExistingName): Deleted. (WebCore::addToTextEncodingNameMap): Move the check from checkExistingName here, and make it an ASSERT, since we should now be guaranteed no duplicate encodings. * platform/text/mac/mac-encodings.txt: Remove encodings that duplicate ones we implement with ICU. * platform/text/TextCodecICU.cpp: Add some extra encoding aliases that only TEC knew about. 2017-11-10 Alex Christensen Make CachedResource::redirectReceived asynchronous https://bugs.webkit.org/show_bug.cgi?id=179503 Reviewed by Antti Koivisto. There were a few loops where we called redirectReceived many times in a row, and these are replaced with a completion handler that recursively calls the next redirectReceived or the code after the loop. No change in behavior. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::redirectReceived): * loader/DocumentLoader.h: (WebCore::DocumentLoader::setLastCheckedRequest): * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::redirectReceived): * loader/DocumentThreadableLoader.h: * loader/MediaResourceLoader.cpp: (WebCore::MediaResource::redirectReceived): * loader/MediaResourceLoader.h: * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::willSendRequestInternal): * loader/cache/CachedRawResource.cpp: (WebCore::iterate): (WebCore::CachedRawResource::didAddClient): (WebCore::CachedRawResource::redirectReceived): * loader/cache/CachedRawResource.h: * loader/cache/CachedRawResourceClient.h: (WebCore::CachedRawResourceClient::redirectReceived): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::redirectReceived): * loader/cache/CachedResource.h: * platform/graphics/PlatformMediaResourceLoader.h: (WebCore::PlatformMediaResourceClient::redirectReceived): * platform/network/cocoa/WebCoreNSURLSession.mm: (WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived): 2017-11-10 John Wilander Ignore HSTS for partitioned, cross-origin subresource requests https://bugs.webkit.org/show_bug.cgi?id=178993 Reviewed by Brent Fulgham. No new tests. HSTS is not supported in layout tests. Tested manually. * platform/network/mac/WebCoreURLResponse.mm: (WebCore::synthesizeRedirectResponseIfNecessary): 2017-11-10 Alex Christensen REGRESSION(r224267): WebViews scheduled with custom run loop modes don't load https://bugs.webkit.org/show_bug.cgi?id=179515 Reviewed by Andy Estes. Covered by a new API test which would have timed out without this change. * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (schedulePairHashSet): Collect run loop modes from the NetworkingContext similarly to how we did before https://trac.webkit.org/changeset/224267/webkit#file40 (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]): 2017-11-10 Chris Dumez Simplify SWServerRegistration::forEachConnection() https://bugs.webkit.org/show_bug.cgi?id=179523 Reviewed by Alex Christensen. Simplify SWServerRegistration::forEachConnection() by dropping the hack introduced in r224590 to work around the fact that we had a race between Storage & WebProcess processes during registration. After r224652, we do an IPC handshake between those 2 processes after resolving the registration promise so we know for sure the ServiceWorkerRegistration object has registered itself with the Storage process before we keep going with the install steps. No new tests, no expected Web-facing behavior change. * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::scriptFetchFinished): (WebCore::SWServerJobQueue::install): (WebCore::SWServerJobQueue::didResolveRegistrationPromise): (WebCore::SWServerJobQueue::didFinishInstall): (WebCore::SWServerJobQueue::runRegisterJob): (WebCore::SWServerJobQueue::runUnregisterJob): * workers/service/server/SWServerRegistration.cpp: (WebCore::SWServerRegistration::updateRegistrationState): (WebCore::SWServerRegistration::updateWorkerState): (WebCore::SWServerRegistration::fireUpdateFoundEvent): (WebCore::SWServerRegistration::forEachConnection): * workers/service/server/SWServerRegistration.h: 2017-11-10 Ms2ger Allow XHR to override the User-Agent header. https://bugs.webkit.org/show_bug.cgi?id=179527 Reviewed by Chris Dumez. Also rename FrameLoader::applyUserAgent to FrameLoader::applyUserAgentIfNeeded for clarity. Test: imported/w3c/web-platform-tests/XMLHttpRequest/setrequestheader-header-allowed.htm * loader/FrameLoader.cpp: (WebCore::FrameLoader::addExtraFieldsToRequest): (WebCore::FrameLoader::applyUserAgentIfNeeded): * loader/FrameLoader.h: * loader/ResourceLoadNotifier.cpp: (WebCore::ResourceLoadNotifier::willSendRequest): * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::createResourceHandle): * loader/cache/CachedResourceRequest.cpp: (WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders): 2017-11-10 Ms2ger [GTK] Use fallible allocation in ImageBuffer::ImageBuffer(). https://bugs.webkit.org/show_bug.cgi?id=179051 Reviewed by Michael Catanzaro. Test: imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html * platform/graphics/cairo/ImageBufferCairo.cpp: (WebCore::ImageBuffer::ImageBuffer): 2017-11-10 Miguel Gomez [GTK][WPE] CoordinatedGraphicsLayer::setNeedsDisplayInRect() converts FloatRect to IntRect erroneously https://bugs.webkit.org/show_bug.cgi?id=179476 Reviewed by Žan Doberšek. Convert the passed FloatRect into an IntRect using enclosingIntRect(), so we are guaranteed that the rectangle to paint fits into the buffer that the backingStore will allocate. No behaviour change. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::setNeedsDisplayInRect): 2017-11-10 Fujii Hironori WebInjectedScriptHost.cpp: warning: variable ‘scope’ set but not used https://bugs.webkit.org/show_bug.cgi?id=179524 Reviewed by Joseph Pecoraro. r224606 has introduced a new compilation warning if not ENABLE(PAYMENT_REQUEST). No new tests (No behavior change). * inspector/WebInjectedScriptHost.cpp: (WebCore::WebInjectedScriptHost::getInternalProperties): Do not define the variable 'scope' if not ENABLE(PAYMENT_REQUEST). Marked a variable 'vm' with UNUSED_PARAM. 2017-11-10 Zan Dobersek [Cairo] Start grouping Cairo GraphicsContext operations behind a separate interface https://bugs.webkit.org/show_bug.cgi?id=179467 Reviewed by Carlos Garcia Campos. Start moving the Cairo operations in GraphicsContext into a separate translation unit, CairoOperations.cpp. This will ease leveraging these operations from a pre-recorded list of GraphicsContext commands, or from a Cairo-specific GraphicsContextImpl, without undermining the current GraphicsContext implementation that we'll want to maintain in a working state until necessary. We start with the clipping operations. Each operation is encapsulated in a static function inside the WebCore::Cairo namespace that expects PlatformContextCairo reference as the first argument, which makes sense since we have to utilize the cairo_t state object that's kept there. Other parameters are passed as well, as required for some specific operation. In the Cairo implementation of GraphicsContext, the affected methods are changed to assert presence of the platform context (i.e. this is a GraphicsContext that operates on a valid cairo_t object, and is not using an m_impl object or is in non-painting mode) before the PlatformContextCairo object is dereferenced and passed along with other arguments to the Cairo::clip*() function. No new tests -- no change in behavior. * platform/SourcesCairo.txt: * platform/graphics/cairo/CairoOperations.cpp: Added. (WebCore::Cairo::clip): (WebCore::Cairo::clipOut): (WebCore::Cairo::clipPath): (WebCore::Cairo::clipToImageBuffer): * platform/graphics/cairo/CairoOperations.h: Added. * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::clip): (WebCore::GraphicsContext::clipPath): (WebCore::GraphicsContext::clipToImageBuffer): (WebCore::GraphicsContext::clipOut): 2017-11-09 Chris Dumez Unreviewed, rolling out r224661. Broke build on several internal Mac/iOS bots Reverted changeset: "Ignore HSTS for partitioned, cross-origin subresource requests" https://bugs.webkit.org/show_bug.cgi?id=178993 https://trac.webkit.org/changeset/224661 2017-11-09 Chris Dumez ServiceWorkerRegistration objects may get recycled for different SWServerRegistration objects https://bugs.webkit.org/show_bug.cgi?id=179517 Reviewed by Brady Eidson. ServiceWorkerRegistration objects could get recycled for different SWServerRegistration objects, leading to flakiness in the tests. We uses ServiceWorkerRegistrationKey as key in the m_registration map on WebProcess side. The lifetime of the ServiceWorkerRegistration objects is tied to the lifetime of their JS wrapper. When a test does a registration for a given scope, then unregisters, then registers again for the same scope, we would end up creating a new SWServerRegistration object on server side, but possibly reuse the same ServiceWorkerRegistration object on WebProcess side, if its wrapper has not yet been garbage collected. This is because the registrations have the same ServiceWorkerRegistrationKey in this case. To address the issue, we now use the ServiceWorkerRegistrationIdentifier as key in the m_registration hash map. A SWServerRegistration has a unique ServiceWorkerRegistrationIdentifier on server side. All its clients ServiceWorkerRegistration also use the same ServiceWorkerRegistrationIdentifier. Test: http/tests/workers/service/basic-unregister-then-register-again-no-reuse.html * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::getRegistration): (WebCore::ServiceWorkerContainer::scheduleTaskToUpdateRegistrationState): (WebCore::ServiceWorkerContainer::scheduleTaskToFireUpdateFoundEvent): (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration): (WebCore::ServiceWorkerContainer::addRegistration): (WebCore::ServiceWorkerContainer::removeRegistration): * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerRegistration.h: * workers/service/ServiceWorkerRegistrationData.h: (WebCore::ServiceWorkerRegistrationData::decode): * workers/service/server/SWClientConnection.cpp: (WebCore::SWClientConnection::updateRegistrationState): (WebCore::SWClientConnection::fireUpdateFoundEvent): * workers/service/server/SWClientConnection.h: * workers/service/server/SWServer.cpp: (WebCore::SWServer::Connection::addServiceWorkerRegistrationInServer): (WebCore::SWServer::Connection::removeServiceWorkerRegistrationInServer): (WebCore::SWServer::resolveRegistrationJob): (WebCore::SWServer::addClientServiceWorkerRegistration): (WebCore::SWServer::removeClientServiceWorkerRegistration): * workers/service/server/SWServer.h: * workers/service/server/SWServerRegistration.cpp: (WebCore::generateServiceWorkerRegistrationIdentifier): (WebCore::SWServerRegistration::SWServerRegistration): (WebCore::SWServerRegistration::updateRegistrationState): (WebCore::SWServerRegistration::fireUpdateFoundEvent): (WebCore::SWServerRegistration::forEachConnection): (WebCore::SWServerRegistration::addClientServiceWorkerRegistration): (WebCore::SWServerRegistration::removeClientServiceWorkerRegistration): * workers/service/server/SWServerRegistration.h: (WebCore::SWServerRegistration::identifier const): 2017-11-09 John Wilander Ignore HSTS for partitioned, cross-origin subresource requests https://bugs.webkit.org/show_bug.cgi?id=178993 Reviewed by Brent Fulgham. No new tests. HSTS is not supported in layout tests. Tested manually. * platform/network/mac/WebCoreURLResponse.mm: (WebCore::synthesizeRedirectResponseIfNecessary): 2017-11-09 Zalan Bujtas [LayoutState cleanup] Remove explicit pop from LayoutState https://bugs.webkit.org/show_bug.cgi?id=179509 Reviewed by Antti Koivisto. Both relayoutForPagination()/relayoutToAvoidWidows() call layout recursively which requires manual layout state pop. This patch addresses this issue by constructing a new LayoutState object for the positioned descendants. Covered by existing tests. * rendering/LayoutState.cpp: (WebCore::LayoutStateMaintainer::~LayoutStateMaintainer): (WebCore::LayoutStateMaintainer::pop): Deleted. * rendering/LayoutState.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutBlock): (WebCore::RenderBlockFlow::relayoutToAvoidWidows): (WebCore::RenderBlockFlow::relayoutForPagination): * rendering/RenderBlockFlow.h: 2017-11-09 Chris Dumez Implement real post 'install' event steps of the Install algorithm (steps 14+) https://bugs.webkit.org/show_bug.cgi?id=179401 Reviewed by Brady Eidson. Implement step 14+ of Install algorithm, as per: - https://w3c.github.io/ServiceWorker/#installation-algorithm * dom/Microtasks.h: * workers/service/ServiceWorker.cpp: (WebCore::ServiceWorker::ServiceWorker): (WebCore::ServiceWorker::scheduleTaskToUpdateState): * workers/service/ServiceWorker.h: * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::scheduleTaskToUpdateRegistrationState): (WebCore::ServiceWorkerContainer::jobFailedWithException): (WebCore::ServiceWorkerContainer::scheduleTaskToFireUpdateFoundEvent): (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration): (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult): * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerJob.cpp: (WebCore::ServiceWorkerJob::resolvedWithRegistration): * workers/service/ServiceWorkerJob.h: * workers/service/ServiceWorkerJobClient.h: * workers/service/ServiceWorkerRegistration.cpp: (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration): * workers/service/ServiceWorkerTypes.h: * workers/service/server/SWClientConnection.cpp: (WebCore::SWClientConnection::registrationJobResolvedInServer): (WebCore::SWClientConnection::forEachContainer): (WebCore::SWClientConnection::updateRegistrationState): (WebCore::SWClientConnection::updateWorkerState): (WebCore::SWClientConnection::fireUpdateFoundEvent): * workers/service/server/SWClientConnection.h: * workers/service/server/SWServer.cpp: (WebCore::SWServer::Connection::didResolveRegistrationPromise): (WebCore::SWServer::resolveRegistrationJob): (WebCore::SWServer::didResolveRegistrationPromise): * workers/service/server/SWServer.h: * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::install): (WebCore::SWServerJobQueue::didResolveRegistrationPromise): (WebCore::SWServerJobQueue::didFinishInstall): (WebCore::SWServerJobQueue::runRegisterJob): * workers/service/server/SWServerJobQueue.h: * workers/service/server/SWServerRegistration.cpp: * workers/service/server/SWServerRegistration.h: (WebCore::SWServerRegistration::installingWorker const): (WebCore::SWServerRegistration::waitingWorker const): (WebCore::SWServerRegistration::activeWorker const): * workers/service/server/SWServerWorker.cpp: (WebCore::SWServerWorker::terminate): * workers/service/server/SWServerWorker.h: 2017-11-09 Doug Russell Bug 179068 - AX: search predicate returns containing group for plain text instead of text element https://bugs.webkit.org/show_bug.cgi?id=179068 Reviewed by Darin Adler Implement a check in AccessibilityRenderObject::hasPlainText(), AccessibilityObject::canHavePlainText(), to confirm the element is capable of providing text. Tests: accessibility/mac/search-predicate-plaintext.html accessibility/mac/search-predicate-visible-button.html accessibility/mac/search-predicate-visited-links.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::text const): (WebCore::AccessibilityNodeObject::stringValue const): * accessibility/AccessibilityObject.h: (WebCore::AccessibilityObject::isARIAStaticText const): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::stringValue const): (WebCore::AccessibilityRenderObject::canHavePlainText const): (WebCore::AccessibilityRenderObject::hasPlainText const): * accessibility/AccessibilityRenderObject.h: 2017-11-09 Wenson Hsieh Inserting an image, selecting, underlining, and then deleting leaves the typing style with both "-webkit-text-decorations-in-effect" and "text-decoration" https://bugs.webkit.org/show_bug.cgi?id=179431 Reviewed by Ryosuke Niwa. When inserting an image element, selecting it, underlining the selection, deleting, and then inserting text, we crash on a debug assert. This codepath was exercised by an API test added in . This assertion happens due to the following sequence of events: 1. DeleteSelectionCommand::saveTypingStyleState computes a typing style. 2. In doing so, it calls into EditingStyle::init, which observes that "-webkit-text-decorations-in-effect" is present and appends "text-decoration" with an identical CSS value to the EditingStyle's mutable style properties. 3. DeleteSelectionCommand::calculateTypingStyleAfterDelete sets the current selection's typing style to the above typing style. 4. Later on, when we try to insert text, we compute the StyleChange using the above typing style, which calls into reconcileTextDecorationProperties. 5. reconcileTextDecorationProperties debug asserts that "-webkit-text-decorations-in-effect" and "text-decoration" don't coexist on the EditingStyle's (i.e. the typing style's) mutable properties; since (2) added both properties, this assertion fires. It appears that step (2) shouldn't be adding "text-decoration" in addition to EditingStyle's mutable style properties, since doing so would violate the requirements of reconcileTextDecorationProperties. As such, we can tweak EditingStyle::init to *replace* the "-webkit-text-decorations-in-effect" property with "text-decoration" instead; this matches the behavior of reconcileTextDecorationProperties, and ensures that we only have the "text-decorations" property when we try to insert text in step (4). Test: editing/execCommand/underline-selection-containing-image.html * editing/EditingStyle.cpp: (WebCore::EditingStyle::init): 2017-11-09 Devin Rousso Web Inspector: support undo/redo of insertAdjacentHTML https://bugs.webkit.org/show_bug.cgi?id=179283 Reviewed by Joseph Pecoraro. Test: inspector/dom/insertAdjacentHTML.html Create another version of Element::insertAdjacentHTML that keeps track of the nodes that are added. This is necessary because the children of a DocumentFragment are removed when it is added to a ContainerNode. In this way, it is possible to remove those nodes during an undo. * dom/Element.h: * dom/Element.cpp: (WebCore::Element::insertAdjacentHTML): * inspector/DOMEditor.h: * inspector/DOMEditor.cpp: (WebCore::DOMEditor::insertAdjacentHTML): Drive-by fix: sort functions and class declarations. * inspector/agents/InspectorDOMAgent.h: * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::insertAdjacentHTML): 2017-11-09 Zalan Bujtas [LayoutState cleanup] Remove redundant LayoutState c'tor https://bugs.webkit.org/show_bug.cgi?id=179505 Reviewed by Antti Koivisto. No change in functionality. * rendering/LayoutState.cpp: * rendering/LayoutState.h: 2017-11-09 Youenn Fablet FetchResponse should set the mime type of its internal ResourceResponse https://bugs.webkit.org/show_bug.cgi?id=179487 Reviewed by Chris Dumez. No observable change. Setting the mime type of the response as navigation loads use that field. This will be used for navigation loads served by service worker. * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::create): 2017-11-09 Youenn Fablet ServiceWorker ResourceResponse should not assert in platformCertificateInfo() https://bugs.webkit.org/show_bug.cgi?id=179486 Reviewed by Chris Dumez. No change of behavior. In case a Response is returned by Service Worker, there may be no related internal response. In that case, platformCertificateInfo is returning an empty CertificateInfo. * platform/network/cocoa/ResourceResponseCocoa.mm: (WebCore::ResourceResponse::platformCertificateInfo const): 2017-11-09 Zalan Bujtas [LayoutState cleanup] Remove conditional push from RenderTableSection::calcRowLogicalHeight https://bugs.webkit.org/show_bug.cgi?id=179493 Reviewed by Antti Koivisto. Pushing layout states is cheap and we do it for every container anyway. Covered by existing tests. * rendering/LayoutState.cpp: (WebCore::LayoutStateMaintainer::LayoutStateMaintainer): (WebCore::LayoutStateMaintainer::~LayoutStateMaintainer): (WebCore::LayoutStateMaintainer::pop): (WebCore::LayoutStateMaintainer::push): Deleted. * rendering/LayoutState.h: (WebCore::LayoutStateMaintainer::didPush const): Deleted. * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::calcRowLogicalHeight): 2017-11-09 Youenn Fablet CachedResourceLoader::requestRawResource should not assert when destination is set in the context of a service worker https://bugs.webkit.org/show_bug.cgi?id=179491 Reviewed by Chris Dumez. No change of behavior. requestRawResource on web page should have the destination set as the empty string as per fetch spec. In the context of a service worker, requestRawResource may be used with any destination. Updating assertion accordingly. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestRawResource): 2017-11-09 Youenn Fablet ResourceErrorBase::setType should not ASSERT if it is a no op https://bugs.webkit.org/show_bug.cgi?id=179490 Reviewed by Chris Dumez. No change of behavior. * platform/network/ResourceErrorBase.cpp: (WebCore::ResourceErrorBase::setType): 2017-11-09 Zalan Bujtas [LayoutState cleanup] Remove renderer data members from state maintainers. https://bugs.webkit.org/show_bug.cgi?id=179483 Reviewed by Darin Adler. Although layout is not supposed to mutate the tree anymore, it's safer to use LayoutContext instead. No change in functionality. * page/LayoutContext.cpp: * page/LayoutContext.h: * rendering/LayoutState.cpp: (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer): (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer): (WebCore::PaginatedLayoutStateMaintainer::PaginatedLayoutStateMaintainer): (WebCore::PaginatedLayoutStateMaintainer::~PaginatedLayoutStateMaintainer): * rendering/LayoutState.h: 2017-11-09 Maciej Stachowiak Remove support for iOS-only softbank-sjis encoding if possible https://bugs.webkit.org/show_bug.cgi?id=179416 Reviewed by Darin Adler. * platform/text/TextCodecICU.cpp: (WebCore::TextCodecICU::registerEncodingNames): Remove support for softbank-sjis codec, because by code inspection it couldn't have possibly worked. (WebCore::TextCodecICU::registerCodecs): Ditto. 2017-11-09 Christopher Reid Use enum classes within FileSystem https://bugs.webkit.org/show_bug.cgi?id=175172 Reviewed by Darin Adler. No new tests, no change in behavior. Further cleanup to FileSystem's enum classes. Shortening FileSystem's enum names now that they are enum classes. Adding OptionSet to functions using the FileLockMode enum. * Modules/webdatabase/OriginLock.cpp: * loader/appcache/ApplicationCacheStorage.cpp: * platform/FileHandle.h: * platform/FileStream.cpp: * platform/FileSystem.cpp: * platform/FileSystem.h: * platform/cocoa/FileMonitorCocoa.mm: * platform/glib/FileSystemGlib.cpp: * platform/network/curl/CurlCacheEntry.cpp: * platform/network/curl/CurlCacheManager.cpp: * platform/posix/FileSystemPOSIX.cpp: * platform/win/FileSystemWin.cpp: * rendering/RenderThemeWin.cpp: 2017-11-09 Zalan Bujtas [LayoutState cleanup] LayouState::m_lineGrid should be a weak pointer https://bugs.webkit.org/show_bug.cgi?id=179484 Reviewed by Darin Adler. Covered by existing tests. * rendering/LayoutState.cpp: (WebCore::LayoutState::propagateLineGridInfo): (WebCore::LayoutState::establishLineGrid): * rendering/LayoutState.h: (WebCore::LayoutState::lineGrid const): 2017-11-09 Zalan Bujtas [LayoutState cleanup] Add pagination parameter to subtree LayoutState https://bugs.webkit.org/show_bug.cgi?id=179465 Reviewed by Antti Koivisto. It enables us to remove the last setters from LayoutState. No change in functionality. * page/LayoutContext.cpp: (WebCore::LayoutContext::pushLayoutStateForPaginationIfNeeded): * rendering/LayoutState.cpp: (WebCore::LayoutState::LayoutState): (WebCore::LayoutState::layoutDeltaMatches const): (WebCore::LayoutState::layoutDeltaMatches): Deleted. * rendering/LayoutState.h: (WebCore::LayoutState::isPaginated const): (WebCore::LayoutState::setIsPaginated): Deleted. (WebCore::LayoutState::setPageLogicalHeight): Deleted. 2017-11-08 Joseph Pecoraro AVSampleBufferGenerator leaks seen on leaks bot https://bugs.webkit.org/show_bug.cgi?id=179464 Reviewed by Jer Noble. * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: (WebCore::ImageDecoderAVFObjC::readSampleMetadata): (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex): Adopt the allocation into our RetainPtr. 2017-11-08 Simon Fraser Content not painted when scrolling an overflow node inside an iframe https://bugs.webkit.org/show_bug.cgi?id=179315 rdar://problem/35364166 Reviewed by Tim Horton. When scrolling overflow:scroll, we need to check for overlap updates just as we do for page scrolls. Test: compositing/ios/overflow-scroll-update-overlap.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateCompositingLayers): 2017-11-08 Simon Fraser Cordova: elements with tag position:fixed disappears (flickering) when a long content is scrolling and appears again when the scroll is finished. https://bugs.webkit.org/show_bug.cgi?id=178066 Reviewed by Tim Horton. In UIWebView, we were failing to call setIsViewportConstrained() on layers for position:fixed, causing us to detach their backing store sometimes on page scrolling. Fix by hoisting the call to RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole() up the stack into code that runs for both UIWebView and WKWebView. This required moving some of the sanity check code up out of updateScrollCoordinatedLayer() into the caller. Not testable because the bug only manifested in UIWebView. * rendering/RenderLayerCompositor.cpp: (WebCore::canCoordinateScrollingForLayer): (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): 2017-11-08 Zalan Bujtas [LayoutState cleanup] Move RenderMultiColumnFlow::computeLineGridPaginationOrigin to LayoutState https://bugs.webkit.org/show_bug.cgi?id=179462 Reviewed by Antti Koivisto. This is in preparation for having no setters on LayoutState. Having all the related functions (pagination/line-grid) in one place also helps with moving them to a more appropriate place later. No change in functionality. * rendering/LayoutState.cpp: (WebCore::LayoutState::computePaginationInformation): (WebCore::LayoutState::computeLineGridPaginationOrigin): (WebCore::LayoutState::establishLineGrid): * rendering/LayoutState.h: (WebCore::LayoutState::setLineGridPaginationOrigin): Deleted. (WebCore::LayoutState::currentRenderFragmentedFlow const): Deleted. (WebCore::LayoutState::setCurrentRenderFragmentedFlow): Deleted. * rendering/RenderMultiColumnFlow.cpp: (WebCore::RenderMultiColumnFlow::computeLineGridPaginationOrigin const): Deleted. 2017-11-08 Jiewen Tan Replace some stack raw pointers with RefPtrs within WebCore/svg https://bugs.webkit.org/show_bug.cgi?id=179314 Reviewed by Ryosuke Niwa. Besides replacing pointers directly, some of the methods are changed to return RefPtrs as well. No changes in behaviors. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::remoteSVGRootElement const): * dom/EventPath.h: (WebCore::EventPath::eventTargetRespectingTargetRules): * page/FrameView.cpp: (WebCore::FrameView::scrollToAnchor): * svg/SVGAElement.cpp: (WebCore::SVGAElement::defaultEventHandler): * svg/SVGAltGlyphElement.cpp: (WebCore::SVGAltGlyphElement::hasValidGlyphElements const): * svg/SVGAnimateElementBase.cpp: (WebCore::SVGAnimateElementBase::hasValidAttributeType): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::calculateFromAndToValues): (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::SVGAnimateElementBase::applyResultsToTarget): (WebCore::SVGAnimateElementBase::calculateDistance): * svg/SVGAnimateMotionElement.cpp: (WebCore::SVGAnimateMotionElement::hasValidAttributeType): (WebCore::SVGAnimateMotionElement::updateAnimationPath): (WebCore::SVGAnimateMotionElement::resetAnimatedType): (WebCore::SVGAnimateMotionElement::calculateAnimatedValue): (WebCore::SVGAnimateMotionElement::applyResultsToTarget): * svg/SVGAnimateTransformElement.cpp: (WebCore::SVGAnimateTransformElement::hasValidAttributeType): * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::resetAnimValToBaseVal): * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::adjustForInheritance): (WebCore::SVGAnimationElement::determinePropertyValueTypes): * svg/SVGDocument.cpp: (WebCore::SVGDocument::rootElement): (WebCore::SVGDocument::zoomAndPanEnabled const): (WebCore::SVGDocument::startPan): (WebCore::SVGDocument::updatePan const): * svg/SVGDocument.h: * svg/SVGDocumentExtensions.cpp: (WebCore::SVGDocumentExtensions::removeElementFromPendingResourcesForRemovalMap): * svg/SVGDocumentExtensions.h: * svg/SVGElement.cpp: (WebCore::SVGElement::~SVGElement): (WebCore::SVGElement::correspondingUseElement const): (WebCore::SVGElement::setCorrespondingElement): (WebCore::SVGElement::resolveCustomStyle): (WebCore::SVGElement::computedStyle): (WebCore::SVGElement::buildPendingResourcesIfNeeded): (WebCore::SVGElement::updateRelativeLengthsInformation): (WebCore::SVGElement::invalidateInstances): * svg/SVGElement.h: * svg/SVGFEBlendElement.cpp: (WebCore::SVGFEBlendElement::build): * svg/SVGFEColorMatrixElement.cpp: (WebCore::SVGFEColorMatrixElement::build): * svg/SVGFEComponentTransferElement.cpp: (WebCore::SVGFEComponentTransferElement::build): * svg/SVGFECompositeElement.cpp: (WebCore::SVGFECompositeElement::build): * svg/SVGFEConvolveMatrixElement.cpp: (WebCore::SVGFEConvolveMatrixElement::build): * svg/SVGFEDiffuseLightingElement.cpp: (WebCore::SVGFEDiffuseLightingElement::build): * svg/SVGFEDisplacementMapElement.cpp: (WebCore::SVGFEDisplacementMapElement::build): * svg/SVGFEDropShadowElement.cpp: (WebCore::SVGFEDropShadowElement::build): * svg/SVGFEGaussianBlurElement.cpp: (WebCore::SVGFEGaussianBlurElement::build): * svg/SVGFEImageElement.cpp: (WebCore::SVGFEImageElement::buildPendingResource): (WebCore::SVGFEImageElement::notifyFinished): * svg/SVGFELightElement.cpp: (WebCore::SVGFELightElement::findLightSource): (WebCore::SVGFELightElement::svgAttributeChanged): (WebCore::SVGFELightElement::childrenChanged): * svg/SVGFEMergeElement.cpp: (WebCore::SVGFEMergeElement::build): * svg/SVGFEMorphologyElement.cpp: (WebCore::SVGFEMorphologyElement::build): * svg/SVGFEOffsetElement.cpp: (WebCore::SVGFEOffsetElement::build): * svg/SVGFESpecularLightingElement.cpp: (WebCore::SVGFESpecularLightingElement::build): * svg/SVGFETileElement.cpp: (WebCore::SVGFETileElement::build): * svg/SVGFilterPrimitiveStandardAttributes.cpp: (WebCore::invalidateFilterPrimitiveParent): * svg/SVGFontFaceElement.cpp: (WebCore::SVGFontFaceElement::rebuildFontFace): * svg/SVGFontFaceFormatElement.cpp: (WebCore::SVGFontFaceFormatElement::childrenChanged): * svg/SVGFontFaceUriElement.cpp: (WebCore::SVGFontFaceUriElement::childrenChanged): * svg/SVGForeignObjectElement.cpp: (WebCore::SVGForeignObjectElement::rendererIsNeeded): * svg/SVGLengthContext.cpp: (WebCore::SVGLengthContext::determineViewport const): * svg/SVGLinearGradientElement.cpp: (WebCore::SVGLinearGradientElement::collectGradientAttributes): * svg/SVGMPathElement.cpp: (WebCore::SVGMPathElement::buildPendingResource): (WebCore::SVGMPathElement::pathElement): * svg/SVGMPathElement.h: * svg/SVGRadialGradientElement.cpp: (WebCore::SVGRadialGradientElement::collectGradientAttributes): * svg/SVGSVGElement.cpp: (WebCore::SVGSVGElement::frameForCurrentScale const): (WebCore::SVGSVGElement::currentScale const): (WebCore::SVGSVGElement::setCurrentScale): (WebCore::SVGSVGElement::deselectAll): (WebCore::SVGSVGElement::localCoordinateSpaceTransform const): (WebCore::SVGSVGElement::scrollToAnchor): (WebCore::SVGSVGElement::getElementById): * svg/SVGSVGElement.h: * svg/SVGStyleElement.cpp: (WebCore::SVGStyleElement::setDisabled): * svg/SVGTRefElement.cpp: (WebCore::SVGTRefElement::detachTarget): * svg/SVGTextContentElement.cpp: (WebCore::SVGTextContentElement::elementFromRenderer): * svg/SVGTextPathElement.cpp: (WebCore::SVGTextPathElement::buildPendingResource): * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::transferSizeAttributesToTargetClone const): (WebCore::SVGUseElement::svgAttributeChanged): (WebCore::SVGUseElement::targetClone const): (WebCore::SVGUseElement::toClipPath): (WebCore::SVGUseElement::rendererClipChild const): (WebCore::SVGUseElement::findTarget const): (WebCore::SVGUseElement::invalidateDependentShadowTrees): (WebCore::SVGUseElement::selfHasRelativeLengths const): * svg/SVGUseElement.h: * svg/animation/SMILTimeContainer.cpp: (WebCore::SMILTimeContainer::updateAnimations): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::buildPendingResource): (WebCore::SVGSMILElement::insertedIntoAncestor): (WebCore::SVGSMILElement::connectConditions): (WebCore::SVGSMILElement::disconnectConditions): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::rootElement const): (WebCore::SVGImage::hasSingleSecurityOrigin const): (WebCore::SVGImage::setContainerSize): (WebCore::SVGImage::containerSize const): (WebCore::SVGImage::draw): (WebCore::SVGImage::embeddedContentBox const): (WebCore::SVGImage::hasRelativeWidth const): (WebCore::SVGImage::hasRelativeHeight const): (WebCore::SVGImage::computeIntrinsicDimensions): (WebCore::SVGImage::startAnimation): (WebCore::SVGImage::stopAnimation): (WebCore::SVGImage::isAnimating const): (WebCore::SVGImage::reportApproximateMemoryCost const): * svg/graphics/SVGImage.h: * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::platformApplySoftware): * svg/graphics/filters/SVGFilterBuilder.cpp: (WebCore::SVGFilterBuilder::getEffectById const): * svg/graphics/filters/SVGFilterBuilder.h: * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h: * svg/properties/SVGListPropertyTearOff.h: 2017-11-08 Zalan Bujtas [LayoutState cleanup] LayoutContext should own the stack of LayoutState objects https://bugs.webkit.org/show_bug.cgi?id=179408 Reviewed by Antti Koivisto. No change in functionality. * page/LayoutContext.cpp: (WebCore::LayoutContext::layoutDelta const): (WebCore::LayoutContext::addLayoutDelta): (WebCore::LayoutContext::layoutDeltaMatches): (WebCore::LayoutContext::layoutState const): (WebCore::LayoutContext::pushLayoutState): (WebCore::LayoutContext::pushLayoutStateForPaginationIfNeeded): (WebCore::LayoutContext::popLayoutState): * page/LayoutContext.h: (WebCore::LayoutContext::isPaintOffsetCacheEnabled const): (WebCore::LayoutContext::layoutState const): Deleted. * rendering/LayoutState.cpp: (WebCore::LayoutState::LayoutState): (WebCore::LayoutState::computeOffsets): (WebCore::LayoutState::computeClipRect): (WebCore::LayoutState::computePaginationInformation): (WebCore::LayoutState::propagateLineGridInfo): (WebCore::LayoutState::establishLineGrid): (WebCore::LayoutState::clearPaginationInformation): Deleted. * rendering/LayoutState.h: (WebCore::LayoutState::setIsPaginated): 2017-11-08 Brady Eidson ServiceWorkerRegistration::updateStateFromServer fix! (Don't always create a new ServiceWorker every time). https://bugs.webkit.org/show_bug.cgi?id=179456 Reviewed by Chris Dumez. No new tests (No behavior change yet). * workers/service/ServiceWorkerRegistration.cpp: (WebCore::ServiceWorkerRegistration::updateStateFromServer): Re-use a previous worker instead of always creating a new one. 2017-11-08 Brent Fulgham XMLHttpRequest should not treat file URLs as same origin https://bugs.webkit.org/show_bug.cgi?id=178565 Reviewed by Daniel Bates. Based on a Blink patch by . https://chromium.googlesource.com/chromium/src/+/c362e001551abc2bea392773f32eaf043d8bc29f Test: security/cannot-read-self-from-file.html * page/SecurityOrigin.cpp: (WebCore::SecurityOrigin::passesFileCheck const): Do not treat file as same-origin. 2017-11-08 Jeremy Jones HTMLMediaElement should not use element fullscreen on iOS https://bugs.webkit.org/show_bug.cgi?id=179418 rdar://problem/35409277 Reviewed by Eric Carlson. Add ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN to determine if HTMLMediaElement should use element full screen or not. * Configurations/FeatureDefines.xcconfig: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::enterFullscreen): 2017-11-08 Joseph Pecoraro Web Inspector: Show Internal properties of PaymentRequest in Web Inspector Console https://bugs.webkit.org/show_bug.cgi?id=179276 Reviewed by Andy Estes. Test: http/tests/inspector/runtime/internal-properties-payment-request.https.html * Modules/paymentrequest/PaymentRequest.h: Expose access to internal state. * inspector/WebInjectedScriptHost.h: * inspector/WebInjectedScriptHost.cpp: (WebCore::constructInternalProperty): (WebCore::WebInjectedScriptHost::getInternalProperties): Provide internal properties for a PaymentRequest. * testing/Internals.cpp: (WebCore::Internals::withUserGesture): * testing/Internals.h: * testing/Internals.idl: Provide a simple way to run code inside of a user gesture. 2017-11-08 Ryosuke Niwa REGRESSION(r224534): Crash inside Document::updateStyleIfNeeded https://bugs.webkit.org/show_bug.cgi?id=179442 Reviewed by Simon Fraser. Disable the assertion when the web thread is used. * dom/Document.cpp: (WebCore::Document::updateStyleIfNeeded): (WebCore::Document::updateLayout): 2017-11-08 Colin Bendell Added mime type check to the picture source preloader to avoid downloading incompatible resources. https://bugs.webkit.org/show_bug.cgi?id=179231 Reviewed by Alex Christensen. Test: http/tests/loading/preload-picture-type.html * html/parser/HTMLPreloadScanner.cpp: (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): include type match state when selecting candidate imgs (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): added type attribute evaluation and matching 2017-11-08 Brady Eidson Some SW Container and Registration tweaks. https://bugs.webkit.org/show_bug.cgi?id=179450 Reviewed by Chris Dumez. No new tests (Progression in an existing test). * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration): * workers/service/ServiceWorkerRegistration.cpp: (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration): 2017-11-08 Antti Koivisto Move inlineElementContinuation function to RenderBoxModelObject and rename to inlineContinuation https://bugs.webkit.org/show_bug.cgi?id=179437 Reviewed by Zalan Bujtas. Unify RenderInline::inlineElementContinuation and RenderBlock::inlineElementContinuation. It is simply a function to find the next RenderInline in the continuation chain. * accessibility/AccessibilityRenderObject.cpp: (WebCore::lastChildConsideringContinuation): (WebCore::startOfContinuations): (WebCore::endOfContinuations): (WebCore::childBeforeConsideringContinuations): (WebCore::AccessibilityRenderObject::nextSibling const): (WebCore::nextContinuation): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::paintObject): (WebCore::RenderBlock::absoluteRects const): (WebCore::RenderBlock::addFocusRingRects): (WebCore::RenderBlock::inlineElementContinuation const): Deleted. * rendering/RenderBlock.h: * rendering/RenderBoxModelObject.cpp: (WebCore::accumulateInFlowPositionOffsets): (WebCore::RenderBoxModelObject::inlineContinuation const): * rendering/RenderBoxModelObject.h: * rendering/RenderInline.cpp: (WebCore::updateStyleOfAnonymousBlockContinuations): (WebCore::RenderInline::styleDidChange): (WebCore::nextContinuation): (WebCore::RenderInline::positionForPoint): (WebCore::RenderInline::inlineElementContinuation const): Deleted. * rendering/RenderInline.h: * rendering/line/LineInlineHeaders.h: (WebCore::hasInlineDirectionBordersPaddingOrMargin): 2017-11-08 Joseph Pecoraro Web Inspector: Eliminate unnecessary hash lookups with NetworkResourceData https://bugs.webkit.org/show_bug.cgi?id=179361 Reviewed by Brian Burg. * inspector/NetworkResourcesData.h: (WebCore::NetworkResourcesData::ResourceData::setURL): (WebCore::NetworkResourcesData::ResourceData::setUrl): Deleted. Drive-by fix the name `setUrl` to `setURL`. * inspector/NetworkResourcesData.h: Store unique_ptrs in the HashMap. * inspector/NetworkResourcesData.cpp: (WebCore::NetworkResourcesData::resourceCreated): (WebCore::NetworkResourcesData::responseReceived): Create new versions of methods that combine two operations. (WebCore::NetworkResourcesData::removeCachedResource): (WebCore::NetworkResourcesData::clear): (WebCore::NetworkResourcesData::ensureNoDataForRequestId): Handle unique_ptrs in the HashMap. * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::frameIdentifier): (WebCore::InspectorNetworkAgent::willSendRequest): (WebCore::InspectorNetworkAgent::didReceiveResponse): (WebCore::InspectorNetworkAgent::didFailLoading): Use the new version of operations to avoid multiple lookups. 2017-11-08 Wenson Hsieh [Attachment Support] Implement delegate hooks for attachment element insertion and removal https://bugs.webkit.org/show_bug.cgi?id=179016 Reviewed by Tim Horton. Relanding this patch with a tweaked API test. WKAttachmentTests.AttachmentUpdatesWhenChangingFontStyles, in its original form, hit a debug assertion and exposed an existing bug related to EditingStyles and text decoration. After some investigation, this debug assertion is unrelated to the attachment logic introduced here; see for additional analysis, and several proposed fixes. * editing/Editor.cpp: (WebCore::Editor::respondToChangedSelection): (WebCore::Editor::editorUIUpdateTimerFired): (WebCore::Editor::scheduleEditorUIUpdate): (WebCore::Editor::didInsertAttachmentElement): (WebCore::Editor::didRemoveAttachmentElement): (WebCore::Editor::notifyClientOfAttachmentUpdates): (WebCore::Editor::insertAttachmentFromFile): * editing/Editor.h: * html/HTMLAttachmentElement.cpp: (WebCore::HTMLAttachmentElement::HTMLAttachmentElement): (WebCore::HTMLAttachmentElement::insertedIntoAncestor): (WebCore::HTMLAttachmentElement::removedFromAncestor): (WebCore::HTMLAttachmentElement::uniqueIdentifier const): (WebCore::HTMLAttachmentElement::setUniqueIdentifier): * html/HTMLAttachmentElement.h: * html/HTMLAttributeNames.in: * page/EditorClient.h: (WebCore::EditorClient::didInsertAttachment): (WebCore::EditorClient::didRemoveAttachment): 2017-11-08 Chris Dumez Simplify ServiceWorkerContainer::jobResolvedWithRegistration() https://bugs.webkit.org/show_bug.cgi?id=179429 Reviewed by Brady Eidson. * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration): 2017-11-08 Chris Dumez [Service Workers] Make sure SWServerRegistration update functions always message back the connection that scheduled the job https://bugs.webkit.org/show_bug.cgi?id=179428 Reviewed by Brady Eidson. * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::install): (WebCore::SWServerJobQueue::didFinishInstall): * workers/service/server/SWServerRegistration.cpp: (WebCore::SWServerRegistration::updateRegistrationState): (WebCore::SWServerRegistration::updateWorkerState): (WebCore::SWServerRegistration::fireUpdateFoundEvent): (WebCore::SWServerRegistration::firePostInstallEvents): (WebCore::SWServerRegistration::forEachConnection): * workers/service/server/SWServerRegistration.h: 2017-11-08 Maciej Stachowiak iOS supports some text encodings supposedly due to lack of TEC that aren't supported by the TEC decoder on macOS https://bugs.webkit.org/show_bug.cgi?id=179309 Reviewed by Darin Adler. Test: fast/encoding/legacy-ios-encodings.html * platform/text/TextCodecICU.cpp: (WebCore::TextCodecICU::registerEncodingNames): Remove most iOS-specific adding of names, leaving only softbank-sjis. Most were either redundant or unnecessary. (WebCore::TextCodecICU::registerCodecs): ditto 2017-11-08 Zan Dobersek Unreviewed. Attempting to unbork the WinCairo bot after r224578. * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h: Add a missing semicolon after the deafult initialization of a member variable in the GraphicsContextPlatformPrivate class. 2017-11-08 Chris Dumez [Service Workers] Support waitUntil() on the 'install' event https://bugs.webkit.org/show_bug.cgi?id=179396 Reviewed by Brady Eidson. Support waitUntil() on the 'install' event: - https://w3c.github.io/ServiceWorker/#installation-algorithm (step 10.4) - https://w3c.github.io/ServiceWorker/#wait-until-method Tests: http/tests/workers/service/basic-install-event-waitUntil-multiple-promises.html http/tests/workers/service/basic-install-event-waitUntil-reject.html http/tests/workers/service/basic-install-event-waitUntil-resolve.html * testing/Internals.cpp: * testing/Internals.h: * testing/Internals.idl: * workers/service/ExtendableEvent.cpp: (WebCore::ExtendableEvent::waitUntil): (WebCore::ExtendableEvent::addExtendLifetimePromise): (WebCore::ExtendableEvent::whenAllExtendLifetimePromisesAreSettled): * workers/service/ExtendableEvent.h: (WebCore::ExtendableEvent::pendingPromiseCount const): * workers/service/FetchEvent.cpp: (WebCore::FetchEvent::respondWith): * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::addRegistration): (WebCore::ServiceWorkerContainer::removeRegistration): * workers/service/ServiceWorkerContainer.h: * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::fireInstallEvent): * workers/service/server/SWClientConnection.h: * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::didFinishInstall): * workers/service/server/SWServerRegistration.cpp: (WebCore::SWServerRegistration::firePostInstallEvents): 2017-11-08 Antti Koivisto Remove Element::isInlineElementContinuation https://bugs.webkit.org/show_bug.cgi?id=179425 Reviewed by Zalan Bujtas. It is really just isInline+isContinuation test and most callers know it is an inline already. * accessibility/AccessibilityRenderObject.cpp: (WebCore::firstChildConsideringContinuation): (WebCore::startOfContinuations): (WebCore::firstChildIsInlineContinuation): * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::determineSpacingForFlowBoxes): (WebCore::InlineFlowBox::paint): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::addContinuationWithOutline): * rendering/RenderElement.h: (WebCore::RenderElement::setIsContinuation): (WebCore::RenderElement::isElementContinuation const): Deleted. (WebCore::RenderElement::isInlineElementContinuation const): Deleted. * rendering/RenderInline.cpp: (WebCore::RenderInline::willBeDestroyed): (WebCore::RenderInline::updateHitTestResult): * rendering/line/LineInlineHeaders.h: (WebCore::hasInlineDirectionBordersPaddingOrMargin): 2017-11-08 David Hyatt [Experiment] Implement code to detect high frequency painting https://bugs.webkit.org/show_bug.cgi?id=179118 Reviewed by Simon Fraser. This patch implements a model for detecting that objects whose graphics resources we want to cache (like glyphs or paths) are painting frequently enough that it's worth taking the memory hit to cache them. Paint frequency detection is done at the self-painting RenderLayer level, since a lower level of granularity (e.g., per-RenderObject) would be too memory-intensive. * rendering/PaintInfo.h: (WebCore::PaintInfo::PaintInfo): (WebCore::PaintInfo::enclosingSelfPaintingLayer): Add the enclosing self-painting layer that is currently painting to the PaintInfo so that objects that have cachaeble graphics resources can notify the layer when they actually paint them. * rendering/RenderLayer.cpp: (WebCore::PaintFrequencyInfo::PaintFrequencyInfo): (WebCore::PaintFrequencyInfo::paintingFrequently const): (WebCore::PaintFrequencyInfo::updatePaintFrequency): (WebCore::PaintFrequencyInfo::paintingCacheableResource): RenderLayers have a pointer to PaintFrequencyInfo that is allocated once you've painted cachaeble resources. (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::paintBackgroundForFragments): (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase): (WebCore::RenderLayer::paintOutlineForFragments): (WebCore::RenderLayer::paintMaskForFragments): (WebCore::RenderLayer::paintChildClippingMaskForFragments): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: Patch to pass the layer with the PaintInfo. * testing/Internals.cpp: (WebCore::Internals::isPaintingFrequently): (WebCore::Internals::incrementFrequentPaintCounter): * testing/Internals.h: * testing/Internals.idl: Test methods for making layout tests to ensure we go into the mode properly. 2017-11-08 Zalan Bujtas [LayoutState cleanup] Make public data members private. https://bugs.webkit.org/show_bug.cgi?id=179409 Reviewed by Sam Weinig. No change in functionality. * page/LayoutContext.cpp: (WebCore::LayoutContext::layoutDelta const): (WebCore::LayoutContext::addLayoutDelta): (WebCore::LayoutContext::layoutDeltaMatches): (WebCore::LayoutContext::pushLayoutStateForPaginationIfNeeded): * rendering/LayoutState.cpp: (WebCore::LayoutState::LayoutState): (WebCore::LayoutState::addLayoutDelta): (WebCore::LayoutState::layoutDeltaMatches): * rendering/LayoutState.h: (WebCore::LayoutState::setIsPaginated): (WebCore::LayoutState::setPageLogicalHeight): (WebCore::LayoutState::paintOffset const): (WebCore::LayoutState::renderer const): (WebCore::LayoutState::clipRect const): (WebCore::LayoutState::isClipped const): (WebCore::LayoutState::layoutDelta const): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage const): (WebCore::RenderBlock::childBoxIsUnsplittableForFragmentation const): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutBlock): (WebCore::RenderBlockFlow::applyBeforeBreak): (WebCore::RenderBlockFlow::applyAfterBreak): (WebCore::RenderBlockFlow::pageLogicalTopForOffset const): (WebCore::RenderBlockFlow::pageLogicalHeightForOffset const): (WebCore::RenderBlockFlow::pageRemainingLogicalHeightForOffset const): * rendering/RenderBox.cpp: (WebCore::RenderBox::mapLocalToContainer const): (WebCore::RenderBox::computeRectForRepaint const): * rendering/RenderInline.cpp: (WebCore::RenderInline::computeRectForRepaint const): (WebCore::RenderInline::mapLocalToContainer const): 2017-11-08 Zan Dobersek [Cairo] Improve PlatformContextCairo lifetime management in GraphicsContextPlatformPrivate https://bugs.webkit.org/show_bug.cgi?id=179424 Reviewed by Carlos Garcia Campos. When the PlatformContextCairo object is owned by GraphicsContextPlatformPrivate, the latter should hold it in a std::unique_ptr<>. When PlatformContextCairo is not owned, the std::unique_ptr<> should remain null, and the PlatformContextCairo reference should point to the externally-managed object. A new GraphicsContextPlatformPrivate constructor accepts a std::unique_ptr<> that manages a PlatformContextCairo object and moves it into the member variable, tying lifetime of that PlatformContextCairo object to the private object. This enables dropping the GraphicsContextPlatformPrivateToplevel class, and the virtual table is no longer required. Small cleanups to the remaining class are also performed. No new tests -- no changes in behavior. * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::GraphicsContext): (WebCore::GraphicsContext::platformInit): (WebCore::GraphicsContext::platformContext const): * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h: (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate): (WebCore::GraphicsContextPlatformPrivate::save): (WebCore::GraphicsContextPlatformPrivate::restore): (WebCore::GraphicsContextPlatformPrivate::flush): (WebCore::GraphicsContextPlatformPrivate::clip): (WebCore::GraphicsContextPlatformPrivate::scale): (WebCore::GraphicsContextPlatformPrivate::rotate): (WebCore::GraphicsContextPlatformPrivate::translate): (WebCore::GraphicsContextPlatformPrivate::concatCTM): (WebCore::GraphicsContextPlatformPrivate::setCTM): (WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate): Deleted. (WebCore::GraphicsContextPlatformPrivateToplevel::GraphicsContextPlatformPrivateToplevel): Deleted. (WebCore::GraphicsContextPlatformPrivateToplevel::~GraphicsContextPlatformPrivateToplevel): Deleted. * platform/graphics/win/GraphicsContextCairoWin.cpp: (WebCore::GraphicsContext::platformInit): 2017-11-08 Zan Dobersek [Cairo] Move transparency layers Vector to PlatformContextCairo https://bugs.webkit.org/show_bug.cgi?id=179420 Reviewed by Carlos Garcia Campos. Move the Vector of transparency layer float values from the GraphicsContextPlatformPrivate class to PlatformContextCairo. It fits better there since it's a platform-specific context state, just like e.g. the ShadowBlur member. No new tests -- no change in behavior. * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::beginPlatformTransparencyLayer): (WebCore::GraphicsContext::endPlatformTransparencyLayer): * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h: * platform/graphics/cairo/PlatformContextCairo.h: (WebCore::PlatformContextCairo::layers): * platform/graphics/win/GraphicsContextCairoWin.cpp: (WebCore::drawBitmapToContext): (WebCore::GraphicsContext::releaseWindowsContext): (WebCore::GraphicsContext::drawWindowsBitmap): 2017-11-08 Jeremy Jones Disable implicit animations when adding or removing text track representation layers. https://bugs.webkit.org/show_bug.cgi?id=179406 rdar://problem/34369835 Reviewed by Simon Fraser. No new tests because this has no effect on the DOM. This change prevents implicit animations when the text track layer is added or removed from the video layer. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::syncTextTrackBounds): (WebCore::MediaPlayerPrivateAVFoundationObjC::setTextTrackRepresentation): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::syncTextTrackBounds): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setTextTrackRepresentation): * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm: (WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer): 2017-11-07 Maciej Stachowiak Get rid of unsightly hex numbers from unified build object files https://bugs.webkit.org/show_bug.cgi?id=179410 Reviewed by Saam Barati. * WebCore.xcodeproj/project.pbxproj: Rename UnifiedSource*.mm to UnifiedSource*-mm.mm for more readable build output. 2017-11-07 Antti Koivisto Remove RenderBlock::isAnonymousBlockContinuation() https://bugs.webkit.org/show_bug.cgi?id=179403 Non-anonymous blocks don't have continuations so this is the same as simply calling continuation(). Some of these are also really isContinuation() tests. This ends up being the same as calling continuation() as block continuations always have next continuation too. This patch uses isContinuation() where appropriate. Reviewed by Zalan Bujtas. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::nodeForHitTest const): (WebCore::RenderBlock::absoluteRects const): (WebCore::RenderBlock::absoluteQuads const): (WebCore::RenderBlock::rectWithOutlineForRepaint const): (WebCore::RenderBlock::hoverAncestor const): (WebCore::RenderBlock::outlineStyleForRepaint const): * rendering/RenderBlock.h: (WebCore::RenderBlock::isAnonymousBlockContinuation const): Deleted. * rendering/RenderElement.cpp: (WebCore::RenderElement::propagateStyleToAnonymousChildren): * rendering/RenderInline.cpp: (WebCore::updateStyleOfAnonymousBlockContinuations): 2017-11-07 Antti Koivisto There is no such thing as block element continuation https://bugs.webkit.org/show_bug.cgi?id=179400 Reviewed by Zalan Bujtas. There are no non-anonymous block continuations. This is dead code. * rendering/RenderBlock.cpp: (WebCore::borderOrPaddingLogicalWidthChanged): (WebCore::RenderBlock::styleDidChange): (WebCore::RenderBlock::blockElementContinuation const): Deleted. This would always return null. * rendering/RenderBlock.h: 2017-11-07 Zalan Bujtas [LayoutState cleanup] Rename enable/disableLayoutState https://bugs.webkit.org/show_bug.cgi?id=179399 Reviewed by Antti Koivisto. It only enables/disables paint offset caching. No change in functionality. * page/LayoutContext.cpp: (WebCore::LayoutContext::pushLayoutState): (WebCore::LayoutContext::checkLayoutState): * page/LayoutContext.h: (WebCore::LayoutContext::isPaintOffsetCacheEnabled const): (WebCore::LayoutContext::disablePaintOffsetCache): (WebCore::LayoutContext::enablePaintOffsetCache): (WebCore::LayoutContext::layoutStateEnabled const): Deleted. (WebCore::LayoutContext::disableLayoutState): Deleted. (WebCore::LayoutContext::enableLayoutState): Deleted. * rendering/LayoutState.cpp: (WebCore::LayoutStateMaintainer::LayoutStateMaintainer): (WebCore::LayoutStateMaintainer::push): (WebCore::LayoutStateMaintainer::pop): (WebCore::LayoutStateDisabler::LayoutStateDisabler): (WebCore::LayoutStateDisabler::~LayoutStateDisabler): (WebCore::shouldDisablePaintOffsetCacheForSubtree): (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer): (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer): (WebCore::shouldDisableLayoutStateForSubtree): Deleted. * rendering/LayoutState.h: * rendering/RenderBox.cpp: (WebCore::RenderBox::mapLocalToContainer const): (WebCore::RenderBox::computeRectForRepaint const): * rendering/RenderInline.cpp: (WebCore::RenderInline::clippedOverflowRectForRepaint const): (WebCore::RenderInline::computeRectForRepaint const): (WebCore::RenderInline::mapLocalToContainer const): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateLayerPositions): * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::computeRectForRepaint const): * rendering/svg/RenderSVGContainer.cpp: (WebCore::RenderSVGContainer::layout): * rendering/svg/RenderSVGForeignObject.cpp: (WebCore::RenderSVGForeignObject::layout): 2017-11-07 Brady Eidson Implement "UpdateWorkerState" and use it https://bugs.webkit.org/show_bug.cgi?id=179318 Reviewed by Chris Dumez. No new tests (Existing tests and changes there-to). * workers/service/ServiceWorker.cpp: (WebCore::ServiceWorker::allWorkers): (WebCore::ServiceWorker::mutableAllWorkers): (WebCore::ServiceWorker::ServiceWorker): (WebCore::ServiceWorker::~ServiceWorker): (WebCore::ServiceWorker::updateWorkerState): (WebCore::ServiceWorker::setState): Deleted. * workers/service/ServiceWorker.h: * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::updateRegistrationState): (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration): * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerRegistration.cpp: (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration): (WebCore::ServiceWorkerRegistration::~ServiceWorkerRegistration): (WebCore::ServiceWorkerRegistration::updateStateFromServer): * workers/service/ServiceWorkerRegistrationData.cpp: (WebCore::ServiceWorkerRegistrationData::isolatedCopy const): * workers/service/ServiceWorkerRegistrationData.h: (WebCore::ServiceWorkerRegistrationData::encode const): (WebCore::ServiceWorkerRegistrationData::decode): * workers/service/ServiceWorkerRegistrationKey.cpp: (WebCore::ServiceWorkerRegistrationKey::loggingString const): * workers/service/ServiceWorkerRegistrationKey.h: * workers/service/ServiceWorkerTypes.h: * workers/service/context/SWContextManager.cpp: (WebCore::SWContextManager::registerServiceWorkerThreadForInstall): (WebCore::SWContextManager::registerServiceWorkerThreadForUpdate): Deleted. * workers/service/context/SWContextManager.h: * workers/service/server/SWClientConnection.cpp: (WebCore::SWClientConnection::updateRegistrationState): (WebCore::SWClientConnection::updateWorkerState): * workers/service/server/SWClientConnection.h: * workers/service/server/SWServer.cpp: (WebCore::SWServer::updateWorker): * workers/service/server/SWServer.h: (WebCore::SWServer::workerByID const): * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::scriptFetchFinished): (WebCore::SWServerJobQueue::scriptContextStarted): (WebCore::SWServerJobQueue::install): (WebCore::SWServerJobQueue::tryClearRegistration): * workers/service/server/SWServerRegistration.cpp: (WebCore::SWServerRegistration::updateRegistrationState): (WebCore::SWServerRegistration::updateWorkerState): (WebCore::SWServerRegistration::data const): * workers/service/server/SWServerRegistration.h: (WebCore::SWServerRegistration::setActiveServiceWorkerIdentifier): Deleted. * workers/service/server/SWServerWorker.h: (WebCore::SWServerWorker::state const): (WebCore::SWServerWorker::setState): 2017-11-07 Zalan Bujtas [LayoutState cleanup] Remove explicit LayoutStateMaintainer::pop calls. https://bugs.webkit.org/show_bug.cgi?id=179380 Reviewed by Antti Koivisto. Besides the pagination related explicit pops (FIXME), all LayoutStateMaintainer pops are now in LayoutStateMaintainer's d'tor. Covered by existing tests. * rendering/LayoutState.cpp: (WebCore::LayoutStateMaintainer::~LayoutStateMaintainer): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::simplifiedLayout): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutBlock): * rendering/RenderBox.cpp: (WebCore::RenderBox::layout): * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::RenderDeprecatedFlexibleBox::layoutBlock): * rendering/RenderEmbeddedObject.cpp: (WebCore::RenderEmbeddedObject::layout): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::layoutBlock): * rendering/RenderImage.cpp: (WebCore::RenderImage::layoutShadowControls): * rendering/RenderTable.cpp: (WebCore::RenderTable::layout): * rendering/RenderTableRow.cpp: (WebCore::RenderTableRow::layout): * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::calcRowLogicalHeight): (WebCore::RenderTableSection::layout): (WebCore::RenderTableSection::layoutRows): * rendering/RenderVTTCue.cpp: (WebCore::RenderVTTCue::layout): * rendering/RenderView.cpp: (WebCore::RenderView::layout): 2017-11-07 Commit Queue Unreviewed, rolling out r224512 and r224521. https://bugs.webkit.org/show_bug.cgi?id=179388 An API test added with this change is failing an assertion on the bots. (Requested by ryanhaddad on #webkit). Reverted changesets: "[Attachment Support] Implement delegate hooks for attachment element insertion and removal" https://bugs.webkit.org/show_bug.cgi?id=179016 https://trac.webkit.org/changeset/224512 "Remove stray logging from a newly added API test" https://trac.webkit.org/changeset/224521 2017-11-07 Antoine Quint