⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Timeline



Feb 23, 2020:

4:54 PM Changeset in webkit [257200] by Andres Gonzalez
  • 27 edits in trunk/Source/WebCore

AXIsolatedObject support for tables.
https://bugs.webkit.org/show_bug.cgi?id=208074

Reviewed by Chris Fleizach.

Covered by existing tests.

AccessibilityObjectWrapper code and some utility functions in
AccessibilityObject.cpp assume that AX objects can be downcast to a
specialized subclass like AccessibilityTable. That is not true for
AXIsolatedObjects, and the reason why tables don’t work in IsolatedTree
mode.

To solve this problem, this patch exposes the AccessibilityTable
interface as part of the AXCoreObject. Thus it eliminates the need to
downcast an AX object to an AccessibilityTable. It also implements the
AccessibilityTable interface in the AXIsolatedObject class. The same
approach will be used in subsequent patches for other specialized
interfaces used by client code.

  • accessibility/AccessibilityARIAGrid.cpp:

(WebCore::AccessibilityARIAGrid::addChildren):

  • accessibility/AccessibilityARIAGrid.h:
  • accessibility/AccessibilityARIAGridCell.cpp:

(WebCore::AccessibilityARIAGridCell::parentTable const):
(WebCore::AccessibilityARIAGridCell::rowIndexRange const):
(WebCore::AccessibilityARIAGridCell::columnIndexRange const):

  • accessibility/AccessibilityARIAGridRow.cpp:

(WebCore::AccessibilityARIAGridRow::disclosedRows):
(WebCore::AccessibilityARIAGridRow::disclosedByRow const):
(WebCore::AccessibilityARIAGridRow::parentTable const):

  • accessibility/AccessibilityNodeObject.cpp:

(WebCore::shouldUseAccessibilityObjectInnerText):

  • accessibility/AccessibilityObject.cpp:

(WebCore::appendChildrenToArray): Use AXCoreObject interface instead of downcasting.
(WebCore::Accessibility::isAccessibilityObjectSearchMatchAtIndex): Use AXCoreObject interface instead of downcasting.

  • accessibility/AccessibilityObject.h:
  • accessibility/AccessibilityObjectInterface.h: AXCoreObject now exposes the table interface.
  • accessibility/AccessibilityRenderObject.cpp:

(WebCore::AccessibilityRenderObject::ariaSelectedRows):

  • accessibility/AccessibilityTable.cpp:

(WebCore::AccessibilityTable::AccessibilityTable):
(WebCore::AccessibilityTable::init):
(WebCore::AccessibilityTable::isExposable const):
(WebCore::AccessibilityTable::addChildren):
(WebCore::AccessibilityTable::headerContainer): Returns an AXCoreObject.

The following methods now return a vector of objects instead of taking
and out parameter. RVO guaranties that this does not cause extra copy.
(WebCore::AccessibilityTable::columns):
(WebCore::AccessibilityTable::rows):
(WebCore::AccessibilityTable::columnHeaders):
(WebCore::AccessibilityTable::rowHeaders):
(WebCore::AccessibilityTable::visibleRows):
(WebCore::AccessibilityTable::cells):

(WebCore::AccessibilityTable::tableLevel const):
(WebCore::AccessibilityTable::roleValue const):
(WebCore::AccessibilityTable::computeAccessibilityIsIgnored const):
(WebCore::AccessibilityTable::title const):
(WebCore::AccessibilityTable::isExposableThroughAccessibility const): Renamed to just isExposable.

  • accessibility/AccessibilityTable.h:

(WebCore::AccessibilityTable::supportsSelectedRows): Deleted.

  • accessibility/AccessibilityTableCell.cpp:

(WebCore::AccessibilityTableCell::parentTable const):
(WebCore::AccessibilityTableCell::isTableCell const):
(WebCore::AccessibilityTableCell::columnHeaders):
(WebCore::AccessibilityTableCell::rowHeaders):

  • accessibility/AccessibilityTableCell.h:
  • accessibility/AccessibilityTableColumn.cpp:

(WebCore::AccessibilityTableColumn::headerObject):
(WebCore::AccessibilityTableColumn::addChildren):

  • accessibility/AccessibilityTableHeaderContainer.cpp:

(WebCore::AccessibilityTableHeaderContainer::addChildren):

  • accessibility/AccessibilityTableRow.cpp:

(WebCore::AccessibilityTableRow::isTableRow const):
(WebCore::AccessibilityTableRow::parentTable const):

  • accessibility/atk/WebKitAccessible.cpp:

(webkitAccessibleGetAttributes):

  • accessibility/atk/WebKitAccessibleInterfaceTable.cpp:

(webkitAccessibleTableGetColumnHeader):
(webkitAccessibleTableGetRowHeader):

  • accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:

(webkitAccessibleTableCellGetColumnHeaderCells):
(webkitAccessibleTableCellGetRowHeaderCells):

  • accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:

(-[WebAccessibilityObjectWrapper tableParent]):
(-[WebAccessibilityObjectWrapper accessibilityHeaderElements]):

  • accessibility/isolatedtree/AXIsolatedObject.cpp:

(WebCore::AXIsolatedObject::initializeAttributeData):
(WebCore::AXIsolatedObject::setObjectVectorProperty):
(WebCore::AXIsolatedObject::cellForColumnAndRow):
(WebCore::AXIsolatedObject::fillChildrenVectorForProperty const):
(WebCore::AXIsolatedObject::isAccessibilityTableInstance const):
(WebCore::AXIsolatedObject::isDataTable const): Deleted.

  • accessibility/isolatedtree/AXIsolatedObject.h:
  • accessibility/isolatedtree/AXIsolatedTree.cpp:

(WebCore::AXIsolatedTree::nodeForID const):
(WebCore::AXIsolatedTree::objectsForIDs const):

  • accessibility/isolatedtree/AXIsolatedTree.h:
  • accessibility/mac/AXObjectCacheMac.mm:

(WebCore::AXObjectCache::postPlatformNotification):

  • accessibility/mac/WebAccessibilityObjectWrapperMac.mm:

In addition to replacing the downcast to AccessibilityTable, cleaned up
the unnecessary calls to self.axBackingObject. This used to be a macro,
but it is now a method that check for the execution thread and returns
the appropriate AX object.
(-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
(-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
(-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):

4:31 PM Changeset in webkit [257199] by Adrian Perez de Castro
  • 17 edits in trunk/Source

Non-unified build fixes late February 2020 edition
https://bugs.webkit.org/show_bug.cgi?id=208111

Unreviewed build fix.

Source/WebCore:

No new tests needed.

  • dom/WindowEventLoop.cpp: Add missing include.
  • html/HTMLEmbedElement.cpp: Ditto.
  • html/HTMLFrameSetElement.cpp: Ditto.
  • html/HTMLOptionElement.cpp: Ditto.
  • html/HTMLTablePartElement.cpp: Ditto.
  • html/HTMLTextFormControlElement.cpp: Ditto.
  • html/RangeInputType.cpp: Ditto.
  • inspector/agents/InspectorCSSAgent.cpp: Ditto.
  • loader/ImageLoader.h: Add missing forward declration for WebCore::Document.
  • platform/graphics/ImageBuffer.cpp: Add missing include.
  • platform/graphics/filters/FilterEffect.cpp: Ditto.
  • platform/wpe/ThemeWPE.h: Add missing include and forward declaration for WebCore::Path.
  • svg/graphics/filters/SVGFilterBuilder.cpp: Add missing include.

Source/WebKit:

  • NetworkProcess/NetworkSocketChannel.cpp: Add missing include.
  • WebProcess/FullScreen/WebFullScreenManager.cpp:

(WebKit::screenRectOfContents): Add missing namespace to usage of WebCore::IntRect.
(WebKit::WebFullScreenManager::didExitFullScreen): Add missing namespace to usage of
WebCore::FloatBoxExtent.

2:12 PM Changeset in webkit [257198] by bshafiei@apple.com
  • 1 copy in tags/Safari-609.1.20.111.3

Tag Safari-609.1.20.111.3.

2:00 PM Changeset in webkit [257197] by bshafiei@apple.com
  • 8 edits in branches/safari-609.1.20.111-branch/Source

Versioning.

1:41 PM Changeset in webkit [257196] by Darin Adler
  • 17 edits in trunk/Source/WebCore

Follow up element iterator work by reducing includes and using is<> in a few more places
https://bugs.webkit.org/show_bug.cgi?id=207816

Reviewed by Antti Koivisto.

  • accessibility/AccessibilityTableColumn.cpp: Removed unneeded includes.
  • bindings/js/JSDOMWindowCustom.cpp: Ditto.
  • dom/CustomElementRegistry.cpp: Ditto.
  • dom/Node.cpp: Ditto.
  • editing/markup.cpp: Ditto.
  • html/GenericCachedHTMLCollection.cpp: Ditto.
  • html/HTMLCollection.cpp: Ditto.
  • html/HTMLFrameSetElement.cpp: Ditto.
  • html/track/TextTrackCue.cpp: Ditto.
  • page/scrolling/AxisScrollSnapOffsets.cpp: Ditto.
  • platform/DataListSuggestionsClient.h: Reduced includes, use forward declarations.
  • style/StyleResolver.cpp:

(WebCore::Style::isAtShadowBoundary): Use the is<ShadowRoot> function.

  • rendering/svg/RenderSVGResourceClipper.cpp:

(WebCore::RenderSVGResourceClipper::pathOnlyClipping): Use is<RenderSVGText> and
is<SVGGraphicsElement>, tweak coding style a tiny bit, and fix wording of comments.

  • svg/SVGAElement.cpp:

(WebCore::SVGAElement::createElementRenderer): Use is<SVGElement>.

  • svg/SVGElement.cpp: Removed unneeded includes.

(WebCore::SVGElement::isOutermostSVGSVGElement): Use is<SVGElement> and
is<SVGForeignObjectElement>.
(WebCore::SVGElement::reportAttributeParsingError): Use is<SVGElement>.
(WebCore::SVGElement::updateRelativeLengthsInformation): Use
is<SVGGraphicsElement> and is<SVGElement>, and use an if statement instead of
a while loop since this doesn't loop.

9:44 AM Changeset in webkit [257195] by Diego Pino Garcia
  • 2 edits in trunk/LayoutTests

[GTK] Mark several async loading tests as failure
https://bugs.webkit.org/show_bug.cgi?id=208105

Unreviewed gardening.

  • platform/gtk/TestExpectations:
7:16 AM Changeset in webkit [257194] by Darin Adler
  • 13 edits in trunk

Fix HTMLDataListElement.options to include even options that are not suggestions
https://bugs.webkit.org/show_bug.cgi?id=208102

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

  • web-platform-tests/html/semantics/forms/the-datalist-element/datalistoptions-expected.txt:

Expect this test to pass instead of failing.

Source/WebCore:

  • html/ColorInputType.cpp:

(WebCore::ColorInputType::suggestedColors const): Use
HTMLDataListElement::suggestions instead of HTMLCollection, both for efficiency
and for correctness.

  • html/GenericCachedHTMLCollection.cpp:

(WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches const):
Removed code to filter out options that are not valid suggestions. This is not
called for in the HTML specification.

  • html/HTMLDataListElement.cpp:

(WebCore::HTMLDataListElement::isSuggestion): Added.

  • html/HTMLDataListElement.h: Added isSuggestion and suggestions functions so

logic about which datalist options are suggestions can be easily shared. The
suggestions uses the new filteredDescendants function template.

  • html/HTMLInputElement.cpp:

(WebCore::HTMLInputElement::setupDateTimeChooserParameters): Use
HTMLDataListElement::suggestions instead of HTMLCollection.

  • html/TextFieldInputType.cpp:

(WebCore::TextFieldInputType::suggestions): Use
HTMLDataListElement::suggestions instead of HTMLCollection. Also added a FIXME
since this implementation uses case-insensitive ASCII but it's for user interface
and the current implementation might be insufficient for some lanagues.

  • rendering/RenderTheme.cpp:

(WebCore::RenderTheme::paintSliderTicks): Use
HTMLDataListElement::suggestions instead of HTMLCollection.

LayoutTests:

  • fast/forms/datalist/datalist-expected.txt: Updated expectations.
  • fast/forms/datalist/datalist.html: Updated test since the options collection

includes all options that are descendants, even ones that are not sugggestions.
The web platform tests already had this right; we had a failing test there.

4:20 AM Changeset in webkit [257193] by Diego Pino Garcia
  • 1 edit
    23 adds in trunk/LayoutTests

[GTK] Gardening, emit new baselines for WebGL tests
https://bugs.webkit.org/show_bug.cgi?id=208103

Unreviewed gardening.

  • platform/gtk/fast/canvas/webgl/copy-tex-image-and-sub-image-2d-bad-input-expected.txt: Added.
  • platform/gtk/fast/canvas/webgl/draw-elements-out-of-bounds-uint-index-expected.txt: Added.
  • platform/gtk/fast/canvas/webgl/drawElements-empty-vertex-data-expected.txt: Added.
  • platform/gtk/fast/canvas/webgl/readPixels-float-expected.txt: Added.
  • platform/gtk/fast/canvas/webgl/vertexAttribPointer-with-bad-offset-expected.txt: Added.
  • platform/gtk/fast/canvas/webgl/webgl-drawarrays-crash-2-expected.txt: Added.
  • platform/gtk/fast/canvas/webgl/webgl-drawarrays-crash-expected.txt: Added.
  • platform/gtk/webgl/1.0.3/conformance/context/context-lost-restored-expected.txt: Added.
  • platform/gtk/webgl/1.0.3/conformance/extensions/oes-texture-half-float-expected.txt: Added.
  • platform/gtk/webgl/1.0.3/conformance/glsl/misc/shaders-with-name-conflicts-expected.txt: Added.
  • platform/gtk/webgl/1.0.3/conformance/misc/webgl-specific-expected.txt: Added.
  • platform/gtk/webgl/1.0.3/conformance/rendering/point-no-attributes-expected.txt: Added.
  • platform/gtk/webgl/1.0.3/conformance/textures/texture-copying-feedback-loops-expected.txt: Added.

Feb 22, 2020:

11:16 PM Changeset in webkit [257192] by Darin Adler
  • 28 edits
    1 delete in trunk/Source/WebCore

Refine the DOM element iterator implementation
https://bugs.webkit.org/show_bug.cgi?id=208100

Reviewed by Antti Koivisto.

  • Removed the duplicate descendant iterator, keeping the one that matches the style of the ancestor and child iterators.
  • Removed the non-template elementAncestors, elementChildren, elementDescendants, and elementLineage functions and changed callers to use xxxOfType<Element> instead.
  • Renamed "IteratorAdapter" templates to "Range", choosing that term to match the upcoming C++20 Ranges library and range-based for loops.
  • Changed the iterators to use an actual "nullptr" for end, following the "sentinel" design pattern from the Ranges library. Still kept a tiny bit of using an iterator for end around, only so we can use iterator library functions like std::distance while waiting for std::ranges::distance, which is compatible with sentinels.
  • Implemented const correctness by using const types instead of separate "Const" class templates. This cut down on source code size a lot. These element iterators don't need whole separate templates to implement the const correctness the way collection classes like HashMap do.
  • Improved some other details, like using more const and constexpr on members. All the functions on a range are const, because the range itself doesn't ever get modified, and all functions on an iterator are also const, because only operations like ++ and -- actually modify the iterator.
  • For now at least, removed extra code we don't need in practice. We never need to compare iterators to each other except when iterating a range, for example, so kept the != used for range iteration but not ==.
  • Simplified the HTMLCollection implementations by taking advantage of the null- based and sentinel designs. There are various places where we can write simpler code and pass around fewer arguments.
  • Added a new descendantsOfType template that takes a predicate and filters to only the elements that match that predicate. Similar concept to how we implement HTML collections, and possibly could be used even more eventually.
  • Use std::iterator in ElementIterator so we don't need to do that in derived classes. Also made more of ElementIterator protected to make it more explicit that it's an abstract class template and not something to be used directly.

The most unusual clients of the elmeent ranges and iterators are HTMLCollection and
the related caches, and this patch includes changes to those to adopt the new model.

  • Headers.cmake: Removed ElementDescendantIterator.h.
  • WebCore.xcodeproj/project.pbxproj: Ditto.
  • dom/ChildNodeList.cpp:

(WebCore::ChildNodeList::ChildNodeList): Removed initialization of m_indexCache
since the constructor no longer requires arguments.
(WebCore::ChildNodeList::invalidateCache): Removed argument to
CollectionIndexCache::invalidate.

  • dom/ChildNodeList.h: Removed collectionEnd, since it's no longer needed.
  • dom/CollectionIndexCache.h: Removed the collection argument to the

constructor, hasValidCache, and invalidate functions. Updated algorithms to use
null style termination instead of actually relying on comparing with an end
iterator, since that works for our element iterators.

  • dom/ContainerNode.cpp:

(WebCore::ContainerNode::childElementCount const):: Use an empty initializer
list instead of the result of the end function since std::distance requires
both begin and end iterators have the same type.

  • dom/ElementAncestorIterator.h: Made the changes mentioned above, plus moved the

declarations of functions to the top of the file, since the classes are
implementation details, used downcast instead of static_cast.

  • dom/ElementAndTextDescendantIterator.h: Renamed IteratorAdapter to Range,

mostly didn't make other changes since this is not one of the element iterators.

  • dom/ElementChildIterator.h: Made the changes mentioned above, plus moved the

declarations of functions to the top of the file, since the classes are
implementation details.

  • dom/ElementDescendantIterator.h: Removed.
  • dom/ElementIterator.h: Made the changes mentioned above.
  • dom/LiveNodeList.cpp: Removed some unneeded includes, including HTMLCollection.h.

(WebCore::LiveNodeList::LiveNodeList): Simplified a little bit.
(WebCore::LiveNodeList::rootNode): Moved to the header.

  • dom/LiveNodeList.h: Updated since CollectionTraversal now uses the

more modern ElementDescendantIterator, not the older one that used a vector of
ancestors to do the iteration. Also use WTF_MAKE_ISO_NONALLOCATABLE since
LiveNodeList is an abstract class, and made some members protected. Removed
CachedLiveNodeList::rootNode since it was identical to LiveNodeList::rootNode,
and made LiveNodeList::rootNode protected so it can be called in
CachedLiveNodeList, and moved it to the header so it will still be inlined.
Simplified CachedListNodeList to use more final, to name long types less by
using "auto" and "using", and to not pass arguments to functions that don't
need them any more.

  • dom/NameNodeList.cpp:

(WebCore::NameNodeList::create): Moved here from the header.

  • dom/NameNodeList.h: Removed unneeded includes and comment, moved create

function out of the header.

  • dom/TypedElementDescendantIterator.h: Made all the change mentioned above.

Also added a new filteredDescendants function, range, and iterator that uses
a filter function. Not used yet in this patch; use comes in a future one.

  • html/CachedHTMLCollection.h: Updated includes, shortened type names,

and used auto to simplify the code a bit. Removed unneeded collection arguments
from various CollectionIndexCache functions.

  • html/CollectionTraversal.h: Updated to use the new/typed version of

ElementDescendantIterator. Removed end functions. Use shorter type names.
Tweaked algorithms to use null termination for loops instead of end iterators.

  • html/HTMLFormControlsCollection.h:

(WebCore::HTMLFormControlsCollection::item const): Removed unneeded class
template arguments.

  • html/HTMLFormElement.cpp:

(WebCore::HTMLFormElement::formElementIndex): Changed to use the null check
instead of comparing iterator with end.

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::selectNextSourceChild): Ditto.

  • html/HTMLTableSectionElement.cpp:

(WebCore::HTMLTableSectionElement::numRows const): Pass a default-constructed
iterator for end to std::distance. When we get C++20 we can clean this up by
using std::ranges::distances instead.

  • html/LabelsNodeList.cpp:

(WebCore::LabelsNodeList::create): Moved here from the header.

  • html/LabelsNodeList.h: Removed unneeded include, tweaked coding style a bit,

moved create function into the .cpp file.

  • html/RadioNodeList.cpp: Removed unneeded include.

(WebCore::RadioNodeList::create): Moved this here from the header.
(WebCore::nonEmptyRadioButton): Renamed from toRadioButtonInputElement to make
a little clearer what the function does.
(WebCore::RadioNodeList::value const): Updated to use nonEmptyRadioButton and
straighten out the loop a tiny bit.
(WebCore::RadioNodeList::setValue): Ditto.
(WebCore::RadioNodeList::checkElementMatchesRadioNodeListFilter const): Deleted.
(WebCore::RadioNodeList::elementMatches const): Merged in the logic from
checkElementMatchesRadioNodeListFilter, since the separate function wasn't helpful.

  • html/RadioNodeList.h: Removed unneeded includes. Moved the create function out

of the header. Removed unneeded override of the item function to tighten the
return type; not used in WebCore and not helpful for bindings. Made more private.

  • style/StyleInvalidator.cpp:

(WebCore::Style::Invalidator::invalidateStyleForDescendants): Use null checking
style for the loop rather than comparing with end.
(WebCore::Style::Invalidator::invalidateStyleWithMatchElement): Remove an unneeded
local variable and braces.

  • svg/SVGUseElement.cpp:

(WebCore::removeDisallowedElementsFromSubtree): Use null checking style rather than
comparing with end.
(WebCore::SVGUseElement::expandUseElementsInShadowTree const): Ditto. Also use
dropAssertions rather than assigning to end with a comment saying it drops assertions.
(WebCore::SVGUseElement::expandSymbolElementsInShadowTree const): Ditto.

11:16 PM Changeset in webkit [257191] by Darin Adler
  • 13 edits in trunk

Fix some include mistakes and make some coding style tweaks to WebKit and WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=208099

Reviewed by Antti Koivisto.

Source/WebKit:

  • WebProcess/FullScreen/WebFullScreenManager.cpp: Removed some unneeded includes.
  • WebProcess/WebCoreSupport/WebChromeClient.cpp: Removed some unneeded includes.

(WebKit::WebChromeClient::createDataListSuggestionPicker): Pass references.

  • WebProcess/WebCoreSupport/WebDataListSuggestionPicker.cpp:

(WebKit::WebDataListSuggestionPicker::WebDataListSuggestionPicker): Take references
instead of pointers, since they must both be non-null.
(WebKit::WebDataListSuggestionPicker::handleKeydownWithIdentifier): Updated
to use reference.
(WebKit::WebDataListSuggestionPicker::didSelectOption): Ditto.
(WebKit::WebDataListSuggestionPicker::didCloseSuggestions): Ditto.
(WebKit::WebDataListSuggestionPicker::close): Ditto.
(WebKit::WebDataListSuggestionPicker::displayWithActivationType): Ditto.

  • WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h: Marked the class

final, made more functions private, use references instead of pointers,
renamed m_dataListSuggestionsClient to m_client since there is only one
client we are dealing with in this class.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::setActiveDataListSuggestionPicker): Take reference.

  • WebProcess/WebPage/WebPage.h: Updated for the above.

Source/WebKitLegacy/mac:

  • DOM/DOMDocument.mm: Removed unneeded includes and re-sorted.
  • DOM/DOMDocumentFragment.mm: Ditto.
  • DOM/DOMHTMLFieldSetElement.mm: Ditto.

Tools:

  • WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm:

Sorted includes the traditional way. Added an include of AccessibilityCommonMac.h
so we can use the -[NSString createJSStringRef] method.
(-[NSString createJSStringRef]): Deleted. This is a duplicate of the method
defined in AccessibilityCommonMac.mm, and was causing a linker warning.

11:15 PM Changeset in webkit [257190] by Darin Adler
  • 4 edits
    4 adds in trunk

Put more of the datalist element implementation inside ENABLE(DATALIST_ELEMENT)
https://bugs.webkit.org/show_bug.cgi?id=208098

Reviewed by Antti Koivisto.

Source/WebCore:

  • html/HTMLFormControlElement.cpp:

(WebCore::HTMLFormControlElement::computeWillValidate const): Use
ancestorsOfType instead of a loop. Since this involves using the class
HTMLDataListElement, it's only implemented when ENABLE(DATALIST_ELEMENT)
is true. The old code would always do this validation for elements with
the datalist tag even if the element is not implemented, so this changes
behavior and affects some test results.

LayoutTests:

  • platform/mac-wk1/TestExpectations: Removed some lines for tests that no longer

exist at the paths mentioned.

  • platform/mac-wk1/fast/forms/form-pseudo-valid-style-expected.txt: Added.
  • platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-willValidate-expected.txt: Added.
  • platform/win/fast/forms/form-pseudo-valid-style-expected.txt: Added.

Expect failure on the parts of these tests that are specific to datalist, since
datalist is not enabled in these configurations (mac-wk1) and (win). Before now,
the code wasn't properly conditionalized and some of the datalist behavior would
be active even when the feature was not enabled. Best longer term solution is to
turn this feature on for more platforms, perhaps all of them. For now, landed new
expected results for cases that EWS indicated; more may be necessary if there are
more platforms where this feature is not enabled.

9:45 PM Changeset in webkit [257189] by jer.noble@apple.com
  • 20 edits
    3 deletes in trunk/Source

Stop using QTKit for rendering WK1 video fullscreen controls
https://bugs.webkit.org/show_bug.cgi?id=207795
<rdar://problem/48894915>

Reviewed by Jon Lee.

Source/WebCore:

Drive-by fixes:

  • Don't set the video layer to not-visible when in video fullscreen mode.
  • Export previously un-exported methods.
  • Make some ios-only classes available on mac.
  • Add a couple previously unimplemented properties to WebAVPlayerController needed by AVKit.
  • WebCoreFullscreenWindow doesn't depend on FULLSCREEN_API.
  • WebCore.xcodeproj/project.pbxproj:
  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::visibilityStateChanged):

  • html/HTMLMediaElement.h:

(WebCore::HTMLMediaElement::setVideoFullscreenLayer):

  • platform/ios/PlaybackSessionInterfaceAVKit.h:
  • platform/ios/PlaybackSessionInterfaceAVKit.mm:

(WebCore::PlaybackSessionInterfaceAVKit::externalPlaybackChanged):

  • platform/ios/WebAVPlayerController.h:
  • platform/ios/WebAVPlayerController.mm:

(-[WebAVPlayerController canSeekFrameBackward]):
(-[WebAVPlayerController canSeekFrameForward]):

  • platform/mac/WebCoreFullScreenWindow.h:
  • platform/mac/WebCoreFullScreenWindow.mm:

Source/WebCore/PAL:

  • PAL.xcodeproj/project.pbxproj:
  • pal/spi/cocoa/AVKitSPI.h:
  • pal/spi/mac/NSWindowSPI.h:
  • pal/spi/mac/QTKitSPI.h: Removed.

Source/WebKit:

Use NSWindowSPI.h rather than declaring SPI in the source file.

  • UIProcess/mac/WKFullScreenWindowController.mm:

Source/WebKitLegacy/mac:

Switch to using AVPlayerView instead of QTHUD to render our fullscreen controls.

In addition, switch to a modern NSWindow fullscreen API, with custom, smooth animations which
move the fullscreen window to a separate space. This requires subclassing AVPlayerView so that
fullscreen toggling will signal to the controller, so that our fullscreen button and the inline
version of same don't get out of sync. Because AVPlayerView requires an AVPlayer in order to
display the video layer, and we won't necessarily have an AVPlayer for MSE-backed videos, instead
install a custom overlay view inside the AVPlayerView in which to host the fullscreen video layer.

  • WebView/WebVideoFullscreenController.h:
  • WebView/WebVideoFullscreenController.mm:

(-[WebOverlayLayer layoutSublayers]):
(WebAVPlayerView_delegate):
(WebAVPlayerView_setDelegate):
(WebAVPlayerView_isFullScreen):
(WebAVPlayerView_enterFullScreen):
(WebAVPlayerView_exitFullScreen):
(allocWebAVPlayerViewInstance):
(-[WebVideoFullscreenController init]):
(-[WebVideoFullscreenController dealloc]):
(-[WebVideoFullscreenController fullscreenWindow]):
(-[WebVideoFullscreenController windowDidLoad]):
(-[WebVideoFullscreenController setVideoElement:]):
(-[WebVideoFullscreenController enterFullscreen:]):
(-[WebVideoFullscreenController exitFullscreen]):
(-[WebVideoFullscreenController applicationDidResignActive:]):
(-[WebVideoFullscreenController _requestExit]):
(-[WebVideoFullscreenController _requestEnter]):
(-[WebVideoFullscreenController cancelOperation:]):
(-[WebVideoFullscreenController playerViewIsFullScreen:]):
(-[WebVideoFullscreenController playerViewRequestEnterFullscreen:]):
(-[WebVideoFullscreenController playerViewRequestExitFullscreen:]):
(-[WebVideoFullscreenController customWindowsToEnterFullScreenForWindow:]):
(-[WebVideoFullscreenController window:startCustomAnimationToEnterFullScreenWithDuration:]):
(-[WebVideoFullscreenController customWindowsToExitFullScreenForWindow:]):
(-[WebVideoFullscreenController window:startCustomAnimationToExitFullScreenWithDuration:]):
(-[WebVideoFullscreenController windowDidEnterFullScreen:]):
(-[WebVideoFullscreenController windowWillExitFullScreen:]):
(-[WebVideoFullscreenController windowDidExitFullScreen:]):
(-[WebVideoFullscreenController clearFadeAnimation]): Deleted.
(-[WebVideoFullscreenController windowDidExitFullscreen]): Deleted.
(-[WebVideoFullscreenController windowDidEnterFullscreen]): Deleted.
(frameExpandedToRatioOfFrame): Deleted.
(createBackgroundFullscreenWindow): Deleted.
(-[WebVideoFullscreenController setupFadeAnimationIfNeededAndFadeIn:]): Deleted.
(-[WebVideoFullscreenController applicationDidChangeScreenParameters:]): Deleted.
(-[WebVideoFullscreenController updateMenuAndDockForFullscreen]): Deleted.
(-[WebVideoFullscreenController requestExitFullscreenWithAnimation:]): Deleted.
(-[WebVideoFullscreenController requestExitFullscreen]): Deleted.
(-[WebVideoFullscreenController fadeHUDIn]): Deleted.
(-[WebVideoFullscreenController observeValueForKeyPath:ofObject:change:context:]): Deleted.
(-[WebVideoFullscreenController rateChanged:]): Deleted.
(-[WebVideoFullscreenWindow initWithContentRect:styleMask:backing:defer:]): Deleted.
(-[WebVideoFullscreenWindow dealloc]): Deleted.
(-[WebVideoFullscreenWindow resignFirstResponder]): Deleted.
(-[WebVideoFullscreenWindow canBecomeKeyWindow]): Deleted.
(-[WebVideoFullscreenWindow mouseDown:]): Deleted.
(-[WebVideoFullscreenWindow cancelOperation:]): Deleted.
(-[WebVideoFullscreenWindow animatedResizeDidEnd]): Deleted.
(-[WebVideoFullscreenWindow animateFromRect:toRect:withSubAnimation:controllerAction:]): Deleted.
(-[WebVideoFullscreenWindow animationDidEnd:]): Deleted.
(-[WebVideoFullscreenWindow mouseMoved:]): Deleted.

  • WebView/WebVideoFullscreenHUDWindowController.h: Removed.
  • WebView/WebVideoFullscreenHUDWindowController.mm: Removed.
8:56 PM Changeset in webkit [257188] by Darin Adler
  • 43 edits in trunk/Source

Use DOM element iterators more, and more consistently
https://bugs.webkit.org/show_bug.cgi?id=208097

Reviewed by Antti Koivisto.

Source/WebCore:

  • Added uses of element iterators in many places that had hand-written loops.
  • Eliminated most uses of elementAncestors, elementChildren, elementDescendants, and elementLineage functions and use ancestorsOfType<Element>, childrenOfType<Element>, descendantsOfType<Element> and lineageOfType<Element> instead. In particular, descendantsOfType<Element> uses a better traversal algorithm than elementDescendants does.
  • Unrelated: Omit template arguments in various cases where the C++ language lets us just give the name of the class template without repeating the arguments.
  • Unrelated: Remove some uses of the inefficient Node::nodeType function.
  • accessibility/AccessibilityNodeObject.cpp:

(WebCore::AccessibilityNodeObject::mouseButtonListener const): Use
lineageOfType instead of elementLineage.

  • accessibility/AccessibilityRenderObject.cpp:

(WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest const):
Use ancestorsOfType instead of a handwritten loop.

  • dom/AllDescendantsCollection.h:

(WebCore::AllDescendantsCollection::AllDescendantsCollection): Removed
class template arguments.

  • dom/ClassCollection.h:

(WebCore::ClassCollection::ClassCollection): Ditto.

  • dom/DocumentFragment.cpp:

(WebCore::DocumentFragment::getElementById const): Use
descendantsOfType insteadof elementDescendants.

  • dom/Element.cpp:

(WebCore::Element::computeInheritedLanguage const): Use lineageOfType
instead of a handrwitten loop.

  • dom/SelectorQuery.cpp:

(WebCore::SelectorDataList::closest const): Use lineageOfType instead of an
explicit loop.
(WebCore::elementsForLocalName): Use descendantsOfType instead of elementDescendants.
(WebCore::anyElement): Ditto.
(WebCore::SelectorDataList::executeSingleTagNameSelectorData const): Ditto.
(WebCore::SelectorDataList::executeSingleClassNameSelectorData const): Ditto.
(WebCore::SelectorDataList::executeSingleSelectorData const): Ditto.
(WebCore::SelectorDataList::executeSingleMultiSelectorData const): Ditto.
(WebCore::SelectorDataList::executeCompiledSimpleSelectorChecker const): Ditto.
(WebCore::SelectorDataList::executeCompiledSelectorCheckerWithCheckingContext const): Ditto.
(WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData const): Ditto.

  • dom/TagCollection.cpp:

(WebCore::TagCollectionNS::TagCollectionNS): Removed class template arguments.
(WebCore::TagCollection::TagCollection): Ditto.
(WebCore::HTMLTagCollection::HTMLTagCollection): Ditto.

  • editing/Editor.cpp:

(WebCore::Editor::applyEditingStyleToBodyElement const): Use the function
descendantsOfType<HTMLBodyElement> instead of getElementByTagName(bodyTag).
Also merged applyEditingStyleToElement in here.
(WebCore::Editor::applyEditingStyleToElement const): Deleted.

  • editing/Editor.h: Deleted applyEditingStyleToElement.
  • editing/FrameSelection.cpp:

(WebCore::scanForForm): Cleaned up descendantsOfType loop so there's no
explicit use of end. Also changed if nesting a little bit.

  • editing/TextManipulationController.cpp:

(WebCore::ExclusionRuleMatcher::isExcluded): Use lineageOfType instead of
elementLineage.

  • html/HTMLAllCollection.h: Removed class template arguments.
  • html/HTMLElement.cpp:

(WebCore::elementAffectsDirectionality): Refactored so we get a more efficient
implementation when the type of the element is known.
(WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged):
Use lineageOfType instead of elementLineage.

  • html/HTMLElement.h: Removed some uneeeded forward declarations.
  • html/HTMLEmbedElement.cpp:

(WebCore::findWidgetRenderer): Use ancestorsOfType instead of a loop.

  • html/HTMLFormControlElement.cpp:

(WebCore::HTMLFormControlElement::enclosingFormControlElement): Deleted.

  • html/HTMLFormControlElement.h: Deleted unused enclosingFormControlElement.
  • html/HTMLFormControlsCollection.cpp:

(WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection): Removed
class template arguments.
(WebCore::HTMLFormControlsCollection::ownerNode const): Ditto.
(WebCore::HTMLFormControlsCollection::invalidateCacheForDocument): Ditto.

  • html/HTMLOptGroupElement.cpp:

(WebCore::HTMLOptGroupElement::ownerSelectElement const): Use ancestorsOfType
instead of a hand-written loop.

  • html/HTMLOptionElement.cpp:

(WebCore::HTMLOptionElement::parseAttribute): Use ancestorsOfType instead of
calling ownerDataListElement.
(WebCore::HTMLOptionElement::childrenChanged): Ditto.
(WebCore::HTMLOptionElement::ownerDataListElement const): Deleted. Since the
same option element can be used by multiple nested data list elements, the
concept of a single "owner" data list element isn't correct.
(WebCore::HTMLOptionElement::ownerSelectElement const): Use ancestorsOfType
instead of a hand-written loop.

  • html/HTMLOptionElement.h: Deleted ownerDataListElement.
  • html/HTMLOptionsCollection.cpp:

(WebCore::HTMLOptionsCollection::HTMLOptionsCollection): Removed class
template arguments.

  • html/HTMLTableCellElement.cpp:

(WebCore::HTMLTableCellElement::additionalPresentationAttributeStyle const):
Use auto since findParentTable now returns a const table pointer.

  • html/HTMLTableColElement.cpp:

(WebCore::HTMLTableColElement::additionalPresentationAttributeStyle const):
Ditto.

  • html/HTMLTableElement.cpp:

(WebCore::HTMLTableElement::createSharedCellStyle): Made const.
(WebCore::HTMLTableElement::additionalCellStyle): Ditto.
(WebCore::HTMLTableElement::additionalGroupStyle): Ditto.

  • html/HTMLTableElement.h: Made the functions const, and m_sharedCellStyle

mutable.

  • html/HTMLTablePartElement.cpp:

(WebCore::HTMLTablePartElement::findParentTable const): Use ancestorsOfType
instead of a hand-written loop. Also revised return type to be const-consistent.

  • html/HTMLTablePartElement.h: Updated return type.
  • html/HTMLTableRowsCollection.cpp:

(WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection): Removed class
template arguments.

  • html/HTMLTextFormControlElement.cpp:

(WebCore::parentHTMLElement): Deleted.
(WebCore::HTMLTextFormControlElement::directionForFormData const): Use
lineageOfType rather than a hand-written loop. Also got rid of the multiple
strings in return paths since the function always returns one of two strings.

  • inspector/InspectorAuditAccessibilityObject.cpp:

(WebCore::InspectorAuditAccessibilityObject::getElementsByComputedRole):
Use descendantsOfType instead of elementDescendants.

  • inspector/agents/InspectorCSSAgent.cpp:

(WebCore::InspectorCSSAgent::getMatchedStylesForNode): Use ancestorsOfType
instead of a hand-written loop.

  • inspector/agents/InspectorDOMAgent.cpp:

(WebCore::InspectorDOMAgent::inspect): Use isElementNode and isDocumentNode
instead of the much slower nodeType.
(WebCore::InspectorDOMAgent::highlightMousedOverNode): Use isTextNode instead of
the much slower nodeType.

  • page/DragController.cpp:

(WebCore::containingLinkElement): Added. Uses lineageOfType instead of elementLineage.
(WebCore::DragController::doSystemDrag): Updated for the above.

  • rendering/svg/SVGRenderSupport.cpp:

(WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending):
Use ancestorsOfType instead of a hand-written loop.

  • svg/SVGElement.h: Make computedStyle public so we can use it even after downcasting

to SVGElement or a class derived from it. This arises in the revised version of
SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending, which will now be able
to compile a non-virtual call to the function as a bonus.

  • xml/parser/XMLDocumentParser.cpp:

(WebCore::findXMLParsingNamespaces): Factored this function out from
parseDocumentFragment. Use lineageOfType instead of elementLineage. Also add a null
check that seems to have been needed before.
(WebCore::XMLDocumentParser::parseDocumentFragment): Use findXMLParsingNamespaces.

Source/WebKit:

  • WebProcess/Automation/WebAutomationSessionProxy.cpp:

(WebKit::containerElementForElement): Use ancestorsOfType to find the
HTMLDataListElement rather than an ownerDataListElement function.
While this behavior is correct as specified, the idea of an "owner"
data list element doesn't make sense since technically the same option
can be used for multiple nested data lists.

  • WebProcess/WebPage/WebFrame.cpp:

(WebKit::WebFrame::containsAnyFormElements const): Use childrenOfType
instead of NodeTraversal.
(WebKit::WebFrame::containsAnyFormControls const): Ditto.

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::containingLinkAnchorElement): Renamed to add the word "anchor"
since this won't return link elements that aren't HTMLAnchorElement
instances. Use lineageOfType<HTMLAnchorElement> instead of elementLineage
with a separate type check.
(WebKit::elementPositionInformation): Updated for new name.
(WebKit::WebPage::performActionOnElement): Ditto.

6:30 PM Changeset in webkit [257187] by Wenson Hsieh
  • 10 edits in trunk

fast/forms/ios/force-gregorian-calendar-for-credit-card-expiry.html is failing in iOS 13.4 beta
https://bugs.webkit.org/show_bug.cgi?id=208096
<rdar://problem/59632008>

Reviewed by Alexey Proskuryakov.

Tools:

In the iOS 13.4 beta, the fix for <rdar://problem/56422337> changed -[UIDatePicker setCalendar:], such that
if the new calendar locale matches that of the current calendar's locale (and several other properties of the
new NSCalendar are also unchanged), then the UIDatePicker's calendar will also avoid changing.

In our layout tests, the mechanism we use to simulate the user changing their preferred calendar is no longer
compatible with the above change since the swizzled NSCalendar instance does not have a locale set, so it will
default to the same locale as the one used in the original NSCalendar. This means the call to -setCalendar: ends
up being a no-op, so the test fails to override the simulated Japanese calendar type with a Gregorian calendar
in the credit card expiry field.

To fix this, additionally specify a calendar locale identifier when generating the mock NSCalendar.

  • TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
  • TestRunnerShared/UIScriptContext/UIScriptController.h:

(WTR::UIScriptController::setDefaultCalendarType):

  • WebKitTestRunner/TestController.h:

Change m_overriddenCalendarIdentifier to m_overriddenCalendarAndLocaleIdentifiers, a pair of calendar
identifier and calendar locale identifier.

  • WebKitTestRunner/cocoa/TestControllerCocoa.mm:

(WTR::swizzledCalendar):
(WTR::TestController::overriddenCalendarIdentifier const):
(WTR::TestController::overriddenCalendarLocaleIdentifier const):

Clean these up by returning the NSString * instead of making another RetainPtr.

(WTR::TestController::setDefaultCalendarType):

Plumb the new calendar's locale identifier through this method.

(WTR::TestController::cocoaResetStateToConsistentValues):
(WTR::TestController::getOverriddenCalendarIdentifier const): Deleted.

  • WebKitTestRunner/cocoa/UIScriptControllerCocoa.h:
  • WebKitTestRunner/cocoa/UIScriptControllerCocoa.mm:

(WTR::UIScriptControllerCocoa::setDefaultCalendarType):

LayoutTests:

Adjust the layout test to also set the mock calendar's locale.

  • fast/forms/ios/force-gregorian-calendar-for-credit-card-expiry.html:
  • resources/ui-helper.js:

(window.UIHelper.setDefaultCalendarType):

4:08 PM Changeset in webkit [257186] by Darin Adler
  • 8 edits in trunk/Source/WebCore

Some small improvements to DOM bindings for HTML collections
https://bugs.webkit.org/show_bug.cgi?id=208092

Reviewed by Antti Koivisto.

  • WebCore.xcodeproj/project.pbxproj: Added RadioNodeList.idl.
  • html/HTMLAllCollection.idl: Specify [RequiresExistingAtomString] on the

argument to namedItem, and [AtomString] for the argument to item.

  • html/HTMLCollection.idl: Ditto.
  • html/HTMLFormControlsCollection.idl: Ditto.
  • html/HTMLOptionsCollection.idl: Ditto.
  • html/HTMLSelectElement.idl: Ditto.
  • html/RadioNodeList.idl: Removed unneeded getter; the inherited one from NodeList

works correctly, and this isn't more efficient because of a more specific type.

4:27 AM WebKitGTK/2.26.x edited by clopez@igalia.com
(diff)
Note: See TracTimeline for information about the timeline view.