Timeline



Jul 23, 2017:

11:47 PM Changeset in webkit [219796] by Carlos Garcia Campos
  • 2 edits in trunk/Source/WebKit

Unreviewed. REGRESSION(r219713): [GTK][WPE] Fix default favicon database patch.

When nullptr is passed to webkit_web_context_set_favicon_database_directory() the default database directory was
taken from WebProcessPool::platformDefaultIconDatabasePath(), that has been removed in r219713 without properly
replacing it, now it uses an empty string. This causes that the current directory is used to create the favicon
database.

  • UIProcess/API/glib/WebKitWebContext.cpp:

(webkit_web_context_set_favicon_database_directory): Use the default icon database directory instead of an empty
string when nullptr is passed.

11:05 PM Changeset in webkit [219795] by Wenson Hsieh
  • 4 edits in trunk/Source

[iOS WK2] 5 DataInteractionTests are failing: observed selection rects after dropping don't match expected values
https://bugs.webkit.org/show_bug.cgi?id=174769
<rdar://problem/33478864>

Reviewed by Tim Horton.

Source/WebCore:

These tests began failing after r219541, due to a change in behavior of whether or not we call
setIgnoreSelectionChanges(false, RevealSelection::No) or setIgnoreSelectionChanges(false, RevealSelection::Yes)
when performing a text editing drop.

Before r219541, we would not reveal the selection when performing an edit drag operation. This is because in
WebPage::performDragControllerAction, we would begin ignoring selection changes by calling
setIgnoreSelectionChanges(true). However, while taking a text indicator snapshot, we would stop ignoring
selection in TextIndicator::createWithRange due to us calling setIgnoreSelectionChanges(false,
RevealSelection::No) at the end of the function. Then, when we return to the scope of
WebPage::performDragControllerAction and try to setIgnoreSelectionChanges(false), this is a no-op because we've
already stopped ignoring selection changes.

After r219541, switching to using TemporarySelectionChange means that TextIndicator::createWithRange now means
we respect whether or not we were already ignoring selection before taking the snapshot, so we won't always
setIgnoreSelectionChanges(false) at the end. This means that selection changes will now be correctly ignored
when performing a drag operation, but this also means that we'll try to reveal the selection, since
WebPage::performDragControllerAction calls setIgnoreSelectionChanges(false), for which RevealSelection::Yes
is used by default.

Revealing the selection in WebPage::performDragControllerAction was unintended in the first place, so we should
revert to calling setIgnoreSelectionChanges(false, RevealSelection::No). To ensure this, we adopt
TemporarySelectionChange here and pass only TemporarySelectionOptionIgnoreSelectionChanges, so that we won't
additionally try to reveal selection after the drop. This is consistent with behavior prior to macOS 10.13 and
iOS 11. Additionally, this patch also moves the call to ignore selection change from WebKit into WebCore, so
that whether we ignore selection is consistent across both WebKit1 and WebKit2.

  • page/DragController.cpp:

(WebCore::DragController::performDragOperation):

Source/WebKit:

Fixes several API tests in the DataInteractionTests suite. See Source/WebCore/ChangeLog for more details.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::performDragControllerAction):

10:58 PM Changeset in webkit [219794] by Carlos Garcia Campos
  • 9 edits in trunk/Source

WebDriver: implement page load timeout
https://bugs.webkit.org/show_bug.cgi?id=174672

Reviewed by Brian Burg.

Source/WebDriver:

Handle timeout errors and pass the page load timeout to waitForNavigationToComplete and all other navigation
commands. Also fix the setTimeouts command that was still using the legacy name of the page load timeout,
instead of the one in the spec.

  1. Sessions

https://www.w3.org/TR/webdriver/#dfn-session-page-load-timeout

  • CommandResult.cpp:

(WebDriver::CommandResult::CommandResult):
(WebDriver::CommandResult::httpStatusCode):
(WebDriver::CommandResult::errorString):

  • CommandResult.h:
  • Session.cpp:

(WebDriver::Session::go):
(WebDriver::Session::back):
(WebDriver::Session::forward):
(WebDriver::Session::refresh):
(WebDriver::Session::waitForNavigationToComplete):

  • WebDriverService.cpp:

(WebDriver::WebDriverService::setTimeouts):

Source/WebKit:

Always start a timer when waiting for a navigation to complete. When the timer fires, pending callbacks for
navigations are removed and invoked with a timeout error. If navigation completes before the timer is fired,
then the timer is stopped. All navigation commands now receive the page load strategy and timeout as optional
parameters, when not provided the default timeout (300 seconds) is used.

  • UIProcess/Automation/Automation.json:
  • UIProcess/Automation/WebAutomationSession.cpp:

(WebKit::WebAutomationSession::WebAutomationSession):
(WebKit::WebAutomationSession::waitForNavigationToComplete):
(WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):
(WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame):
(WebKit::WebAutomationSession::loadTimerFired):
(WebKit::WebAutomationSession::navigateBrowsingContext):
(WebKit::WebAutomationSession::goBackInBrowsingContext):
(WebKit::WebAutomationSession::goForwardInBrowsingContext):
(WebKit::WebAutomationSession::reloadBrowsingContext):
(WebKit::WebAutomationSession::navigationOccurredForFrame):

  • UIProcess/Automation/WebAutomationSession.h:
8:20 PM Changeset in webkit [219793] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WebKit

[GTK] Correct a typo in the reference manual of WebKitWebInspector
https://bugs.webkit.org/show_bug.cgi?id=174767

Patch by Takuro Ashie <ashie@clear-code.com> on 2017-07-23
Reviewed by Michael Catanzaro.

  • UIProcess/API/gtk/WebKitWebInspector.cpp:
7:10 PM Changeset in webkit [219792] by Chris Dumez
  • 117 edits
    2 deletes in trunk/Source

Drop ExceptionCodeDescription class
https://bugs.webkit.org/show_bug.cgi?id=174757

Reviewed by Darin Adler.

Source/WebCore:

Drop ExceptionCodeDescription class now that there is only one exception
type: DOMException. Instead, we now have static methods on DOMException
to get the name / message for a given exception code.

  • CMakeLists.txt:
  • Modules/indexeddb/shared/IDBError.cpp:

(WebCore::IDBError::name):
(WebCore::IDBError::message):

  • Modules/quota/StorageErrorCallback.cpp:

(WebCore::StorageErrorCallback::CallbackTask::CallbackTask):

  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSDOMExceptionHandling.cpp:

(WebCore::createDOMException):

  • dom/DOMAllInOne.cpp:
  • dom/DOMException.cpp:

(WebCore::errorCodeFromName):
(WebCore::DOMException::create):
(WebCore::DOMException::DOMException):
(WebCore::DOMException::name):
(WebCore::DOMException::message):

  • dom/DOMException.h:
  • dom/ExceptionCodeDescription.cpp: Removed.
  • dom/ExceptionCodeDescription.h: Removed.
  • inspector/DOMEditor.cpp:

(WebCore::populateErrorString):

  • inspector/InspectorDOMAgent.cpp:

(WebCore::InspectorDOMAgent::toErrorString):

  • inspector/InspectorDOMStorageAgent.cpp:

(WebCore::InspectorDOMStorageAgent::setDOMStorageItem):

Source/WebKit:

Update GTK bindings to use new API on DOMException instead of
ExceptionCodeDescription.

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:

(webkit_dom_attr_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:

(webkit_dom_cdata_section_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:

(webkit_dom_css_rule_set_css_text):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:

(webkit_dom_css_style_declaration_set_property):
(webkit_dom_css_style_declaration_set_css_text):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:

(webkit_dom_css_style_sheet_insert_rule):
(webkit_dom_css_style_sheet_delete_rule):
(webkit_dom_css_style_sheet_add_rule):
(webkit_dom_css_style_sheet_remove_rule):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:

(webkit_dom_css_value_set_css_text):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:

(webkit_dom_character_data_dispatch_event):
(webkit_dom_character_data_insert_data):
(webkit_dom_character_data_delete_data):
(webkit_dom_character_data_replace_data):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:

(webkit_dom_comment_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:

(webkit_dom_dom_implementation_create_document_type):
(webkit_dom_dom_implementation_create_document):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:

(webkit_dom_dom_selection_collapse_to_end):
(webkit_dom_dom_selection_collapse_to_start):
(webkit_dom_dom_selection_extend):
(webkit_dom_dom_selection_get_range_at):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:

(webkit_dom_dom_token_list_add):
(webkit_dom_dom_token_list_remove):
(webkit_dom_dom_token_list_toggle):
(webkit_dom_dom_token_list_replace):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:

(webkit_dom_dom_window_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:

(webkit_dom_node_set_prefix):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:

(webkit_dom_document_dispatch_event):
(webkit_dom_document_create_element):
(webkit_dom_document_create_cdata_section):
(webkit_dom_document_create_processing_instruction):
(webkit_dom_document_create_attribute):
(webkit_dom_document_import_node):
(webkit_dom_document_create_element_ns):
(webkit_dom_document_create_attribute_ns):
(webkit_dom_document_adopt_node):
(webkit_dom_document_create_event):
(webkit_dom_document_create_expression):
(webkit_dom_document_evaluate):
(webkit_dom_document_query_selector):
(webkit_dom_document_query_selector_all):
(webkit_dom_document_set_xml_version):
(webkit_dom_document_set_cookie):
(webkit_dom_document_set_body):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:

(webkit_dom_document_fragment_dispatch_event):
(webkit_dom_document_fragment_query_selector):
(webkit_dom_document_fragment_query_selector_all):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:

(webkit_dom_document_type_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:

(webkit_dom_element_dispatch_event):
(webkit_dom_element_set_attribute):
(webkit_dom_element_set_attribute_node):
(webkit_dom_element_remove_attribute_node):
(webkit_dom_element_set_attribute_ns):
(webkit_dom_element_set_attribute_node_ns):
(webkit_dom_element_matches):
(webkit_dom_element_closest):
(webkit_dom_element_insert_adjacent_element):
(webkit_dom_element_insert_adjacent_html):
(webkit_dom_element_insert_adjacent_text):
(webkit_dom_element_remove):
(webkit_dom_element_query_selector):
(webkit_dom_element_query_selector_all):
(webkit_dom_element_set_inner_html):
(webkit_dom_element_set_outer_html):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:

(webkit_dom_html_anchor_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:

(webkit_dom_html_applet_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:

(webkit_dom_html_area_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:

(webkit_dom_html_br_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:

(webkit_dom_html_base_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:

(webkit_dom_html_body_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:

(webkit_dom_html_button_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:

(webkit_dom_html_canvas_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:

(webkit_dom_html_d_list_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:

(webkit_dom_html_directory_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:

(webkit_dom_html_div_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:

(webkit_dom_html_document_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:

(webkit_dom_html_element_dispatch_event):
(webkit_dom_html_element_set_inner_text):
(webkit_dom_html_element_set_outer_text):
(webkit_dom_html_element_set_content_editable):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:

(webkit_dom_html_embed_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:

(webkit_dom_html_field_set_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:

(webkit_dom_html_font_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:

(webkit_dom_html_form_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:

(webkit_dom_html_frame_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:

(webkit_dom_html_frame_set_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:

(webkit_dom_html_hr_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:

(webkit_dom_html_head_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:

(webkit_dom_html_heading_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:

(webkit_dom_html_html_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:

(webkit_dom_html_iframe_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:

(webkit_dom_html_image_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:

(webkit_dom_html_input_element_dispatch_event):
(webkit_dom_html_input_element_set_max_length):
(webkit_dom_html_input_element_set_size):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:

(webkit_dom_html_li_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:

(webkit_dom_html_label_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:

(webkit_dom_html_legend_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:

(webkit_dom_html_link_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:

(webkit_dom_html_map_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:

(webkit_dom_html_marquee_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:

(webkit_dom_html_menu_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:

(webkit_dom_html_meta_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:

(webkit_dom_html_mod_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:

(webkit_dom_html_o_list_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:

(webkit_dom_html_object_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:

(webkit_dom_html_opt_group_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:

(webkit_dom_html_option_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:

(webkit_dom_html_paragraph_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:

(webkit_dom_html_param_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:

(webkit_dom_html_pre_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:

(webkit_dom_html_quote_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:

(webkit_dom_html_script_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:

(webkit_dom_html_select_element_dispatch_event):
(webkit_dom_html_select_element_add):
(webkit_dom_html_select_element_set_length):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:

(webkit_dom_html_style_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:

(webkit_dom_html_table_caption_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:

(webkit_dom_html_table_cell_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:

(webkit_dom_html_table_col_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:

(webkit_dom_html_table_element_dispatch_event):
(webkit_dom_html_table_element_insert_row):
(webkit_dom_html_table_element_delete_row):
(webkit_dom_html_table_element_set_caption):
(webkit_dom_html_table_element_set_t_head):
(webkit_dom_html_table_element_set_t_foot):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:

(webkit_dom_html_table_row_element_dispatch_event):
(webkit_dom_html_table_row_element_insert_cell):
(webkit_dom_html_table_row_element_delete_cell):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:

(webkit_dom_html_table_section_element_dispatch_event):
(webkit_dom_html_table_section_element_insert_row):
(webkit_dom_html_table_section_element_delete_row):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:

(webkit_dom_html_text_area_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:

(webkit_dom_html_title_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:

(webkit_dom_html_u_list_element_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:

(webkit_dom_media_list_delete_medium):
(webkit_dom_media_list_append_medium):
(webkit_dom_media_list_set_media_text):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:

(webkit_dom_named_node_map_set_named_item):
(webkit_dom_named_node_map_remove_named_item):
(webkit_dom_named_node_map_remove_named_item_ns):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp:

(webkit_dom_node_dispatch_event):
(webkit_dom_node_insert_before):
(webkit_dom_node_replace_child):
(webkit_dom_node_remove_child):
(webkit_dom_node_append_child):
(webkit_dom_node_clone_node_with_error):
(webkit_dom_node_set_node_value):
(webkit_dom_node_set_text_content):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:

(webkit_dom_processing_instruction_dispatch_event):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:

(webkit_dom_range_set_start):
(webkit_dom_range_set_end):
(webkit_dom_range_set_start_before):
(webkit_dom_range_set_start_after):
(webkit_dom_range_set_end_before):
(webkit_dom_range_set_end_after):
(webkit_dom_range_select_node):
(webkit_dom_range_select_node_contents):
(webkit_dom_range_compare_boundary_points):
(webkit_dom_range_delete_contents):
(webkit_dom_range_extract_contents):
(webkit_dom_range_clone_contents):
(webkit_dom_range_insert_node):
(webkit_dom_range_surround_contents):
(webkit_dom_range_create_contextual_fragment):
(webkit_dom_range_compare_node):
(webkit_dom_range_intersects_node):
(webkit_dom_range_compare_point):
(webkit_dom_range_is_point_in_range):
(webkit_dom_range_expand):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:

(webkit_dom_text_dispatch_event):
(webkit_dom_text_split_text):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:

(webkit_dom_xpath_expression_evaluate):

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:

(webkit_dom_xpath_result_iterate_next):
(webkit_dom_xpath_result_snapshot_item):
(webkit_dom_xpath_result_get_number_value):
(webkit_dom_xpath_result_get_boolean_value):
(webkit_dom_xpath_result_get_single_node_value):
(webkit_dom_xpath_result_get_snapshot_length):

Source/WebKitLegacy/mac:

Stop using ExceptionCodeDescription.

  • DOM/ExceptionHandlers.mm:

(raiseDOMErrorException):

2:01 PM Changeset in webkit [219791] by Michael Catanzaro
  • 2 edits in trunk/Source/WTF

Implement FALLTHROUGH attribute for C with GCC
https://bugs.webkit.org/show_bug.cgi?id=174555

Reviewed by Darin Adler.

My previous attempt to silence the JSC -Wimplicit-fallthrough warnings failed because they
are coming from a C file, and our FALLTHROUGH macro is only implemented for C++. So
implement it for C as well, using C attribute syntax.

Note this is only possible to do for GCC, because Clang only supports this attribute using
the C++ attribute syntax?.

  • wtf/Compiler.h:
1:35 PM Changeset in webkit [219790] by mark.lam@apple.com
  • 8 edits
    1 add in trunk/Source/JavaScriptCore

Create regression tests for the JIT probe.
https://bugs.webkit.org/show_bug.cgi?id=174696
<rdar://problem/33436922>

Reviewed by Saam Barati.

The new testmasm will test the following:

  1. the probe is able to read the value of CPU registers.
  2. the probe is able to write the value of CPU registers.
  3. the probe is able to preserve all CPU registers.
  4. special case of (2): the probe is able to change the value of the stack pointer.
  5. special case of (2): the probe is able to change the value of the program counter i.e. the probe can change where the code continues executing upon returning from the probe.

Currently, the x86, x86_64, and ARMv7 ports passes the test. ARM64 does not
because it does not support changing the sp and pc yet. The ARM64 probe
implementation will be fixed in https://bugs.webkit.org/show_bug.cgi?id=174697
later.

  • Configurations/ToolExecutable.xcconfig:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • assembler/MacroAssembler.h:

(JSC::MacroAssembler::CPUState::pc):
(JSC::MacroAssembler::CPUState::fp):
(JSC::MacroAssembler::CPUState::sp):
(JSC::ProbeContext::pc):
(JSC::ProbeContext::fp):
(JSC::ProbeContext::sp):

  • assembler/MacroAssemblerARM64.cpp:

(JSC::arm64ProbeTrampoline):

  • assembler/MacroAssemblerPrinter.cpp:

(JSC::Printer::printPCRegister):

  • assembler/testmasm.cpp: Added.

(hiddenTruthBecauseNoReturnIsStupid):
(usage):
(JSC::nextID):
(JSC::isPC):
(JSC::isSP):
(JSC::isFP):
(JSC::compile):
(JSC::invoke):
(JSC::compileAndRun):
(JSC::testSimple):
(JSC::testProbeReadsArgumentRegisters):
(JSC::testProbeWritesArgumentRegisters):
(JSC::testFunctionToTrashRegisters):
(JSC::testProbePreservesGPRS):
(JSC::testProbeModifiesStackPointer):
(JSC::testProbeModifiesProgramCounter):
(JSC::run):
(run):
(main):

  • b3/air/testair.cpp:

(usage):

  • shell/CMakeLists.txt:
12:02 PM Changeset in webkit [219789] by jmarcell@apple.com
  • 4 edits
    2 adds in branches/safari-604-branch

Cherry-pick r219571. rdar://problem/33464710

10:00 AM WebKitGTK/2.16.x edited by clopez@igalia.com
(diff)

Jul 22, 2017:

11:52 PM Changeset in webkit [219788] by jmarcell@apple.com
  • 10 edits in branches/safari-604-branch

Cherry-pick r219662. rdar://problem/33464110

11:52 PM Changeset in webkit [219787] by jmarcell@apple.com
  • 2 edits in branches/safari-604-branch/Source/WebCore

Cherry-pick r219711. rdar://problem/33465715

11:52 PM Changeset in webkit [219786] by jmarcell@apple.com
  • 17 edits in branches/safari-604-branch

Cherry-pick r219709. rdar://problem/33462692

11:51 PM Changeset in webkit [219785] by jmarcell@apple.com
  • 4 edits in branches/safari-604-branch/Source

Cherry-pick r219703. rdar://problem/33462696

11:51 PM Changeset in webkit [219784] by jmarcell@apple.com
  • 4 edits in branches/safari-604-branch/Source

Cherry-pick r219701. rdar://problem/33465715

11:51 PM Changeset in webkit [219783] by jmarcell@apple.com
  • 4 edits in branches/safari-604-branch/Source/WebCore

Cherry-pick r219683. rdar://problem/33464463

11:51 PM Changeset in webkit [219782] by jmarcell@apple.com
  • 28 edits
    1 copy in branches/safari-604-branch

Cherry-pick r219668. rdar://problem/33462676

11:51 PM Changeset in webkit [219781] by jmarcell@apple.com
  • 5 edits in branches/safari-604-branch

Cherry-pick r219666. rdar://problem/33464328

11:51 PM Changeset in webkit [219780] by jmarcell@apple.com
  • 10 edits in branches/safari-604-branch

Cherry-pick r219664. rdar://problem/33464115

11:51 PM Changeset in webkit [219779] by jmarcell@apple.com
  • 3 edits
    2 adds in branches/safari-604-branch

Cherry-pick r219661. rdar://problem/33465132

11:51 PM Changeset in webkit [219778] by jmarcell@apple.com
  • 2 edits in branches/safari-604-branch/Source/WebCore

Cherry-pick r219645. rdar://problem/33464440

11:51 PM Changeset in webkit [219777] by jmarcell@apple.com
  • 2 edits in branches/safari-604-branch/Source/WebCore

Cherry-pick r219641. rdar://problem/33464325

11:51 PM Changeset in webkit [219776] by jmarcell@apple.com
  • 4 edits in branches/safari-604-branch/Source/JavaScriptCore

Cherry-pick r219633. rdar://problem/33465535

11:50 PM Changeset in webkit [219775] by jmarcell@apple.com
  • 2 edits in branches/safari-604-branch/Source/WebKitLegacy/mac

Cherry-pick r219626. rdar://problem/33465685

11:50 PM Changeset in webkit [219774] by jmarcell@apple.com
  • 4 edits
    2 adds in branches/safari-604-branch

Cherry-pick r219625. rdar://problem/33465689

11:50 PM Changeset in webkit [219773] by jmarcell@apple.com
  • 4 edits in branches/safari-604-branch/Source/WebCore

Cherry-pick r219621. rdar://problem/33465059

11:50 PM Changeset in webkit [219772] by jmarcell@apple.com
  • 4 edits in branches/safari-604-branch/Source/WebCore

Cherry-pick r219591. rdar://problem/33464112

11:50 PM Changeset in webkit [219771] by jmarcell@apple.com
  • 2 edits in branches/safari-604-branch/Tools

Cherry-pick r219590. rdar://problem/33465177

11:50 PM Changeset in webkit [219770] by jmarcell@apple.com
  • 3 edits in branches/safari-604-branch/Source/WebKit

Cherry-pick r219588. rdar://problem/33464447

11:50 PM Changeset in webkit [219769] by jmarcell@apple.com
  • 14 edits
    1 add in branches/safari-604-branch

Cherry-pick r219585. rdar://problem/33465177

10:28 PM Changeset in webkit [219768] by Wenson Hsieh
  • 10 edits
    4 deletes in trunk

[iOS WK2] Remove _WKDraggableElementInfo and fold PositionInformationTests into WKRequestActivatedElementInfo
https://bugs.webkit.org/show_bug.cgi?id=174758

Reviewed by Dan Bernstein.

Source/WebKit:

_WKDraggableElementInfo is no longer used in WebKit, so it should be removed. However, some of the scenarios
in PositionInformationTests that depend on _WKDraggableElementInfo are still useful to exercise: namely,
performing both synchronous and asynchronous position information updates while an async position information
update is in flight. This patch refactors these unit tests into 2 new unit tests in the existing
WKRequestActivatedElementInfo test suite.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _draggableElementAtPosition:]): Deleted.
(-[WKWebView _requestDraggableElementAtPosition:completionBlock:]): Deleted.

  • UIProcess/API/Cocoa/WKWebViewPrivate.h:
  • UIProcess/API/Cocoa/_WKDraggableElementInfo.h: Removed.
  • UIProcess/API/Cocoa/_WKDraggableElementInfo.mm: Removed.
  • UIProcess/API/Cocoa/_WKDraggableElementInfoInternal.h: Removed.
  • UIProcess/ios/WKContentViewInteraction.mm:
  • WebKit.xcodeproj/project.pbxproj:

Tools:

Migrate position-information-related unit tests from the PositionInformationTests suite to
WKRequestActivatedElementInfo as 2 new unit tests. See WebKit2 ChangeLog for more details.

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKit2Cocoa/WKRequestActivatedElementInfo.mm:

(TestWebKitAPI::checkElementTypeAndBoundingRect):
(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/ios/PositionInformationTests.mm: Removed.
  • TestWebKitAPI/cocoa/TestWKWebView.h:
  • TestWebKitAPI/cocoa/TestWKWebView.mm:

(-[TestWKWebView activatedElementAtPosition:]):

3:31 PM Changeset in webkit [219767] by mitz@apple.com
  • 2 edits in trunk/Source/WebCore

Fixed building for macOS 10.12 with the macOS 10.13 SDK after r219644.

  • platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:

(WebCore::CDMSessionAVStreamSession::update): Suppress the objc-literal-conversion warning

in one place where we are calling a class method on a Class and the compiler can’t tell
which class it is, so it chooses wrong and emits a warning.

2:20 PM Changeset in webkit [219766] by Chris Dumez
  • 71 edits
    2 deletes in trunk

Merge ExceptionBase into DOMException and drop custom toString
https://bugs.webkit.org/show_bug.cgi?id=174755

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Rebaseline some tests now that DOMException's custom toString has been dropped
and we rely on Error's toString. This causes the exception message to be
slightly different.

  • web-platform-tests/WebCryptoAPI/derive_bits_keys/test_ecdh_bits.https-expected.txt:
  • web-platform-tests/WebCryptoAPI/derive_bits_keys/test_ecdh_keys.https-expected.txt:
  • web-platform-tests/resource-timing/resource_TAO_match_origin-expected.txt:
  • web-platform-tests/resource-timing/resource_TAO_match_wildcard-expected.txt:
  • web-platform-tests/resource-timing/resource_TAO_multi-expected.txt:
  • web-platform-tests/resource-timing/resource_TAO_null-expected.txt:
  • web-platform-tests/resource-timing/resource_TAO_origin-expected.txt:
  • web-platform-tests/resource-timing/resource_TAO_origin_uppercase-expected.txt:
  • web-platform-tests/resource-timing/resource_TAO_space-expected.txt:
  • web-platform-tests/resource-timing/resource_TAO_wildcard-expected.txt:
  • web-platform-tests/resource-timing/resource_TAO_zero-expected.txt:
  • web-platform-tests/webrtc/RTCPeerConnection-addIceCandidate-expected.txt:

Source/WebCore:

Merge ExceptionBase into DOMException and drop custom toString, now that DOMException
is the only remaining exception type.

  • CMakeLists.txt:
  • Modules/mediastream/MediaStream.h:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSDOMExceptionHandling.cpp:

(WebCore::retrieveErrorMessage):

  • dom/DOMAllInOne.cpp:
  • dom/DOMException.cpp:

(WebCore::DOMException::DOMException):
(WebCore::DOMException::initializeDescription):

  • dom/DOMException.h:

(WebCore::DOMException::code):
(WebCore::DOMException::name):
(WebCore::DOMException::message):

  • dom/ExceptionBase.cpp: Removed.
  • dom/ExceptionBase.h: Removed.

LayoutTests:

Rebaseline some tests now that DOMException's custom toString has been dropped
and we rely on Error's toString. This causes the exception message to be
slightly different.

  • fast/canvas/canvas-getImageData-invalid-result-buffer-crash-expected.txt:
  • fast/frames/sandboxed-iframe-history-denied-expected.txt:
  • fast/frames/sandboxed-iframe-navigation-top-denied-expected.txt:
  • fast/inspector-support/uncaught-dom1-exception-expected.txt:
  • fast/inspector-support/uncaught-dom3-exception-expected.txt:
  • fast/inspector-support/uncaught-dom8-exception-expected.txt:
  • fast/regions/selection/crash-deselect-expected.txt:
  • http/tests/security/listener/xss-JSTargetNode-onclick-addEventListener-expected.txt:
  • http/tests/security/listener/xss-JSTargetNode-onclick-shortcut-expected.txt:
  • http/tests/security/listener/xss-XMLHttpRequest-addEventListener-expected.txt:
  • http/tests/security/listener/xss-XMLHttpRequest-shortcut-expected.txt:
  • http/tests/security/listener/xss-window-onclick-addEventListener-expected.txt:
  • http/tests/security/listener/xss-window-onclick-shortcut-expected.txt:
  • http/tests/security/sandboxed-iframe-blocks-access-from-parent-expected.txt:
  • http/tests/security/sandboxed-iframe-modify-self-expected.txt:
  • http/tests/security/srcdoc-in-sandbox-cannot-access-parent-expected.txt:
  • http/tests/security/xss-DENIED-assign-location-hash-expected.txt:
  • http/tests/security/xss-DENIED-assign-location-host-expected.txt:
  • http/tests/security/xss-DENIED-assign-location-hostname-expected.txt:
  • http/tests/security/xss-DENIED-assign-location-nonstandardProperty-expected.txt:
  • http/tests/security/xss-DENIED-assign-location-pathname-expected.txt:
  • http/tests/security/xss-DENIED-assign-location-protocol-expected.txt:
  • http/tests/security/xss-DENIED-assign-location-reload-expected.txt:
  • http/tests/security/xss-DENIED-assign-location-search-expected.txt:
  • http/tests/security/xss-DENIED-frame-name-expected.txt:
  • http/tests/security/xss-DENIED-sandboxed-iframe-expected.txt:
  • http/tests/security/xss-DENIED-window-name-navigator-expected.txt:
  • inspector/debugger/command-line-api-exception-expected.txt:
  • inspector/debugger/regress-133182-expected.txt:
  • inspector/debugger/setPauseOnExceptions-all-expected.txt:
  • inspector/debugger/setPauseOnExceptions-none-expected.txt:
  • inspector/debugger/setPauseOnExceptions-uncaught-expected.txt:
  • platform/mac/fast/dynamic/015-expected.txt:
12:57 PM Changeset in webkit [219765] by Wenson Hsieh
  • 2 edits in trunk/Source/WebKit

[Mac WK2] Fix null dereference in asynchronous NSTextInputClient methods when deallocating a WKWebView
https://bugs.webkit.org/show_bug.cgi?id=174751
<rdar://problem/33132405>

Reviewed by Darin Adler.

Tweaks -[WKWebView dealloc] to close the WebPageProxy at an earlier time, prior to destroying the WebViewImpl.
This fixes a NSTextInputClient crash in WKWebView when exercising the following scenario:

(1) Suppose that NSTextInputContext invokes an asynchronous text input query on WKWebView immediately before
WKWebView is deallocated, such that WebPageProxy's CallbackMap contains an NSTextInputContext callback at the
time that -[WKWebView dealloc] is called. Additionally, suppose that this callback from NSTextInputContext
invokes additional NSTextInputClient methods on the WKWebView that involve plumbing through to the WebViewImpl
(which is stored as _impl on the WKWebView).

(2) Observe that when calling [super dealloc] in [WKWebView dealloc], we will destroy the WebViewImpl as a
result of setting our unique pointer to _impl to be null. In ~WebViewImpl, we invoke WebPageProxy::close, which
in turn invokes WebPageProxy::resetState.

(3) WebPageProxy::resetState then calls m_callbacks.invalidate(error), which triggers all pending callbacks.
This invokes the block described in (1), which causes us to try and call back into WKWebView, invoking
NSTextInputClient methods. Without the fix in this patch, these methods currently assume that _impl is nonnull,
even though we've already cleared out the pointer in (2), so we segfault with a null dereference.

After this patch, we close the _page at an earlier time, such that the state is reset before the WebViewImpl
(and corresponding _impl unique_ptr in WKWebView) is torn down. This ensures that _impl will not be null for
callbacks invoked after beginning to deallocate the WKWebView.

Forcing this scenario in a custom AppKit root that triggers async NSTextInputClient methods immediately when a
WKWebView is being deallocated produces a crash with the same stack trace as what we observe in the radar, but
there are no known steps to actually reproduce this crash in shipping software.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView dealloc]):

10:31 AM Changeset in webkit [219764] by Chris Dumez
  • 6 edits in trunk

REGRESSION(r204565): WKObject is broken
https://bugs.webkit.org/show_bug.cgi?id=174736
<rdar://problem/33246169>

Reviewed by Dan Bernstein.

Source/WebKit:

Revert r204565 as making WKObject a root class caused unexpected crashes.
Instead, we now have WKObject inherit from NSProxy (instead of previously
NSObject) and we forward calls to the target.

We also need to provide an implementation for private methods such as
isNSString to address the issue with NSStrings that r204565 was trying
to fix.

  • Shared/Cocoa/APIObject.mm:

(API::Object::unwrap):

  • Shared/Cocoa/WKObject.h:
  • Shared/Cocoa/WKObject.mm:

(-[WKObject dealloc]):
(-[WKObject hash]):
(-[WKObject isKindOfClass:]):
(-[WKObject isMemberOfClass:]):
(-[WKObject respondsToSelector:]):
(-[WKObject conformsToProtocol:]):
(-[WKObject forwardingTargetForSelector:]):
(-[WKObject description]):
(-[WKObject debugDescription]):
(-[WKObject classForCoder]):
(-[WKObject classForKeyedArchiver]):
(-[WKObject _web_createTarget]):
(-[WKObject forwardInvocation:]):
(-[WKObject methodSignatureForSelector:]):
(-[WKObject isNSObject]):
(-[WKObject isNSArray
]):
(-[WKObject isNSCFConstantString]):
(-[WKObject isNSData
]):
(-[WKObject isNSDate]):
(-[WKObject isNSDictionary
]):
(-[WKObject isNSNumber]):
(-[WKObject isNSOrderedSet
]):
(-[WKObject isNSSet]):
(-[WKObject isNSString
]):
(-[WKObject isNSTimeZone]):
(-[WKObject isNSValue
]):

Tools:

Add API test that used to crash.

  • TestWebKitAPI/Tests/WebKit2Cocoa/WKObject.mm:

(TestWebKitAPI::TEST):

7:36 AM Changeset in webkit [219763] by fpizlo@apple.com
  • 31 edits
    1 add in trunk/Source

It should be easy to decide how WebKit yields
https://bugs.webkit.org/show_bug.cgi?id=174298

Reviewed by Saam Barati.
Source/bmalloc:


Use sched_yield() explicitly.

  • bmalloc/StaticMutex.cpp:

(bmalloc::StaticMutex::lockSlowCase):

Source/JavaScriptCore:


Use the new WTF::Thread::yield() function for yielding instead of the C++ function.

  • heap/Heap.cpp:

(JSC::Heap::resumeThePeriphery):

  • heap/VisitingTimeout.h:
  • runtime/JSCell.cpp:

(JSC::JSCell::lockSlow):
(JSC::JSCell::unlockSlow):

  • runtime/JSCell.h:
  • runtime/JSCellInlines.h:

(JSC::JSCell::lock):
(JSC::JSCell::unlock):

  • runtime/JSLock.cpp:

(JSC::JSLock::grabAllLocks):

  • runtime/SamplingProfiler.cpp:

Source/WebCore:

No new tests because the WebCore change is just a change to how we #include things.

  • inspector/InspectorPageAgent.h:
  • inspector/TimelineRecordFactory.h:
  • workers/Worker.h:
  • workers/WorkerGlobalScopeProxy.h:
  • workers/WorkerMessagingProxy.h:

Source/WebKitLegacy:

  • Storage/StorageTracker.h:

Source/WTF:


Created a Thread::yield() abstraction for sched_yield(), and made WTF use it everywhere that it
had previously used std::this_thread::yield().

To make it less annoying to experiment with changes to the lock algorithm in the future, this also
moves the meat of the algorithm into LockAlgorithmInlines.h. Only two files include that header.
Since LockAlgorithm.h no longer includes ParkingLot.h, a bunch of files in WK now need to include
timing headers (Seconds, MonotonicTime, etc) manually.

  • WTF.xcodeproj/project.pbxproj:
  • benchmarks/ToyLocks.h:
  • wtf/CMakeLists.txt:
  • wtf/Lock.cpp:
  • wtf/LockAlgorithm.h:

(WTF::LockAlgorithm::lockSlow): Deleted.
(WTF::LockAlgorithm::unlockSlow): Deleted.

  • wtf/LockAlgorithmInlines.h: Added.

(WTF::hasParkedBit>::lockSlow):
(WTF::hasParkedBit>::unlockSlow):

  • wtf/MainThread.cpp:
  • wtf/RunLoopTimer.h:
  • wtf/Threading.cpp:
  • wtf/Threading.h:
  • wtf/ThreadingPthreads.cpp:

(WTF::Thread::yield):

  • wtf/ThreadingWin.cpp:

(WTF::Thread::yield):

  • wtf/WordLock.cpp:

(WTF::WordLockBase::lockSlow):
(WTF::WordLockBase::unlockSlow):

5:12 AM Changeset in webkit [219762] by commit-queue@webkit.org
  • 18 edits in trunk/Source/WebCore

REGRESSION(r219045): A partially loaded image may not be repainted when its complete frame finishes decoding
https://bugs.webkit.org/show_bug.cgi?id=174230

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-07-22
Reviewed by Simon Fraser.

Because of r219045, we now only repaint the CachedImageClinets which tried
to draw the image but they could not because they have to wait for the image
decoding to finish. This was done by keeping a HashSet of these clients
and make CachedImage own it. This HashSet is cleared once the image frame
finishes decoding and all the waited clients are repainted.

But Multiple asynchronous image decoding requests are allowed for the same
frame if new data is added to the image source. If we tried to draw the
same image twice before it finishes decoding the first request, we will
not be to record this second request since the HashSet will not add the
same client twice. When he second request finishes decoding, CachedImage
will not repaint any client since its HashSet is empty.

To fix this problem we can do the following. When an image frame finishes
decoding, CachedImage will keep its HashSet of pending drawing clients as
long as the image frame is a partially loaded frame.

  • loader/cache/CachedImage.cpp:

(WebCore::CachedImage::CachedImageObserver::imageFrameAvailable):
(WebCore::CachedImage::imageFrameAvailable):

  • loader/cache/CachedImage.h:
  • platform/graphics/BitmapImage.cpp:

(WebCore::BitmapImage::destroyDecodedData):
(WebCore::BitmapImage::dataChanged):
(WebCore::BitmapImage::setCurrentFrameDecodingStatusIfNecessary):
(WebCore::BitmapImage::draw):
(WebCore::BitmapImage::internalStartAnimation):
(WebCore::BitmapImage::internalAdvanceAnimation):
(WebCore::BitmapImage::imageFrameAvailableAtIndex):

  • platform/graphics/BitmapImage.h:
  • platform/graphics/ImageFrame.cpp:

(WebCore::ImageFrame::decodingStatus):

  • platform/graphics/ImageFrame.h: Move DecodingStatus out of this class

to ImageTypes.h to avoid adding other header files to ImageObvsever.h

  • platform/graphics/ImageFrameCache.cpp:

(WebCore::ImageFrameCache::setNativeImage):
(WebCore::ImageFrameCache::cacheMetadataAtIndex):
(WebCore::ImageFrameCache::cacheNativeImageAtIndex):
(WebCore::ImageFrameCache::cacheNativeImageAtIndexAsync):
(WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex):
(WebCore::ImageFrameCache::frameDecodingStatusAtIndex):

  • platform/graphics/ImageFrameCache.h:
  • platform/graphics/ImageObserver.h:
  • platform/graphics/ImageSource.h:

(WebCore::ImageSource::frameDecodingStatusAtIndex):

  • platform/graphics/ImageTypes.h:
  • platform/image-decoders/bmp/BMPImageReader.cpp:

(WebCore::BMPImageReader::decodeBMP):

  • platform/image-decoders/gif/GIFImageDecoder.cpp:

(WebCore::GIFImageDecoder::frameComplete):
(WebCore::GIFImageDecoder::initFrameBuffer):

  • platform/image-decoders/jpeg/JPEGImageDecoder.cpp:

(WebCore::JPEGImageDecoder::outputScanlines):
(WebCore::JPEGImageDecoder::jpegComplete):

  • platform/image-decoders/png/PNGImageDecoder.cpp:

(WebCore::PNGImageDecoder::rowAvailable):
(WebCore::PNGImageDecoder::pngComplete):
(WebCore::PNGImageDecoder::frameComplete):

  • platform/image-decoders/webp/WEBPImageDecoder.cpp:

(WebCore::WEBPImageDecoder::decode):

  • rendering/RenderBoxModelObject.cpp:

(WebCore::RenderBoxModelObject::decodingModeForImageDraw):

1:12 AM Changeset in webkit [219761] by timothy_horton@apple.com
  • 3 edits in trunk/Source/WebCore

Drag and Drop preview image for Twitter link is the wrong shape
https://bugs.webkit.org/show_bug.cgi?id=174731
<rdar://problem/33335616>

  • dom/Range.cpp:

(WebCore::Range::absoluteRectsForRangeInText):

  • page/TextIndicator.cpp:

(WebCore::initializeIndicator):
Apply some post-landing review feedback for r219756.

12:27 AM Changeset in webkit [219760] by Yusuke Suzuki
  • 8 edits in trunk

[WTF] Extend ThreadGroup::add results from bool to ThreadGroupAddResult
https://bugs.webkit.org/show_bug.cgi?id=174705

Reviewed by Mark Lam.

Source/WTF:

After starting using ThreadGroup to bookkeep active threads for Signals,
we would like to know tristate of ThreadGroup::add result, NewlyAdded, AlreadyAdded, NotAdded.
This patch extends the result of ThreadGroup::add from bool to ThreadGroupAddResult tristate.
Note that NotAdded is returned if the target thread is dying.

  • wtf/ThreadGroup.cpp:

(WTF::ThreadGroup::add):
(WTF::ThreadGroup::addCurrentThread):

  • wtf/ThreadGroup.h:
  • wtf/Threading.cpp:

(WTF::Thread::addToThreadGroup):

  • wtf/Threading.h:
  • wtf/threads/Signals.cpp:

(WTF::registerThreadForMachExceptionHandling):

Tools:

  • TestWebKitAPI/Tests/WTF/ThreadGroup.cpp:

(TestWebKitAPI::testThreadGroup):
(TestWebKitAPI::TEST):

Jul 21, 2017:

10:14 PM Changeset in webkit [219759] by commit-queue@webkit.org
  • 3 edits in trunk/Source/WTF

Unreviewed, rolling out r219732.
https://bugs.webkit.org/show_bug.cgi?id=174748

static is not threadsafe in WebKit tree (Requested by
yusukesuzuki on #webkit).

Reverted changeset:

"[WTF] Drop initializeDate"
https://bugs.webkit.org/show_bug.cgi?id=174714
http://trac.webkit.org/changeset/219732

9:43 PM Changeset in webkit [219758] by Chris Dumez
  • 46 edits
    3 deletes in trunk

Drop IDBDatabaseException class
https://bugs.webkit.org/show_bug.cgi?id=174743

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline test as the exception message is slightly different.

  • web-platform-tests/IndexedDB/keypath-special-identifiers-expected.txt:

Source/WebCore:

Drop IDBDatabaseException class and use DOMException directly. IDBDatabaseException was
only an internal concept and was already exposed to the Web as a DOMException. This
simplifies the code a bit and will allow for further simplification in a follow-up patch.

No new tests, no Web-facing behavior change, except for some exception messages
being slightly different.

  • CMakeLists.txt:
  • Modules/indexeddb/IDBCursor.cpp:

(WebCore::IDBCursor::update):
(WebCore::IDBCursor::advance):
(WebCore::IDBCursor::continuePrimaryKey):
(WebCore::IDBCursor::continueFunction):
(WebCore::IDBCursor::deleteFunction):

  • Modules/indexeddb/IDBDatabase.cpp:

(WebCore::IDBDatabase::createObjectStore):
(WebCore::IDBDatabase::transaction):
(WebCore::IDBDatabase::deleteObjectStore):

  • Modules/indexeddb/IDBDatabaseError.h: Removed.
  • Modules/indexeddb/IDBDatabaseException.cpp: Removed.
  • Modules/indexeddb/IDBDatabaseException.h: Removed.
  • Modules/indexeddb/IDBFactory.cpp:

(WebCore::IDBFactory::cmp):

  • Modules/indexeddb/IDBIndex.cpp:

(WebCore::IDBIndex::setName):
(WebCore::IDBIndex::openCursor):
(WebCore::IDBIndex::openKeyCursor):
(WebCore::IDBIndex::count):
(WebCore::IDBIndex::doCount):
(WebCore::IDBIndex::get):
(WebCore::IDBIndex::doGet):
(WebCore::IDBIndex::getKey):
(WebCore::IDBIndex::doGetKey):
(WebCore::IDBIndex::getAll):
(WebCore::IDBIndex::getAllKeys):

  • Modules/indexeddb/IDBKeyRange.cpp:

(WebCore::IDBKeyRange::only):
(WebCore::IDBKeyRange::lowerBound):
(WebCore::IDBKeyRange::upperBound):
(WebCore::IDBKeyRange::bound):
(WebCore::IDBKeyRange::includes):

  • Modules/indexeddb/IDBObjectStore.cpp:

(WebCore::IDBObjectStore::setName):
(WebCore::IDBObjectStore::openCursor):
(WebCore::IDBObjectStore::openKeyCursor):
(WebCore::IDBObjectStore::get):
(WebCore::IDBObjectStore::getKey):
(WebCore::IDBObjectStore::putOrAdd):
(WebCore::IDBObjectStore::doDelete):
(WebCore::IDBObjectStore::deleteFunction):
(WebCore::IDBObjectStore::clear):
(WebCore::IDBObjectStore::createIndex):
(WebCore::IDBObjectStore::index):
(WebCore::IDBObjectStore::deleteIndex):
(WebCore::IDBObjectStore::count):
(WebCore::IDBObjectStore::doCount):
(WebCore::IDBObjectStore::getAll):
(WebCore::IDBObjectStore::getAllKeys):

  • Modules/indexeddb/IDBOpenDBRequest.cpp:

(WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):

  • Modules/indexeddb/IDBRequest.cpp:

(WebCore::IDBRequest::result):
(WebCore::IDBRequest::error):
(WebCore::IDBRequest::uncaughtExceptionInEventHandler):

  • Modules/indexeddb/IDBTransaction.cpp:

(WebCore::IDBTransaction::objectStore):
(WebCore::IDBTransaction::abort):
(WebCore::IDBTransaction::abortOnServerAndCancelRequests):
(WebCore::IDBTransaction::didCreateIndexOnServer):
(WebCore::IDBTransaction::putOrAddOnServer):

  • Modules/indexeddb/server/IndexValueStore.cpp:

(WebCore::IDBServer::IndexValueStore::addRecord):

  • Modules/indexeddb/server/MemoryIDBBackingStore.cpp:

(WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
(WebCore::IDBServer::MemoryIDBBackingStore::renameIndex):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteRange):
(WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
(WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getCount):
(WebCore::IDBServer::MemoryIDBBackingStore::generateKeyNumber):
(WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
(WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):

  • Modules/indexeddb/server/MemoryIndex.cpp:

(WebCore::IDBServer::MemoryIndex::putIndexKey):

  • Modules/indexeddb/server/MemoryObjectStore.cpp:

(WebCore::IDBServer::MemoryObjectStore::createIndex):
(WebCore::IDBServer::MemoryObjectStore::deleteIndex):

  • Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:

(WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
(WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
(WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
(WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
(WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
(WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
(WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
(WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
(WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
(WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):

  • Modules/indexeddb/server/SQLiteIDBTransaction.cpp:

(WebCore::IDBServer::SQLiteIDBTransaction::begin):
(WebCore::IDBServer::SQLiteIDBTransaction::commit):
(WebCore::IDBServer::SQLiteIDBTransaction::abort):

  • Modules/indexeddb/server/UniqueIDBDatabase.cpp:

(WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
(WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
(WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
(WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):

  • Modules/indexeddb/shared/IDBError.cpp:

(WebCore::IDBError::name):
(WebCore::IDBError::message):
(WebCore::IDBError::toDOMError):

  • Modules/indexeddb/shared/IDBError.h:

(WebCore::IDBError::userDeleteError):
(WebCore::IDBError::isNull):

  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSDOMExceptionHandling.cpp:

(WebCore::createDOMException):

  • dom/DOMException.cpp:

(WebCore::DOMException::initializeDescription):
Initialize description->code from using the actual error codes in the
coreExceptions table, instead of initializing it using |ec|. |ec| is
the index in the ExceptionCode enumeration and it matches the error
code only for legacy exceptions. New exceptions such as DataError
should have a code of 0. Without this change, w3c for IDB would start
failing.

  • dom/ExceptionCodeDescription.cpp:

(WebCore::ExceptionCodeDescription::ExceptionCodeDescription):

  • dom/ExceptionCodeDescription.h:

Source/WebKit:

  • WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:

(WebKit::WebIDBConnectionToServer::connectionToServerLost):

LayoutTests:

Rebaseline test as the exception messages are slightly different.

  • storage/indexeddb/createIndex-after-failure-expected.txt:
  • storage/indexeddb/createIndex-after-failure-private-expected.txt:
  • storage/indexeddb/get-keyrange-expected.txt:
  • storage/indexeddb/get-keyrange-private-expected.txt:
  • storage/indexeddb/keypath-edges-expected.txt:
  • storage/indexeddb/keypath-edges-private-expected.txt:
  • storage/indexeddb/keyrange-expected.txt:
  • storage/indexeddb/keyrange-private-expected.txt:
  • storage/indexeddb/modern/idbdatabase-deleteobjectstore-failures-expected.txt:
  • storage/indexeddb/modern/idbdatabase-deleteobjectstore-failures-private-expected.txt:
  • storage/indexeddb/transaction-active-flag-expected.txt:
  • storage/indexeddb/transaction-active-flag-private-expected.txt:
8:54 PM Changeset in webkit [219757] by commit-queue@webkit.org
  • 5 edits
    1 delete in trunk/Source/WebCore

[WebIDL] Simplify XMLHttpRequest bindings by removing built-ins
https://bugs.webkit.org/show_bug.cgi?id=174740

Patch by Sam Weinig <sam@webkit.org> on 2017-07-21
Reviewed by Chris Dumez.

The behavior we were getting from XMLHttpRequest.js can be implemented
with the [CachedAttribute] extended attribute. This reduces the number
of JS -> C++ jumps required and makes the code more similar to other
bindings that need caching of an IDL any value.

  • CMakeLists.txt:
  • DerivedSources.make:
  • xml/XMLHttpRequest.js: Removed.

Remove XMLHttpRequest.js.

  • bindings/js/JSXMLHttpRequestCustom.cpp:

(WebCore::JSXMLHttpRequest::response):
(WebCore::JSXMLHttpRequest::retrieveResponse): Deleted.

  • xml/XMLHttpRequest.idl:

Replace builtin with a [CachedAttribute] and [CustomGetter]
for the response property.

8:01 PM Changeset in webkit [219756] by timothy_horton@apple.com
  • 8 edits in trunk/Source/WebCore

Drag and Drop preview image for Twitter link is the wrong shape
https://bugs.webkit.org/show_bug.cgi?id=174731
<rdar://problem/33335616>

Reviewed by Zalan Bujtas.

TextIndicator uses Range::borderAndTextQuads and ::absoluteTextRects
in order to get the rects of the indicated text. Currently, these
functions do not respect clipping, so clipped-out text (e.g. as seen
inside links on Twitter) generates lots of meaningless indicated rects.

  • page/TextIndicator.cpp:

(WebCore::estimatedBackgroundColorForRange):
(WebCore::hasAnyIllegibleColors):
Change adjustTextIndicatorDataOptionsForEstimatedColorsIfNecessary
to instead be hasAnyIllegibleColors, and referred to in the same place
as hasNonInlineOrReplacedElements, so that it follows the same
upgrade path (leaving textRects empty, so that it is later filled in
with the absoluteBoundingRect). This was a mistake in r219033, which
instead would end up painting all content, but filling in textRects
with the actual individual text rects.

This alone changes the behavior on Twitter from lots of jagged misplaced
rects to a too-large bounding rect. Combined with the following changes,
the bounding rect is reduced to the right size:

(WebCore::initializeIndicator):
Adopt the new Range::borderAndTextQuads and ::absoluteTextRects parameter
and opt-in to respecting clipping for text rects.

  • dom/DOMRectList.cpp:

(WebCore::DOMRectList::DOMRectList):

  • dom/DOMRectList.h:

(WebCore::DOMRectList::create):
Add a DOMRectList constructor and create() that take FloatRects, similar
to the one that takes FloatQuads, but without the boundingRect() calls.

  • dom/Document.h:
  • dom/Document.cpp:

(WebCore::Document::convertAbsoluteToClientRects):
Add convertAbsoluteToClientRects, similar to covertAbsoluteToClientQuads,
except acting on rects instead of quads.

  • dom/Range.cpp:

(WebCore::Range::absoluteRectsForRangeInText):
(WebCore::Range::absoluteTextRects):
(WebCore::Range::getClientRects):
(WebCore::Range::borderAndTextRects):
(WebCore::Range::boundingRect):
(WebCore::Range::absoluteBoundingRect):
(WebCore::Range::borderAndTextQuads): Deleted.

  • dom/Range.h:

Replace borderAndTextQuads with borderAndTextRects, because all callers
just ended up calling boundingBox() on the quads.

Factor absoluteRectsForRangeInText out of absoluteTextRects and
borderAndTextQuads, and teach it to optionally intersect the text rects
with their renderer's absoluteClippedOverflowRect.

5:41 PM Changeset in webkit [219755] by pvollan@apple.com
  • 5 edits
    2 adds in trunk

Round-tripping stroke-width styles through getComputedStyle cause the text to gain a stroke.
https://bugs.webkit.org/show_bug.cgi?id=174701
Source/WebCore:

<rdar://problem/32903679>

Reviewed by Simon Fraser.

The initial value of stroke-color should be transparent, see https://www.w3.org/TR/fill-stroke-3/#stroke-color.
Also, there is no need to set the graphics context in text stroke mode, if the stroke color is not visible.

Test: fast/css/round-trip-stroke-width-using-computed-style.html

  • rendering/TextPaintStyle.cpp:

(WebCore::updateGraphicsContext):

  • rendering/style/RenderStyle.h:

(WebCore::RenderStyle::initialStrokeWidth):
(WebCore::RenderStyle::initialStrokeColor):

  • rendering/style/StyleRareInheritedData.cpp:

(WebCore::StyleRareInheritedData::StyleRareInheritedData):

LayoutTests:

Reviewed by Simon Fraser.

  • fast/css/round-trip-stroke-width-using-computed-style-expected.html: Added.
  • fast/css/round-trip-stroke-width-using-computed-style.html: Added.
5:15 PM Changeset in webkit [219754] by beidson@apple.com
  • 2 edits in trunk/Source/WebKit

Crash in many WebKit apps marking a connection invalid under Messages::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace.
<rdar://problem/28822272> and https://bugs.webkit.org/show_bug.cgi?id=174729

Reviewed by Tim Horton.

Previously, when a NetworkLoad generated a "CanAuthenticateAgainstProtectionSpace" event, the message went from
Network process -> Web process -> UI process.

In that case, MESSAGE_CHECKing the validity of the frame in WebPageProxy made sense.

In r202511 we cut the WebProcess out of this and had Networking go straight to UI process.

As a result, the message check became invalid. The Networking process cannot possible know the validity of
particular WebPage or WebFrame identifiers.

We simply need to validate the input in NetworkProcessProxy.

  • UIProcess/Network/NetworkProcessProxy.cpp:

(WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace): Validate both the page and frame ids before

passing the call along to the WebPageProxy. Also, if either of those validations fail, respond to the network process.

5:13 PM Changeset in webkit [219753] by timothy_horton@apple.com
  • 2 edits in trunk/Source/WebCore

Remove an inaccurate comment from RenderTextLineBoxes

  • rendering/RenderTextLineBoxes.cpp:

(WebCore::RenderTextLineBoxes::absoluteRectsForRange):
This comment has been wrong for at least 4 years.

4:34 PM Changeset in webkit [219752] by timothy_horton@apple.com
  • 2 edits in trunk/Source/WebCore

TextIndicator::estimatedTextColorsForRange asserts inside HashSet code (inserting reserved value)
https://bugs.webkit.org/show_bug.cgi?id=174733

Reviewed by Wenson Hsieh.

  • page/TextIndicator.cpp:

(WebCore::estimatedTextColorsForRange):
(WebCore::adjustTextIndicatorDataOptionsForEstimatedColorsIfNecessary):
RGBA32 isn't a valid hash key, because we have no traits that define the
empty or deleted values, nor do we have any bits we could feasibly
use -- the full range of RGBA32 is easy to reach with various colors.

Instead, hash Color directly.

4:25 PM Changeset in webkit [219751] by n_wang@apple.com
  • 7 edits
    2 adds in trunk

AX: Expose form validation on iOS as hint
https://bugs.webkit.org/show_bug.cgi?id=174722
<rdar://problem/33459761>

Reviewed by Chris Fleizach.

Source/WebCore:

Adding the validation message to the hint of the form control element.

Test: accessibility/ios-simulator/form-control-validation-message.html

  • accessibility/AccessibilityObject.cpp:

(WebCore::AccessibilityObject::isShowingValidationMessage):
(WebCore::AccessibilityObject::validationMessage):

  • accessibility/AccessibilityObject.h:
  • accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:

(-[WebAccessibilityObjectWrapper accessibilityHint]):
(-[WebAccessibilityObjectWrapper accessibilityIsShowingValidationMessage]):

  • html/HTMLFormControlElement.cpp:

(WebCore::HTMLFormControlElement::isShowingValidationMessage):

  • html/HTMLFormControlElement.h:

LayoutTests:

  • accessibility/ios-simulator/form-control-validation-message-expected.txt: Added.
  • accessibility/ios-simulator/form-control-validation-message.html: Added.
3:44 PM Changeset in webkit [219750] by aestes@apple.com
  • 3 edits
    1 delete in trunk/Source/WebKit

[iOS] Adopt UIImagePickerControllerImageURL for photo uploads
https://bugs.webkit.org/show_bug.cgi?id=174723
<rdar://problem/33223962>

Reviewed by Joseph Pecoraro.

In iOS 11, use the URL provided by UIImagePickerControllerImageURL, if available, as the
file URL for photo uploads. Since we use the UIImagePickerController imageExportPreset of
UIImagePickerControllerImageURLExportPresetCompatible, UIKit will take care of converting
HEIF images to JPEG for us. For other types (GIF, JPEG, and PNG), it will preserve the
original format.

Since UIImagePickerController now provides GIF and PNG representations, we no longer need to
use PHImageManager to access the original assets. This patch removes the
PHAsset/PHImageManager code added in r185241.

  • Platform/spi/ios/PhotosSPI.h: Removed.
  • UIProcess/ios/forms/WKFileUploadPanel.mm:

(-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
(-[WKFileUploadPanel _uploadItemForImage:withAssetURL:successBlock:failureBlock:]): Deleted.

  • WebKit.xcodeproj/project.pbxproj:
3:41 PM Changeset in webkit [219749] by commit-queue@webkit.org
  • 3 edits
    2 adds in trunk

Web Inspector: inspect(aFunction) should jump to function definition
https://bugs.webkit.org/show_bug.cgi?id=149344
<rdar://problem/11563607>

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2017-07-21
Reviewed by Matt Baker.

Source/WebInspectorUI:

  • UserInterface/Protocol/InspectorObserver.js:

(WebInspector.InspectorObserver.prototype.inspect):
If we receive a function remote object jump to its location if available.

LayoutTests:

  • inspector/runtime/CommandLineAPI-inspect-expected.txt: Added.
  • inspector/runtime/CommandLineAPI-inspect.html: Added.

Add tests for the CommandLineAPI's inspect() and how it triggers the
Inspector.inspect event with a RemoteObject and hints.

3:22 PM Changeset in webkit [219748] by Matt Lewis
  • 2 edits in trunk/LayoutTests

Adjusted test expectations.
https://bugs.webkit.org/show_bug.cgi?id=173861

Unreviewed test gardening.

  • platform/mac-wk2/TestExpectations:
3:20 PM Changeset in webkit [219747] by Jonathan Bedard
  • 2 edits in trunk/Tools

Fail gracefully when xcrun fails in IOSSimulatorPort constructor
https://bugs.webkit.org/show_bug.cgi?id=174724

Reviewed by Aakash Jain.

  • Scripts/webkitpy/port/ios_simulator.py:

(IOSSimulatorPort.init): Ignore any errors when attempting to find a running
simulator. Errors here should be treated the same as no simulators found.

3:04 PM Changeset in webkit [219746] by Konstantin Tokarev
  • 2 edits in trunk/Source/WebKitLegacy

Unreviewed, fix Mac cmake build after r219733

  • PlatformMac.cmake:
2:26 PM Changeset in webkit [219745] by Konstantin Tokarev
  • 6 edits in trunk/Source

[cmake][Mac] Unreviewed, fix linking WebKitSystemInterface

After r219560 link_directories() in PlatformXXX.cmake files does not
affect corresponding targets.

  • PlatformMac.cmake:
2:20 PM Changeset in webkit [219744] by commit-queue@webkit.org
  • 27 edits in trunk/Source/WebCore

[WebIDL] Remove the need for the side map of DeprecatedCSSOMValue roots
https://bugs.webkit.org/show_bug.cgi?id=174713

Patch by Sam Weinig <sam@webkit.org> on 2017-07-21
Reviewed by Andreas Kling.

We used to not want to bloat the size of CSSValues with a pointer to the
owner CSSStyleDeclaration, so, for GC purposes we need kept a mapping of
them on DOMWrapperWorld that only got set if a wrapper was made. Now that
we have DeprecatedCSSOMValue, a wrapper for CSSValue that only gets created
for the bindings, we no longer need the side table, and simply have the
DeprecatedCSSOMValue maintain a reference to the CSSStyleDeclaration.

  • bindings/js/DOMWrapperWorld.h:

(WebCore::DOMWrapperWorld::wrappers):
Remove m_deprecatedCSSOMValueRoots and make m_wrappers private with a getter.

  • bindings/js/JSCSSStyleDeclarationCustom.cpp:

(WebCore::JSCSSStyleDeclaration::getPropertyCSSValue): Deleted.
Remove custom implementation of getPropertyCSSValue, now that it no longer
needs to update m_deprecatedCSSOMValueRoots.

  • bindings/js/JSDOMWindowBase.cpp:

(WebCore::JSDOMWindowBase::fireFrameClearedWatchpointsForWindow):

  • bindings/js/JSDOMWrapperCache.h:

(WebCore::getCachedWrapper):
(WebCore::cacheWrapper):
(WebCore::uncacheWrapper):

  • bindings/js/JSNodeCustom.cpp:

(WebCore::getOutOfLineCachedWrapper):
Use wrappers getter rather than direct member variable.

  • bindings/js/JSDeprecatedCSSOMValueCustom.cpp:

(WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots):
Rather than checking the side table for roots, now get the root
via the reference CSSStyleDeclaration.

(WebCore::JSDeprecatedCSSOMValueOwner::finalize): Deleted.
Remove custom finalize now that we don't have to remove ourself
from m_deprecatedCSSOMValueRoots.

  • css/CSSStyleDeclaration.idl:

Remove [Custom] from getPropertyCSSValue.

  • css/DeprecatedCSSOMValue.idl:

Remove [JSCustomFinalize].

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):

  • css/CSSImageValue.cpp:

(WebCore::CSSImageValue::createDeprecatedCSSOMWrapper):

  • css/CSSImageValue.h:
  • css/CSSPrimitiveValue.cpp:

(WebCore::CSSPrimitiveValue::createDeprecatedCSSOMPrimitiveWrapper):

  • css/CSSPrimitiveValue.h:
  • css/CSSStyleDeclaration.h:
  • css/CSSValue.cpp:

(WebCore::CSSValue::createDeprecatedCSSOMWrapper):

  • css/CSSValue.h:
  • css/DeprecatedCSSOMCounter.h:
  • css/DeprecatedCSSOMPrimitiveValue.cpp:

(WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::getRectValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::getRGBColorValue):

  • css/DeprecatedCSSOMPrimitiveValue.h:

(WebCore::DeprecatedCSSOMPrimitiveValue::create):
(WebCore::DeprecatedCSSOMPrimitiveValue::DeprecatedCSSOMPrimitiveValue):

  • css/DeprecatedCSSOMRGBColor.h:
  • css/DeprecatedCSSOMRect.h:
  • css/DeprecatedCSSOMValue.h:

(WebCore::DeprecatedCSSOMValue::owner):
(WebCore::DeprecatedCSSOMValue::DeprecatedCSSOMValue):
(WebCore::DeprecatedCSSOMComplexValue::create):
(WebCore::DeprecatedCSSOMComplexValue::DeprecatedCSSOMComplexValue):

  • css/DeprecatedCSSOMValueList.h:

(WebCore::DeprecatedCSSOMValueList::create):
(WebCore::DeprecatedCSSOMValueList::DeprecatedCSSOMValueList):

  • css/PropertySetCSSStyleDeclaration.cpp:

(WebCore::PropertySetCSSStyleDeclaration::wrapForDeprecatedCSSOM):

  • css/PropertySetCSSStyleDeclaration.h:
  • svg/SVGElement.cpp:

(WebCore::SVGElement::getPresentationAttribute):
Pass owning CSSStyleDeclaration to DeprecatedCSSOMValue and derived classes.

2:16 PM Changeset in webkit [219743] by akling@apple.com
  • 43 edits in trunk/Source

Use more references in event dispatch code
https://bugs.webkit.org/show_bug.cgi?id=174681

Reviewed by Geoffrey Garen.

Source/WebCore:

Make EventListener::handleEvent() take a ScriptExecutionContext&, Event&.
Then make everything build again. Various null checks and assertions
disappear in the process.

  • bindings/js/JSErrorHandler.cpp:

(WebCore::JSErrorHandler::handleEvent):

  • bindings/js/JSErrorHandler.h:
  • bindings/js/JSEventListener.cpp:

(WebCore::JSEventListener::initializeJSFunction):
(WebCore::JSEventListener::handleEvent):
(WebCore::eventHandlerAttribute):

  • bindings/js/JSEventListener.h:

(WebCore::JSEventListener::jsFunction):

  • bindings/js/JSLazyEventListener.cpp:

(WebCore::JSLazyEventListener::initializeJSFunction):

  • bindings/js/JSLazyEventListener.h:
  • dom/EventListener.h:
  • dom/EventTarget.cpp:

(WebCore::EventTarget::fireEventListeners):

  • html/HTMLPlugInElement.cpp:

(WebCore::HTMLPlugInElement::defaultEventHandler):

  • html/ImageDocument.cpp:

(WebCore::ImageEventListener::handleEvent):

  • inspector/CommandLineAPIHost.cpp:

(WebCore::listenerEntriesFromListenerInfo):

  • inspector/InspectorDOMAgent.cpp:

(WebCore::InspectorDOMAgent::buildObjectForEventListener):

  • inspector/InspectorIndexedDBAgent.cpp:
  • platform/Widget.h:

(WebCore::Widget::handleEvent):

  • platform/cocoa/WebPlaybackSessionModelMediaElement.h:
  • platform/cocoa/WebPlaybackSessionModelMediaElement.mm:

(WebCore::WebPlaybackSessionModelMediaElement::handleEvent):

  • platform/cocoa/WebVideoFullscreenModelVideoElement.h:
  • platform/cocoa/WebVideoFullscreenModelVideoElement.mm:

(WebVideoFullscreenModelVideoElement::handleEvent):

  • svg/SVGTRefElement.cpp:

(WebCore::SVGTRefTargetEventListener::handleEvent):

  • svg/animation/SVGSMILElement.cpp:

(WebCore::ConditionEventListener::handleEvent):
(WebCore::SVGSMILElement::handleConditionEvent):

  • svg/animation/SVGSMILElement.h:

Source/WebKit:

  • WebProcess/Plugins/PDF/PDFPluginAnnotation.h:
  • WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:

(WebKit::PDFPluginAnnotation::handleEvent):
(WebKit::PDFPluginAnnotation::PDFPluginAnnotationEventListener::handleEvent):

  • WebProcess/Plugins/PDF/PDFPluginPasswordField.h:
  • WebProcess/Plugins/PDF/PDFPluginPasswordField.mm:

(WebKit::PDFPluginPasswordField::handleEvent):

  • WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h:
  • WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:

(WebKit::PDFPluginTextAnnotation::handleEvent):

  • WebProcess/Plugins/PluginView.cpp:

(WebKit::PluginView::createWebEvent):
(WebKit::PluginView::handleEvent):

  • WebProcess/Plugins/PluginView.h:

Source/WebKitLegacy/mac:

  • DOM/ObjCEventListener.h:
  • DOM/ObjCEventListener.mm:

(WebCore::ObjCEventListener::handleEvent):

  • WebCoreSupport/WebFrameLoaderClient.mm:

(NetscapePluginWidget::handleEvent):

Source/WebKitLegacy/win:

  • DOMEventsClasses.cpp:

(WebEventListener::handleEvent):

  • DOMEventsClasses.h:
  • Plugins/PluginView.cpp:

(WebCore::PluginView::handleEvent):

  • Plugins/PluginView.h:
2:04 PM Changeset in webkit [219742] by Alan Bujtas
  • 2 edits in trunk/Source/WebCore

iBooks: Overlapping/missing content at beginning/end of paragraph.
https://bugs.webkit.org/show_bug.cgi?id=174717
<rdar://problem/33117912>

Reviewed by Simon Fraser.

By definiton simple and normal line layout should always produce the exact same lineboxes. It enables us not
to force repaint while swapping between these 2 line layouts.
However in certain cases (font size pixel rounding as an example) they don't agree on how much content fits the line and
that could result in missing/overlapping content due to the lack of repaint.

Unable to test.

  • rendering/RenderBlockFlow.cpp:

(WebCore::RenderBlockFlow::ensureLineBoxes):

1:53 PM Changeset in webkit [219741] by Chris Dumez
  • 9 edits
    2 adds
    2 deletes in trunk/Source/WebCore

Drop make_dom_exceptions.pl script that we only have DOMException
https://bugs.webkit.org/show_bug.cgi?id=174699

Reviewed by Darin Adler.

Drop make_dom_exceptions.pl script that we only have DOMException.

  • CMakeLists.txt:
  • DerivedSources.make:
  • WebCore.xcodeproj/project.pbxproj:
  • WebCoreMacros.cmake:
  • bindings/js/JSDOMExceptionHandling.cpp:
  • css/FontFaceSet.cpp:
  • dom/DOMAllInOne.cpp:
  • dom/DOMExceptions.in: Removed.
  • dom/ExceptionCodeDescription.cpp: Added.

(WebCore::ExceptionCodeDescription::ExceptionCodeDescription):

  • dom/ExceptionCodeDescription.h: Added.
  • dom/make_dom_exceptions.pl: Removed.
  • inspector/WebInjectedScriptHost.cpp:

(WebCore::WebInjectedScriptHost::subtype):

1:44 PM Changeset in webkit [219740] by mark.lam@apple.com
  • 16 edits in trunk/Source/JavaScriptCore

Refactor MASM probe CPUState to use arrays for register storage.
https://bugs.webkit.org/show_bug.cgi?id=174694

Reviewed by Keith Miller.

Using arrays for register storage in CPUState allows us to do away with the
huge switch statements to decode each register id. We can now simply index into
the arrays.

With this patch, we now:

  1. Remove the need for macros for defining the list of CPU registers. We can go back to simple enums. This makes the code easier to read.
  1. Make the assembler the authority on register names. Most of this code is moved into the assembler from GPRInfo and FPRInfo. GPRInfo and FPRInfo now forwards to the assembler.
  1. Make the assembler the authority on the number of registers of each type.
  1. Fix a "bug" in ARMv7's lastRegister(). It was previously omitting lr and pc. This is inconsistent with how every other CPU architecture implements lastRegister(). This patch fixes it to return the true last GPR i.e. pc, but updates RegisterSet::reservedHardwareRegisters() to exclude those registers.
  • assembler/ARM64Assembler.h:

(JSC::ARM64Assembler::numberOfRegisters):
(JSC::ARM64Assembler::firstSPRegister):
(JSC::ARM64Assembler::lastSPRegister):
(JSC::ARM64Assembler::numberOfSPRegisters):
(JSC::ARM64Assembler::numberOfFPRegisters):
(JSC::ARM64Assembler::gprName):
(JSC::ARM64Assembler::sprName):
(JSC::ARM64Assembler::fprName):

  • assembler/ARMAssembler.h:

(JSC::ARMAssembler::numberOfRegisters):
(JSC::ARMAssembler::firstSPRegister):
(JSC::ARMAssembler::lastSPRegister):
(JSC::ARMAssembler::numberOfSPRegisters):
(JSC::ARMAssembler::numberOfFPRegisters):
(JSC::ARMAssembler::gprName):
(JSC::ARMAssembler::sprName):
(JSC::ARMAssembler::fprName):

  • assembler/ARMv7Assembler.h:

(JSC::ARMv7Assembler::lastRegister):
(JSC::ARMv7Assembler::numberOfRegisters):
(JSC::ARMv7Assembler::firstSPRegister):
(JSC::ARMv7Assembler::lastSPRegister):
(JSC::ARMv7Assembler::numberOfSPRegisters):
(JSC::ARMv7Assembler::numberOfFPRegisters):
(JSC::ARMv7Assembler::gprName):
(JSC::ARMv7Assembler::sprName):
(JSC::ARMv7Assembler::fprName):

  • assembler/AbstractMacroAssembler.h:

(JSC::AbstractMacroAssembler::numberOfRegisters):
(JSC::AbstractMacroAssembler::gprName):
(JSC::AbstractMacroAssembler::firstSPRegister):
(JSC::AbstractMacroAssembler::lastSPRegister):
(JSC::AbstractMacroAssembler::numberOfSPRegisters):
(JSC::AbstractMacroAssembler::sprName):
(JSC::AbstractMacroAssembler::numberOfFPRegisters):
(JSC::AbstractMacroAssembler::fprName):

  • assembler/MIPSAssembler.h:

(JSC::MIPSAssembler::numberOfRegisters):
(JSC::MIPSAssembler::firstSPRegister):
(JSC::MIPSAssembler::lastSPRegister):
(JSC::MIPSAssembler::numberOfSPRegisters):
(JSC::MIPSAssembler::numberOfFPRegisters):
(JSC::MIPSAssembler::gprName):
(JSC::MIPSAssembler::sprName):
(JSC::MIPSAssembler::fprName):

  • assembler/MacroAssembler.h:

(JSC::MacroAssembler::CPUState::gprName):
(JSC::MacroAssembler::CPUState::sprName):
(JSC::MacroAssembler::CPUState::fprName):
(JSC::MacroAssembler::CPUState::gpr):
(JSC::MacroAssembler::CPUState::spr):
(JSC::MacroAssembler::CPUState::fpr):
(JSC::MacroAssembler::CPUState::pc):
(JSC::MacroAssembler::CPUState::fp):
(JSC::MacroAssembler::CPUState::sp):
(JSC::ProbeContext::gpr):
(JSC::ProbeContext::spr):
(JSC::ProbeContext::fpr):
(JSC::ProbeContext::gprName):
(JSC::ProbeContext::sprName):
(JSC::ProbeContext::fprName):
(JSC::MacroAssembler::numberOfRegisters): Deleted.
(JSC::MacroAssembler::numberOfFPRegisters): Deleted.

  • assembler/MacroAssemblerARM.cpp:
  • assembler/MacroAssemblerARM64.cpp:

(JSC::arm64ProbeTrampoline):

  • assembler/MacroAssemblerARMv7.cpp:
  • assembler/MacroAssemblerPrinter.cpp:

(JSC::Printer::nextID):
(JSC::Printer::printAllRegisters):
(JSC::Printer::printPCRegister):
(JSC::Printer::printRegisterID):
(JSC::Printer::printAddress):

  • assembler/MacroAssemblerX86Common.cpp:
  • assembler/X86Assembler.h:

(JSC::X86Assembler::numberOfRegisters):
(JSC::X86Assembler::firstSPRegister):
(JSC::X86Assembler::lastSPRegister):
(JSC::X86Assembler::numberOfSPRegisters):
(JSC::X86Assembler::numberOfFPRegisters):
(JSC::X86Assembler::gprName):
(JSC::X86Assembler::sprName):
(JSC::X86Assembler::fprName):

  • jit/FPRInfo.h:

(JSC::FPRInfo::debugName):

  • jit/GPRInfo.h:

(JSC::GPRInfo::debugName):

  • jit/RegisterSet.cpp:

(JSC::RegisterSet::reservedHardwareRegisters):

1:40 PM Changeset in webkit [219739] by Chris Dumez
  • 2 edits in trunk/Source/WebKit

WebResourceLoadStatisticsStore::m_operatingDates is unsafely modified from several threads
https://bugs.webkit.org/show_bug.cgi?id=174721
<rdar://problem/33400343>

Reviewed by Brent Fulgham.

WebResourceLoadStatisticsStore::m_operatingDates is supposed to only be modified on
the background thread. However, WebResourceLoadStatisticsStore::performDailyTasks()
was mistakenly calling includeTodayAsOperatingDateIfNecessary() on the main thread,
which would modify m_operatingDates. This could lead to crashes such as the
one in <rdar://problem/33400343>, as the main thread may modify m_operatingDates
while we are interating over it on the background thread to save it to disk.

  • UIProcess/WebResourceLoadStatisticsStore.cpp:

(WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
(WebKit::WebResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):

1:38 PM Changeset in webkit [219738] by commit-queue@webkit.org
  • 4 edits in trunk/Source/WebCore

[CG] An image should not invoke many system calls before confirming its format is supported
https://bugs.webkit.org/show_bug.cgi?id=174692

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-07-21
Reviewed by Tim Horton.

We should be careful when invoking system calls before confirming that the
image type is available and it is one of the whitelist formats. Otherwise
we will be calling the parsers of the unsupported formats.

  • loader/cache/CachedImage.cpp:

(WebCore::CachedImage::setImageDataBuffer): The check isAllowedImageUTI()
is now done in ImageDecoder::encodedDataStatus() which will return Error
if there is an error in the data or "isAllowedImageUTI() returns false."

  • platform/graphics/BitmapImage.cpp:

(WebCore::BitmapImage::dataChanged): Avoid calling canUseAsyncDecodingForLargeImages()
before confirming the image type is available and it's supported by WebKit.
canUseAsyncDecodingForLargeImages() tries to cache the first frame of the
image to know its size. Asking the ImageFrameCache to destroy its decoded
frames is not needed unless ImageFrameCache::decodedSize() is not zero.

  • platform/graphics/cg/ImageDecoderCG.cpp:

(WebCore::ImageDecoder::encodedDataStatus): Avoid calling CGImageSourceGetStatus()
before knowing the UTI of the image. When knowing it, we call CGImageSourceGetStatus()
and if it returns kCGImageStatusIncomplete or kCGImageStatusComplete, we
check whether isAllowedImageUTI() or not. If isAllowedImageUTI() returns
false, return Error which will make the CachedImage cancel loading the
rest of the image.

12:55 PM Changeset in webkit [219737] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WebCore

AudioTrackPrivateMediaStreamCocoa shouldn't set AudioSession::setPreferredBufferSize
https://bugs.webkit.org/show_bug.cgi?id=174707
rdar://problem/33446809

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-07-21
Reviewed by Eric Carlson.

Manually tested for audio side effects.

AudioChannel::copyFrom fails when AudioChannel lengths don't match.

This happens because PlatformMediaSessionManager::updateSessionState() owns and sets
AudioSession::setPreferredBufferSize().

However, AudioTrackPrivateMediaStreamCocoa::createAudioUnit, when it creates an input
audio unit is setting AudioSession::setPreferredBufferSize() directly to its own arbitrary value.

AudioSession::setPreferredBufferSize() should be managed by the higher level
PlatformMediaSessionManager, and not modified by audio unit creation, in order to keep harmony
within the audio pipeline.

  • platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:

(WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):

12:48 PM Changeset in webkit [219736] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WebCore

Noise when AudioChannel lengths don't match.
https://bugs.webkit.org/show_bug.cgi?id=174706
rdar://problem/33389856

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-07-21
Reviewed by Eric Carlson.

When AudioChannel lengths don't match, copyFrom() returns early leaving uninitialized data in the audio buffer.
This change zeros out the data, so there isn't objectionable noise sent to the speaker.

  • platform/audio/AudioChannel.cpp:

(WebCore::AudioChannel::copyFrom):

12:39 PM Changeset in webkit [219735] by commit-queue@webkit.org
  • 11 edits in trunk/Source/WebCore

[WebIDL] Make a few parameters non-nullable in inspector IDL files
https://bugs.webkit.org/show_bug.cgi?id=174719

Patch by Sam Weinig <sam@webkit.org> on 2017-07-21
Reviewed by Joseph Pecoraro.

  • inspector/CommandLineAPIHost.cpp:

(WebCore::CommandLineAPIHost::databaseId):
(WebCore::CommandLineAPIHost::storageId):

  • inspector/CommandLineAPIHost.h:
  • inspector/CommandLineAPIHost.idl:
  • inspector/InspectorDOMStorageAgent.cpp:

(WebCore::InspectorDOMStorageAgent::storageId):

  • inspector/InspectorDOMStorageAgent.h:
  • inspector/InspectorDatabaseAgent.cpp:

(WebCore::InspectorDatabaseAgent::databaseId):

  • inspector/InspectorDatabaseAgent.h:
  • inspector/InspectorFrontendHost.cpp:

(WebCore::InspectorFrontendHost::showContextMenu):
(WebCore::InspectorFrontendHost::dispatchEventAsContextMenuEvent):

  • inspector/InspectorFrontendHost.h:
  • inspector/InspectorFrontendHost.idl:

Remove nullability from arguments that should never be null.

12:36 PM Changeset in webkit [219734] by commit-queue@webkit.org
  • 65 edits in trunk/Source/WebInspectorUI

Web Inspector: Avoid subclassing WebInspector.Object if we do not need to
https://bugs.webkit.org/show_bug.cgi?id=174703

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2017-07-21
Reviewed by Brian Burg.

  • UserInterface/Models/LogObject.js:

(WebInspector.LogObject):
(WebInspector.LogObject.prototype.get startDate): Deleted.
Remove unused startDate property as well.

  • UserInterface/Base/YieldableTask.js:
  • UserInterface/Debug/ProtocolTrace.js:
  • UserInterface/Models/AnalyzerMessage.js:
  • UserInterface/Models/ApplicationCacheFrame.js:
  • UserInterface/Models/ApplicationCacheManifest.js:
  • UserInterface/Models/BackForwardEntry.js:
  • UserInterface/Models/Branch.js:
  • UserInterface/Models/BreakpointAction.js:
  • UserInterface/Models/CSSMedia.js:
  • UserInterface/Models/CSSSelector.js:
  • UserInterface/Models/CallFrame.js:
  • UserInterface/Models/CallingContextTree.js:
  • UserInterface/Models/CallingContextTreeNode.js:
  • UserInterface/Models/CollectionEntry.js:
  • UserInterface/Models/CollectionEntryPreview.js:
  • UserInterface/Models/ConsoleMessage.js:
  • UserInterface/Models/DOMSearchMatchObject.js:
  • UserInterface/Models/DatabaseObject.js:
  • UserInterface/Models/DatabaseTableObject.js:
  • UserInterface/Models/DebuggerDashboard.js:
  • UserInterface/Models/DebuggerData.js:
  • UserInterface/Models/ExecutionContext.js:
  • UserInterface/Models/ExecutionContextList.js:
  • UserInterface/Models/GarbageCollection.js:
  • UserInterface/Models/HeapSnapshotRootPath.js:
  • UserInterface/Models/IndexedDatabase.js:
  • UserInterface/Models/IndexedDatabaseObjectStore.js:
  • UserInterface/Models/IndexedDatabaseObjectStoreIndex.js:
  • UserInterface/Models/Instrument.js:
  • UserInterface/Models/KeyboardShortcut.js:
  • UserInterface/Models/LineWidget.js:
  • UserInterface/Models/MemoryCategory.js:
  • UserInterface/Models/MemoryPressureEvent.js:
  • UserInterface/Models/ObjectPreview.js:
  • UserInterface/Models/Probe.js:
  • UserInterface/Models/ProbeSetDataFrame.js:
  • UserInterface/Models/Profile.js:
  • UserInterface/Models/ProfileNode.js:
  • UserInterface/Models/ProfileNodeCall.js:
  • UserInterface/Models/PropertyDescriptor.js:
  • UserInterface/Models/PropertyPath.js:
  • UserInterface/Models/PropertyPreview.js:
  • UserInterface/Models/ResourceQueryMatch.js:
  • UserInterface/Models/ResourceQueryResult.js:
  • UserInterface/Models/ResourceTimingData.js:
  • UserInterface/Models/Revision.js:
  • UserInterface/Models/ScopeChainNode.js:
  • UserInterface/Models/ScriptSyntaxTree.js:
  • UserInterface/Models/SourceCodePosition.js:
  • UserInterface/Models/SourceCodeSearchMatchObject.js:
  • UserInterface/Models/SourceMap.js:
  • UserInterface/Models/StackTrace.js:
  • UserInterface/Models/StructureDescription.js:
  • UserInterface/Models/TextMarker.js:
  • UserInterface/Models/TextRange.js:
  • UserInterface/Models/TimelineRange.js:
  • UserInterface/Models/TypeDescription.js:
  • UserInterface/Models/TypeSet.js:
  • UserInterface/Protocol/ProtocolTracer.js:
  • UserInterface/Proxies/FormatterWorkerProxy.js:
  • UserInterface/Proxies/HeapSnapshotDiffProxy.js:
  • UserInterface/Proxies/HeapSnapshotWorkerProxy.js:
  • UserInterface/Test/TestSuite.js:
11:48 AM Changeset in webkit [219733] by beidson@apple.com
  • 29 edits
    13 deletes in trunk

Get rid of WebCore IconDatabase code.
https://bugs.webkit.org/show_bug.cgi?id=174700

Reviewed by Tim Horton.

Source/WebCore:

No new tests (No behavior change).

Tons of red.
Very little green.
No further explanation.

  • CMakeLists.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • dom/Document.cpp:

(WebCore::Document::implicitClose):

  • history/HistoryItem.cpp:

(WebCore::HistoryItem::HistoryItem):
(WebCore::HistoryItem::~HistoryItem):
(WebCore::HistoryItem::reset):
(WebCore::HistoryItem::setURLString):

  • inspector/InspectorNetworkAgent.cpp:

(WebCore::InspectorNetworkAgent::willSendRequest):

  • loader/DocumentLoader.cpp:

(WebCore::DocumentLoader::~DocumentLoader):
(WebCore::DocumentLoader::startIconLoading):
(WebCore::DocumentLoader::iconLoadDecisionAvailable): Deleted.
(WebCore::iconLoadDecisionCallback): Deleted.
(WebCore::DocumentLoader::getIconLoadDecisionForIconURL): Deleted.
(WebCore::DocumentLoader::continueIconLoadWithDecision): Deleted.
(WebCore::iconDataCallback): Deleted.
(WebCore::DocumentLoader::getIconDataForIconURL): Deleted.

  • loader/DocumentLoader.h:

(WebCore::DocumentLoader::linkIcons):

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::FrameLoader):
(WebCore::FrameLoader::stop):

  • loader/FrameLoader.h:

(WebCore::FrameLoader::subframeLoader):
(WebCore::FrameLoader::icon): Deleted.

  • loader/FrameLoaderClient.h:
  • loader/archive/cf/LegacyWebArchive.cpp:

(WebCore::LegacyWebArchive::create):

  • loader/icon/IconController.cpp: Removed.
  • loader/icon/IconController.h: Removed.
  • loader/icon/IconDatabase.cpp: Removed.
  • loader/icon/IconDatabase.h: Removed.
  • loader/icon/IconDatabaseBase.cpp: Removed.
  • loader/icon/IconDatabaseBase.h: Removed.
  • loader/icon/IconDatabaseClient.h: Removed.
  • loader/icon/IconLoader.cpp:

(WebCore::IconLoader::IconLoader):
(WebCore::IconLoader::startLoading):
(WebCore::IconLoader::notifyFinished):

  • loader/icon/IconLoader.h:
  • loader/icon/IconRecord.cpp: Removed.
  • loader/icon/IconRecord.h: Removed.
  • loader/icon/PageURLRecord.cpp: Removed.
  • loader/icon/PageURLRecord.h: Removed.
  • testing/Internals.cpp:

(WebCore::Internals::shortcutIconURLs):

Source/WebKit:

  • UIProcess/API/glib/WebKitWebContext.cpp:
  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::useIconLoadingClient): Deleted.

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

Source/WebKitLegacy:

  • WebKitLegacy.xcodeproj/project.pbxproj:

Source/WebKitLegacy/mac:

  • Misc/WebCoreStatistics.mm:

(+[WebCoreStatistics iconPageURLMappingCount]):
(+[WebCoreStatistics iconRetainedPageURLCount]):
(+[WebCoreStatistics iconRecordCount]):
(+[WebCoreStatistics iconsWithDataCount]):

  • WebCoreSupport/WebFrameLoaderClient.h:
  • WebCoreSupport/WebFrameLoaderClient.mm:
  • WebCoreSupport/WebIconDatabaseClient.h: Removed.
  • WebCoreSupport/WebIconDatabaseClient.mm: Removed.
  • WebView/WebView.mm:

(-[WebView mainFrameIconURL]):

LayoutTests:

  • fast/dom/icon-url-list-expected.txt:
  • fast/dom/icon-url-list.html:
9:59 AM Changeset in webkit [219732] by Yusuke Suzuki
  • 3 edits in trunk/Source/WTF

[WTF] Drop initializeDate
https://bugs.webkit.org/show_bug.cgi?id=174714

Reviewed by Darin Adler.

minYear static variable will be initialized in an exclusive manner, which is ensured by C++ "static" semantics.
Thus, we do not need to call initializeDate() explicitly.

  • wtf/DateMath.cpp:

(WTF::equivalentYearForDST):
(WTF::initializeDates): Deleted.

  • wtf/Threading.cpp:

(WTF::initializeThreading):

9:41 AM Changeset in webkit [219731] by Yusuke Suzuki
  • 12 edits
    1 add in trunk/Source

[JSC] Introduce static symbols
https://bugs.webkit.org/show_bug.cgi?id=158863

Reviewed by Darin Adler.

Source/JavaScriptCore:

We use StaticSymbolImpl to initialize PrivateNames and builtin Symbols.
As a result, we can share the same Symbol values between VMs and threads.
And we do not need to allocate Ref<SymbolImpl> for these symbols at runtime.

  • CMakeLists.txt:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • builtins/BuiltinNames.cpp: Added.

Suppress warning C4307, integral constant overflow. It is intentional in constexpr hash value calculation.

  • builtins/BuiltinNames.h:

(JSC::BuiltinNames::BuiltinNames):

  • builtins/BuiltinUtils.h:

Source/WTF:

We add a new class StaticSymbolImpl. StaticSymbolImpl can offer
the way to create static SymbolImpl. It can be shared between
multiple VMs and multiple threads.

  • wtf/text/SymbolImpl.h:

(WTF::SymbolImpl::StaticSymbolImpl::StaticSymbolImpl):
(WTF::SymbolImpl::StaticSymbolImpl::operator SymbolImpl&):
For StaticSymbolImpl's hashForSymbol, we use usual string hash value.
Since all the SymbolImpls are unique, basically, any value is OK here.
Non-confilicting to the other SymbolImpls is ideal.

9:35 AM Changeset in webkit [219730] by Chris Dumez
  • 15 edits
    3 moves in trunk/Source/WebCore

Rename DOMCoreException class to DOMException
https://bugs.webkit.org/show_bug.cgi?id=174698

Reviewed by Darin Adler.

Rename DOMCoreException class to DOMException to match its Web-exposed name.

  • CMakeLists.txt:
  • DerivedSources.cpp:
  • DerivedSources.make:
  • Modules/quota/StorageErrorCallback.cpp:

(WebCore::StorageErrorCallback::CallbackTask::CallbackTask):

  • Modules/quota/StorageErrorCallback.h:
  • Modules/quota/StorageErrorCallback.idl:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSDOMExceptionHandling.cpp:

(WebCore::retrieveErrorMessage):
(WebCore::createDOMException):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateOverloadDispatcher):

  • css/FontFaceSet.cpp:
  • css/FontFaceSet.h:
  • dom/DOMAllInOne.cpp:
  • dom/DOMException.cpp: Renamed from Source/WebCore/dom/DOMCoreException.cpp.

(WebCore::DOMException::create):
(WebCore::DOMException::DOMException):
(WebCore::DOMException::initializeDescription):

  • dom/DOMException.h: Renamed from Source/WebCore/dom/DOMCoreException.h.

(WebCore::DOMException::create):
(WebCore::DOMException::DOMException):

  • dom/DOMException.idl: Renamed from Source/WebCore/dom/DOMCoreException.idl.
  • dom/DOMExceptions.in:
  • dom/make_dom_exceptions.pl:

(generateImplementation):

9:34 AM Changeset in webkit [219729] by Chris Dumez
  • 10 edits in trunk/LayoutTests

Unreviewed, rebaseline test after r219708.

  • js/dom/global-constructors-attributes-expected.txt:
  • platform/gtk/js/dom/global-constructors-attributes-expected.txt:
  • platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt:
  • platform/mac-highsierra-wk1/js/dom/global-constructors-attributes-expected.txt:
  • platform/mac-highsierra/js/dom/global-constructors-attributes-expected.txt:
  • platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
  • platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
  • platform/mac/js/dom/global-constructors-attributes-expected.txt:
  • platform/win/js/dom/global-constructors-attributes-expected.txt:
9:02 AM Changeset in webkit [219728] by commit-queue@webkit.org
  • 3 edits in trunk/Tools

[CMake] Add an option to stop build after generating project files
https://bugs.webkit.org/show_bug.cgi?id=174664

Patch by Yousuke Kimoto <Yousuke.Kimoto@sony.com> on 2017-07-21
Reviewed by Konstantin Tokarev.

Add "--generate-project-only" to stop build after generating project files.

  • Scripts/build-webkit: Add '--generate-project-only' option and a checker to stop build.
  • Scripts/webkitdirs.pm: Add a function to check '--generate-project-only' option and the same checker as the above

(buildCMakeProjectOrExit): Add a cheker to stop build stop build after generating project files.
(determineIsGenerateProjectOnly): Check if '--generate-project-only' option is specified
(isGenerateProjectOnly): ditto

9:01 AM Changeset in webkit [219727] by Yusuke Suzuki
  • 5 edits
    2 adds in trunk

[FTL] Arguments elimination is suppressed by unreachable blocks
https://bugs.webkit.org/show_bug.cgi?id=174352

Reviewed by Filip Pizlo.

JSTests:

  • stress/arguments-elimination-force-exit.js: Added.

(shouldBe):
(strict):
(sloppy):

  • stress/arguments-elimination-throw.js: Added.

(shouldBe):
(shouldThrow):
(sloppy):
(isArguments):

Source/JavaScriptCore:

If we do not execute op_get_by_id, our value profiling tells us unpredictable and DFG emits ForceOSRExit.
The problem is that arguments elimination phase checks escaping even when ForceOSRExit preceeds.
Since GetById without information can escape arguments if it is specified, non-executed code including
op_get_by_id with arguments can escape arguments.

For example,

function test(flag)
{

if (flag) {

This is not executed, but emits GetById with arguments.
It prevents us from eliminating materialization.
return arguments.length;

}
return arguments.length;

}
noInline(test);
while (true)

test(false);

We do not perform CFA and dead-node clipping yet when performing arguments elimination phase.
So this GetById exists and escapes arguments.

To solve this problem, our arguments elimination phase checks preceding pseudo-terminal nodes.
If it is shown, following GetById does not escape arguments. Compared to performing AI, it is
lightweight. But it catches much of typical cases we failed to perform arguments elimination.

  • dfg/DFGArgumentsEliminationPhase.cpp:
  • dfg/DFGNode.h:

(JSC::DFG::Node::isPseudoTerminal):

  • dfg/DFGValidate.cpp:
8:50 AM Changeset in webkit [219726] by weinig@apple.com
  • 2 edits in trunk/Source/WebCore

Follow up to https://bugs.webkit.org/show_bug.cgi?id=174659.

  • inspector/InspectorFrontendHost.idl:

Remove unnecessary JSGenerateToJSObject noticed in review.

8:37 AM Changeset in webkit [219725] by Yusuke Suzuki
  • 5 edits in trunk

[WTF] Newly added AtomicStringImpl should use BufferInternal static string if StringImpl is static
https://bugs.webkit.org/show_bug.cgi?id=174501

Reviewed by Darin Adler.

Source/WTF:

When creating AtomicStringImpl from static StringImpl, we can just use createWithoutCopying
to create a BufferInternal AtomicStringImpl which m_data{8,16} is static string's one.

  • wtf/text/AtomicStringImpl.cpp:

(WTF::CStringTranslator::hash):
(WTF::CStringTranslator::equal):
(WTF::CStringTranslator::translate):
(WTF::AtomicStringImpl::add):
(WTF::HashTranslatorCharBuffer::HashTranslatorCharBuffer):
(WTF::UCharBufferTranslator::hash):
(WTF::UCharBufferTranslator::equal):
(WTF::UCharBufferTranslator::translate):
(WTF::LCharBufferTranslator::hash):
(WTF::LCharBufferTranslator::equal):
(WTF::LCharBufferTranslator::translate):
(WTF::BufferFromStaticDataTranslator::hash):
(WTF::BufferFromStaticDataTranslator::equal):
(WTF::BufferFromStaticDataTranslator::translate):
(WTF::AtomicStringImpl::addLiteral):
(WTF::addSymbol):
(WTF::addStatic):
(WTF::AtomicStringImpl::addSlowCase):
(WTF::AtomicStringImpl::lookUp):
(WTF::CharBufferFromLiteralDataTranslator::hash): Deleted.
(WTF::CharBufferFromLiteralDataTranslator::equal): Deleted.
(WTF::CharBufferFromLiteralDataTranslator::translate): Deleted.
(WTF::addSubstring): Deleted.

  • wtf/text/StringImpl.h:

Tools:

  • TestWebKitAPI/Tests/WTF/StringImpl.cpp:

(TestWebKitAPI::TEST):

6:46 AM Changeset in webkit [219724] by Konstantin Tokarev
  • 5 edits in trunk

[cmake] Unreviewed, add definitions necessary to use ICU shipped with macOS

macOS system ICU libraries are built with U_DISABLE_RENAMING=1 and
U_SHOW_CPLUSPLUS_API=0. After r219155 we have to pass this definitons
explicitly, because ICU headers in the tree are not modified anymore.

.:

  • Source/cmake/OptionsJSCOnly.cmake:
  • Source/cmake/OptionsMac.cmake:

Source/WTF:

  • wtf/PlatformMac.cmake: Rely on ICU_LIBRARIES instead of passing ICU

library name explicitly in WTF_LIBRARIES.

3:22 AM Changeset in webkit [219723] by Carlos Garcia Campos
  • 2 edits in trunk/Source/WebKit

Web Automation: implicit navigations don't cause browsing context switch
https://bugs.webkit.org/show_bug.cgi?id=174633
<rdar://problem/33387797>

Reviewed by Brian Burg.

When a new page load replaces the current frameset, for example when a link in the current browser context has a
_top target, there's no explicit context switch, so the web driver doesn't know that the current browsing
context is no longer valid. Following commands will still be using the previous frame as the current browsing
context, but they don't fail with no such frame because the frame is still alive in the page cache and
referenced in the internal maps used in both UI and web processes. This causes test
testShouldFocusOnTheReplacementWhenAFrameFollowsALinkToA_TopTargetedPage to fail, since it expects a no such
frame exception. When a new page navigation happens we can simply remove references to frames from
m_handleWebFrameMap in WebAutomationSession, because any existing frame reference in the map should be for a
previous page. With this, before the next command is executed, waitForNavigationToComplete will be called and it
will fail with no such frame, condition that is handled to switch to the top level browser context. The test
still fails, because the find element command is called with the top level browsing context, returning no such
element, instead of no such frame. This is consistent with Chrome.

  • UIProcess/Automation/WebAutomationSession.cpp:

(WebKit::WebAutomationSession::navigationOccurredForFrame): Clear the m_handleWebFrameMap when a new page load
finished.

2:50 AM Changeset in webkit [219722] by Carlos Garcia Campos
  • 9 edits in trunk/Source

WebDriver: wait until navigation is complete before running new commands and after a click
https://bugs.webkit.org/show_bug.cgi?id=174670

Reviewed by Brian Burg.

Source/WebDriver:

We are already waiting for navigation to complete after navigation commands (go, back, forward, refresh), but
the spec says we should always wait before executing a new command and also after a click. This is causing test
testShouldBeAbleToNavigateBackInTheBrowserHistoryInPresenceOfIframes to sometimes fail, because it does .click()
+ .title and expects the title to tbe the one of the page loaded by the click. Since the load happens very fast,
the test usually passes, but in a real case with a slower load, the title of the previous page will be returned
most of the times.

6.3 Processing Model. Step 7. Wait for navigation to complete. If this returns an error return its value and
jump to step 1 in this overall algorithm, otherwise continue.
https://www.w3.org/TR/webdriver/#processing-model

14.1 Element Click. Step 10. If the click causes navigation: 1. Run the post-navigation checks and return its
value if it is an error. 2. Try to wait for navigation to complete.
https://www.w3.org/TR/webdriver/#element-click

  • Session.cpp:

(WebDriver::Session::waitForNavigationToComplete): Send waitForNavigationToComplete message to the browser to
wait for any pending navigation of current browsing context to complete.
(WebDriver::Session::elementClick): Call waitForNavigationToComplete() after the click.

  • Session.h:
  • WebDriverService.cpp:

(WebDriver::WebDriverService::go): Wait for navigations to complete before running the command.
(WebDriver::WebDriverService::getCurrentURL): Ditto.
(WebDriver::WebDriverService::back): Ditto.
(WebDriver::WebDriverService::forward): Ditto.
(WebDriver::WebDriverService::refresh): Ditto.
(WebDriver::WebDriverService::getTitle): Ditto.
(WebDriver::WebDriverService::switchToFrame): Ditto.
(WebDriver::WebDriverService::switchToParentFrame): Ditto.
(WebDriver::WebDriverService::findElement): Ditto.
(WebDriver::WebDriverService::findElements): Ditto.
(WebDriver::WebDriverService::executeScript): Ditto.
(WebDriver::WebDriverService::executeAsyncScript): Ditto.

Source/WebKit:

Add waitForNavigationToComplete method to Automation to allow WebDriver to wait for pending navigations to
complete. The new method already receives page load strategy and timeout, but they are not implemented yet.

  • UIProcess/Automation/Automation.json: Add waitForNavigationToComplete method and PageLoadStrategy new type.
  • UIProcess/Automation/WebAutomationSession.cpp:

(WebKit::WebAutomationSession::waitForNavigationToComplete): Call waitForNavigationToCompleteOnPage or
waitForNavigationToCompleteOnFrame depending on whether the current borwsing context is the main frame or not.
(WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage): Check if there's an ongoing load for the page,
and wait for it to complete if needed.
(WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame): Check if there's an ongoing load for the frame,
and wait for it to complete if needed.
(WebKit::WebAutomationSession::navigateBrowsingContext): Use waitForNavigationToCompleteOnPage() now.
(WebKit::WebAutomationSession::goBackInBrowsingContext): Ditto.
(WebKit::WebAutomationSession::goForwardInBrowsingContext): Ditto.
(WebKit::WebAutomationSession::reloadBrowsingContext): Ditto.
(WebKit::WebAutomationSession::navigationOccurredForFrame): Renamed since it now receives the notification for
all the frames. Complete page operations if it's a main frame, or frame operations otherwise.

  • UIProcess/Automation/WebAutomationSession.h:
  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::didFinishLoadForFrame): Notify about all frames, not only the main one.
(WebKit::WebPageProxy::didFailLoadForFrame): Ditto.
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame): Ditto.

2:43 AM Changeset in webkit [219721] by Carlos Garcia Campos
  • 3 edits in trunk/Source/WebDriver

WebDriver: correctly handle main frame handles
https://bugs.webkit.org/show_bug.cgi?id=174668

Reviewed by Brian Burg.

When I switched to use std::optional instead of empty strings for the browsing contexts in WebDriver, I forgot
that automation uses empty string for frames to refer to the main frame. We should handle that case, because we
are currently considering empty strings as valid browsing context. It's not a big deal because Automation
converts back the empty string received to the main frame, though. We should also ensure we close the current
browsing context when switching to a new top level browsing context. This patch adds to helper private methods
to switch browsing contexts that deal with the special cases.

  • Session.cpp:

(WebDriver::Session::close):
(WebDriver::Session::switchToTopLevelBrowsingContext):
(WebDriver::Session::switchToBrowsingContext):
(WebDriver::Session::createTopLevelBrowsingContext):
(WebDriver::Session::go):
(WebDriver::Session::back):
(WebDriver::Session::forward):
(WebDriver::Session::refresh):
(WebDriver::Session::switchToWindow):
(WebDriver::Session::switchToFrame):
(WebDriver::Session::switchToParentFrame):

  • Session.h:
1:22 AM Changeset in webkit [219720] by Claudio Saavedra
  • 11 edits in trunk/LayoutTests

[GTK] Update test expectations after r219663

Unreviewed gardening

DOMException got its toString() removed so the output changes.

  • platform/gtk/crypto/subtle/aes-cbc-cfb-decrypt-malformed-parameters-expected.txt:
  • platform/gtk/crypto/subtle/aes-cbc-cfb-encrypt-malformed-parameters-expected.txt:
  • platform/gtk/crypto/subtle/aes-export-key-malformed-parameters-expected.txt:
  • platform/gtk/crypto/subtle/aes-generate-key-malformed-parameters-expected.txt:
  • platform/gtk/crypto/subtle/aes-import-key-malformed-parameters-expected.txt:
  • platform/gtk/crypto/subtle/rsa-generate-key-malformed-parameters-expected.txt:
  • platform/gtk/crypto/subtle/rsa-import-key-malformed-parameters-expected.txt:
  • platform/gtk/fast/mediastream/RTCPeerConnection-closed-state-expected.txt:
  • platform/gtk/fast/text/font-selection-font-loading-api-parse-expected.txt:
  • platform/gtk/http/tests/dom/document-attributes-null-handling-expected.txt:
12:40 AM Changeset in webkit [219719] by Claudio Saavedra
  • 2 edits in trunk/LayoutTests

[WPE] Update expectation file

Unreviewed gardening.

Drop XPathException after r219708.

  • platform/wpe/js/dom/global-constructors-attributes-expected.txt:

Jul 20, 2017:

11:38 PM Changeset in webkit [219718] by Carlos Garcia Campos
  • 3 edits
    1 delete in trunk/Source/WebKit

Unreviewed. Remove WKIconDatabaseCairo.

  • PlatformGTK.cmake:
  • PlatformWPE.cmake:
  • UIProcess/API/C/cairo/WKIconDatabaseCairo.cpp: Removed.
  • UIProcess/API/C/cairo/WKIconDatabaseCairo.h: Removed.
11:34 PM Changeset in webkit [219717] by graouts@webkit.org
  • 2 edits in trunk/LayoutTests

Turn tests at media/modern-media-controls/seek-forward-support back on
https://bugs.webkit.org/show_bug.cgi?id=174690

Reviewed by Dean Jackson.

  • platform/mac/TestExpectations:
11:32 PM Changeset in webkit [219716] by graouts@webkit.org
  • 2 edits in trunk/LayoutTests

Turn tests at media/modern-media-controls/seek-backward-support back on
https://bugs.webkit.org/show_bug.cgi?id=174689

Reviewed by Dean Jackson.

  • platform/mac/TestExpectations:
11:29 PM Changeset in webkit [219715] by graouts@webkit.org
  • 7 edits in trunk/LayoutTests

Turn tests at media/modern-media-controls/time-labels-support back on
https://bugs.webkit.org/show_bug.cgi?id=174688

Reviewed by Dean Jackson.

  • media/modern-media-controls/time-labels-support/elapsed-time-expected.txt:
  • media/modern-media-controls/time-labels-support/elapsed-time.html:
  • media/modern-media-controls/time-labels-support/remaining-time-expected.txt:
  • media/modern-media-controls/time-labels-support/remaining-time.html:
  • platform/ios-simulator/TestExpectations:
  • platform/mac/TestExpectations:
11:28 PM Changeset in webkit [219714] by graouts@webkit.org
  • 3 edits in trunk/LayoutTests

Turn tests at media/modern-media-controls/status-support back on
https://bugs.webkit.org/show_bug.cgi?id=174687

Reviewed by Dean Jackson.

  • platform/ios-simulator/TestExpectations:
  • platform/mac/TestExpectations:
9:10 PM Changeset in webkit [219713] by beidson@apple.com
  • 23 edits
    5 deletes in trunk/Source/WebKit

Get rid of IconDatabase related code in WebKit.
https://bugs.webkit.org/show_bug.cgi?id=174693

Reviewed by Tim Horton.

This leaves the C-API class but guts it.

No explanations of the other changes are needed.

  • CMakeLists.txt:
  • DerivedSources.make:
  • Shared/WebProcessCreationParameters.cpp:

(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):

  • Shared/WebProcessCreationParameters.h:
  • UIProcess/API/C/WKContext.cpp:

(WKContextGetIconDatabase):
(WKContextSetIconDatabasePath):

  • UIProcess/API/C/WKIconDatabase.cpp:

(WKIconDatabaseSetIconDatabaseClient):
(WKIconDatabaseRetainIconForURL):
(WKIconDatabaseReleaseIconForURL):
(WKIconDatabaseSetIconDataForIconURL):
(WKIconDatabaseSetIconURLForPageURL):
(WKIconDatabaseCopyIconURLForPageURL):
(WKIconDatabaseCopyIconDataForPageURL):
(WKIconDatabaseEnableDatabaseCleanup):
(WKIconDatabaseRemoveAllIcons):
(WKIconDatabaseCheckIntegrityBeforeOpening):
(WKIconDatabaseClose):

  • UIProcess/API/C/cg/WKIconDatabaseCG.cpp:

(WKIconDatabaseTryGetCGImageForURL):
(WKIconDatabaseTryCopyCGImageArrayForURL):

  • UIProcess/Cocoa/WebProcessPoolCocoa.mm:

(WebKit::WebProcessPool::platformDefaultIconDatabasePath): Deleted.

  • UIProcess/WebIconDatabase.cpp: Removed.
  • UIProcess/WebIconDatabase.h:

(WebKit::WebIconDatabase::clearProcessPool): Deleted.

  • UIProcess/WebIconDatabase.messages.in: Removed.
  • UIProcess/WebIconDatabaseClient.cpp: Removed.
  • UIProcess/WebIconDatabaseClient.h: Removed.
  • UIProcess/WebProcessPool.cpp:

(WebKit::m_hiddenPageThrottlingTimer):
(WebKit::WebProcessPool::~WebProcessPool):
(WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
(WebKit::WebProcessPool::createNewWebProcess):
(WebKit::WebProcessPool::setIconDatabasePath): Deleted.
(WebKit::WebProcessPool::iconDatabasePath): Deleted.

  • UIProcess/WebProcessPool.h:
  • UIProcess/WebProcessProxy.cpp:

(WebKit::WebProcessProxy::processWillShutDown):
(WebKit::WebProcessProxy::retainIconForPageURL): Deleted.
(WebKit::WebProcessProxy::releaseIconForPageURL): Deleted.
(WebKit::WebProcessProxy::releaseRemainingIconsForPageURLs): Deleted.

  • UIProcess/WebProcessProxy.h:
  • UIProcess/WebProcessProxy.messages.in:
  • UIProcess/gtk/WebProcessPoolGtk.cpp:

(WebKit::WebProcessPool::platformDefaultIconDatabasePath): Deleted.

  • UIProcess/wpe/WebProcessPoolWPE.cpp:

(WebKit::WebProcessPool::platformDefaultIconDatabasePath): Deleted.

  • WebKit.xcodeproj/project.pbxproj:
  • WebProcess/IconDatabase/WebIconDatabaseProxy.cpp: Removed.
  • WebProcess/IconDatabase/WebIconDatabaseProxy.h: Removed.
  • WebProcess/IconDatabase/WebIconDatabaseProxy.messages.in: Removed.
  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
  • WebProcess/WebProcess.cpp:

(WebKit::WebProcess::WebProcess):
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::getWebCoreStatistics):

  • WebProcess/WebProcess.h:
7:36 PM Changeset in webkit [219712] by Chris Dumez
  • 61 edits
    2 adds
    7 deletes in trunk

Drop legacy SVGException type
https://bugs.webkit.org/show_bug.cgi?id=174695

Reviewed by Darin Adler.

Source/WebCore:

Drop legacy SVGException type and use DOMException instead, as per the latest
SVG specification. Both Chrome and Firefox no longer expose the SVGException
type.

  • CMakeLists.txt:
  • DerivedSources.cpp:
  • DerivedSources.make:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSDOMExceptionHandling.cpp:

(WebCore::createDOMException):

  • bindings/js/JSExceptionBase.cpp:

(WebCore::toExceptionBase):

  • dom/DOMExceptions.in:
  • svg/SVGAllInOne.cpp:
  • svg/SVGCircleElement.cpp:
  • svg/SVGException.cpp: Removed.
  • svg/SVGException.h: Removed.
  • svg/SVGException.idl: Removed.
  • svg/SVGGraphicsElement.idl:
  • svg/SVGLocatable.cpp:

(WebCore::SVGLocatable::getTransformToElement):

  • svg/SVGMatrixValue.h:
  • svg/SVGPathSegList.cpp:

(WebCore::SVGPathSegList::getItem):
(WebCore::SVGPathSegList::replaceItem):
(WebCore::SVGPathSegList::removeItem):

  • svg/SVGPathSegList.h:
  • svg/SVGPathSegList.idl:
  • svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
  • svg/properties/SVGListProperty.h:

LayoutTests:

Update existing tests to reflect behavior change.

  • fast/dom/Window/resources/window-properties.js:
  • js/dom/global-constructors-attributes-expected.txt:
  • platform/gtk/js/dom/global-constructors-attributes-expected.txt:
  • platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt:
  • platform/mac-highsierra-wk1/js/dom/global-constructors-attributes-expected.txt:
  • platform/mac-highsierra/js/dom/global-constructors-attributes-expected.txt:
  • platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
  • platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
  • platform/mac/js/dom/global-constructors-attributes-expected.txt:
  • platform/win/js/dom/global-constructors-attributes-expected.txt:
  • platform/wpe/js/dom/global-constructors-attributes-expected.txt:
  • svg/animations/animate-marker-orient-from-angle-to-autostartreverse-expected.txt:
  • svg/custom/SVGException-expected.txt: Removed.
  • svg/custom/SVGException.html: Removed.
  • svg/custom/global-constructors-expected.txt:
  • svg/custom/global-constructors.html:
  • svg/custom/js-svg-constructors-expected.txt:
  • svg/custom/js-svg-constructors.svg:
  • svg/dom/SVGAnimatedEnumeration-SVGClipPathElement-expected.txt:
  • svg/dom/SVGAnimatedEnumeration-SVGComponentTransferFunctionElement-expected.txt:
  • svg/dom/SVGAnimatedEnumeration-SVGFEBlendElement-expected.txt:
  • svg/dom/SVGAnimatedEnumeration-SVGFEColorMatrixElement-expected.txt:
  • svg/dom/SVGAnimatedEnumeration-SVGFEConvolveMatrixElement-expected.txt:
  • svg/dom/SVGAnimatedEnumeration-SVGFEDisplacementMapElement-expected.txt:
  • svg/dom/SVGAnimatedEnumeration-SVGFEMorphologyElement-expected.txt:
  • svg/dom/SVGAnimatedEnumeration-SVGFETurbulenceElement-expected.txt:
  • svg/dom/SVGAnimatedEnumeration-SVGFilterElement-expected.txt:
  • svg/dom/SVGAnimatedEnumeration-SVGGradientElement-expected.txt:
  • svg/dom/SVGAnimatedEnumeration-SVGMarkerElement-expected.txt:
  • svg/dom/SVGAnimatedEnumeration-SVGMaskElement-expected.txt:
  • svg/dom/SVGAnimatedEnumeration-SVGPatternElement-expected.txt:
  • svg/dom/SVGAnimatedEnumeration-SVGTextContentElement-expected.txt:
  • svg/dom/SVGAnimatedEnumeration-SVGTextPathElement-expected.txt:
  • svg/dom/SVGAnimatedEnumeration-expected.txt:
  • svg/dom/SVGException-obsolete-expected.txt: Added.
  • svg/dom/SVGException-obsolete.html: Added.
  • svg/dom/SVGMatrix-interface-expected.txt:
  • svg/dom/svglist-exception-on-out-bounds-error-expected.txt:
  • svg/filters/feBlend-invalid-mode-expected.txt:
  • svg/filters/feComponentTransfer-style-crash-expected.txt:
  • svg/filters/feDisplacementMap-crash-test-expected.txt:
6:38 PM Changeset in webkit [219711] by Chris Dumez
  • 2 edits in trunk/Source/WebCore

Hook up ITP quirks to the needsSiteSpecificQuirks setting
https://bugs.webkit.org/show_bug.cgi?id=174691

Reviewed by Darin Adler.

Hook up ITP quirks to the needsSiteSpecificQuirks setting to make it easier for
Web-developers to test their fixes.

  • loader/ResourceLoadObserver.cpp:

(WebCore::shouldEnableSiteSpecificQuirks):
(WebCore::areDomainsAssociated):
(WebCore::ResourceLoadObserver::logFrameNavigation):
(WebCore::resourceNeedsSSOQuirk):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):

6:23 PM Changeset in webkit [219710] by Matt Lewis
  • 10 edits in trunk

Unreviewed, rolling out r219700.

This revision caused consistent timouts on iOS.

Reverted changeset:

"Turn tests at media/modern-media-controls/start-support back
on"
https://bugs.webkit.org/show_bug.cgi?id=174683
http://trac.webkit.org/changeset/219700

5:39 PM Changeset in webkit [219709] by commit-queue@webkit.org
  • 17 edits in trunk

Add SPI to notify WKNavigationDelegate about client redirects
https://bugs.webkit.org/show_bug.cgi?id=174680
rdar://problem/33184886

Patch by David Quesada <david_quesada@apple.com> on 2017-07-20
Reviewed by Brady Eidson.

Source/WebCore:

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::performClientRedirect):

  • loader/FrameLoader.h:

Add a convenience method for NavigationScheduler that handles a FrameLoadRequest
as a client redirect. Currently this means loading the request and informing the
client about it.

  • loader/FrameLoaderClient.h:

Add FrameLoaderClient::dispatchDidPerformClientRedirect() to inform the client when
a client redirect occurs.

  • loader/NavigationScheduler.cpp:

Removed ScheduledURLNavigation::fire(). This class was never instantiated directly,
and all subclasses override fire(), so this was unused code.
For ScheduledRedirects and ScheduledLocationChange, use FrameLoader's new method to
load the request as a client redirect.

Source/WebKit:

  • UIProcess/API/APINavigationClient.h:

(API::NavigationClient::didPerformClientRedirectForNavigation):
Add a new virtual method for navigation clients to implement if they want to be informed
when the page is initiating a navigation that is a client redirect.

  • UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:

Declare the new WKNavigationDelegate method -_webView:didPerformClientRedirectForNavigation:

  • UIProcess/Cocoa/NavigationState.h:
  • UIProcess/Cocoa/NavigationState.mm:

(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::NavigationClient::didPerformClientRedirectForNavigation):
Add a new method to NavigationState method to tell the WKNavigationDelegate when a
client redirect happens.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::didPerformClientRedirectForLoadForFrame):

  • UIProcess/WebPageProxy.h:
  • UIProcess/WebPageProxy.messages.in:

Allow the WebPageProxy to receive a message from the web process when a client redirect happens.

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::dispatchDidPerformClientRedirect):

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

Send this new message to the UI process on client redirects.

Tools:

  • TestWebKitAPI/Tests/WebKit2Cocoa/Navigation.mm:

(-[DidPerformClientRedirectNavigationDelegate _webView:didPerformClientRedirectForNavigation:]):
(TEST):
Add API test for -[id<WKNavigationDelegatePrivate> _webView:didPerformClientRedirectForNavigation:].

4:02 PM Changeset in webkit [219708] by Chris Dumez
  • 27 edits
    2 adds
    6 deletes in trunk

Drop legacy XPathException type
https://bugs.webkit.org/show_bug.cgi?id=174679

Reviewed by Sam Weinig.

Source/WebCore:

Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome
no longer expose XPathException.

Test: fast/dom/DOMException/XPathException-obsolete.html

  • CMakeLists.txt:
  • DerivedSources.cpp:
  • DerivedSources.make:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSDOMExceptionHandling.cpp:

(WebCore::createDOMException):

  • bindings/js/JSExceptionBase.cpp:

(WebCore::toExceptionBase):

  • dom/DOMExceptions.in:
  • xml/XPathException.cpp: Removed.
  • xml/XPathException.h: Removed.
  • xml/XPathException.idl: Removed.
  • xml/XPathExpression.cpp:

(WebCore::XPathExpression::evaluate):

  • xml/XPathParser.cpp:

(WebCore::XPath::Parser::parseStatement):

  • xml/XPathResult.cpp:

(WebCore::XPathResult::convertTo):
(WebCore::XPathResult::numberValue):
(WebCore::XPathResult::stringValue):
(WebCore::XPathResult::booleanValue):
(WebCore::XPathResult::singleNodeValue):
(WebCore::XPathResult::snapshotLength):
(WebCore::XPathResult::iterateNext):
(WebCore::XPathResult::snapshotItem):

Source/WebKit:

Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome
no longer expose XPathException.

  • UIProcess/Automation/atoms/FindNodes.js:

(tryToFindNode):

Source/WebKitLegacy/mac:

Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome
no longer expose XPathException.

  • DOM/ExceptionHandlers.mm:

(raiseDOMErrorException):

LayoutTests:

Update existing tests to reflect behavior change.

  • dom/svg/level3/xpath/XPathEvaluator_createExpression_INVALID_EXPRESSION_ERR.js:

(XPathEvaluator_createExpression_INVALID_EXPRESSION_ERR):

  • dom/svg/level3/xpath/XPathEvaluator_evaluate_INVALID_EXPRESSION_ERR.js:

(XPathEvaluator_evaluate_INVALID_EXPRESSION_ERR):

  • dom/svg/level3/xpath/XPathEvaluator_evaluate_TYPE_ERR.js:

(XPathEvaluator_evaluate_TYPE_ERR):

  • dom/svg/level3/xpath/XPathResult_TYPE_ERR.js:

(XPathResult_TYPE_ERR):

  • fast/dom/DOMException/XPathException-expected.txt: Removed.
  • fast/dom/DOMException/XPathException.html: Removed.
  • fast/dom/DOMException/resources/XPathException.js: Removed.
  • fast/dom/Window/resources/window-properties.js:
  • fast/dom/Window/window-lookup-precedence-expected.txt:
  • fast/xpath/4XPath/Core/test_parser-expected.txt:
  • fast/xpath/invalid-functions-expected.txt:
  • fast/xpath/py-dom-xpath/expressions-expected.txt:
  • platform/gtk/fast/dom/Window/window-lookup-precedence-expected.txt:
  • platform/mac/fast/dom/Window/window-lookup-precedence-expected.txt:
3:45 PM Changeset in webkit [219707] by Chris Dumez
  • 28 edits
    7 adds
    2 deletes in trunk

Unreviewed, rolling out r219706.

Broke iOS build

Reverted changeset:

"Drop legacy XPathException type"
https://bugs.webkit.org/show_bug.cgi?id=174679
http://trac.webkit.org/changeset/219706

3:03 PM Changeset in webkit [219706] by Chris Dumez
  • 28 edits
    2 adds
    6 deletes in trunk

Drop legacy XPathException type
https://bugs.webkit.org/show_bug.cgi?id=174679

Reviewed by Sam Weinig.

Source/WebCore:

Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome
no longer expose XPathException.

Test: fast/dom/DOMException/XPathException-obsolete.html

  • CMakeLists.txt:
  • DerivedSources.cpp:
  • DerivedSources.make:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSDOMExceptionHandling.cpp:

(WebCore::createDOMException):

  • bindings/js/JSExceptionBase.cpp:

(WebCore::toExceptionBase):

  • dom/DOMExceptions.in:
  • xml/XPathException.cpp: Removed.
  • xml/XPathException.h: Removed.
  • xml/XPathException.idl: Removed.
  • xml/XPathExpression.cpp:

(WebCore::XPathExpression::evaluate):

  • xml/XPathParser.cpp:

(WebCore::XPath::Parser::parseStatement):

  • xml/XPathResult.cpp:

(WebCore::XPathResult::convertTo):
(WebCore::XPathResult::numberValue):
(WebCore::XPathResult::stringValue):
(WebCore::XPathResult::booleanValue):
(WebCore::XPathResult::singleNodeValue):
(WebCore::XPathResult::snapshotLength):
(WebCore::XPathResult::iterateNext):
(WebCore::XPathResult::snapshotItem):

Source/WebKit:

Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome
no longer expose XPathException.

  • UIProcess/Automation/atoms/FindNodes.js:

(tryToFindNode):

Source/WebKitLegacy/mac:

Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome
no longer expose XPathException.

  • DOM/ExceptionHandlers.mm:

(raiseDOMErrorException):

  • WebKit.exp:

LayoutTests:

Update existing tests to reflect behavior change.

  • dom/svg/level3/xpath/XPathEvaluator_createExpression_INVALID_EXPRESSION_ERR.js:

(XPathEvaluator_createExpression_INVALID_EXPRESSION_ERR):

  • dom/svg/level3/xpath/XPathEvaluator_evaluate_INVALID_EXPRESSION_ERR.js:

(XPathEvaluator_evaluate_INVALID_EXPRESSION_ERR):

  • dom/svg/level3/xpath/XPathEvaluator_evaluate_TYPE_ERR.js:

(XPathEvaluator_evaluate_TYPE_ERR):

  • dom/svg/level3/xpath/XPathResult_TYPE_ERR.js:

(XPathResult_TYPE_ERR):

  • fast/dom/DOMException/XPathException-expected.txt: Removed.
  • fast/dom/DOMException/XPathException.html: Removed.
  • fast/dom/DOMException/resources/XPathException.js: Removed.
  • fast/dom/Window/resources/window-properties.js:
  • fast/dom/Window/window-lookup-precedence-expected.txt:
  • fast/xpath/4XPath/Core/test_parser-expected.txt:
  • fast/xpath/invalid-functions-expected.txt:
  • fast/xpath/py-dom-xpath/expressions-expected.txt:
  • platform/gtk/fast/dom/Window/window-lookup-precedence-expected.txt:
  • platform/mac/fast/dom/Window/window-lookup-precedence-expected.txt:
2:09 PM Changeset in webkit [219705] by Chris Dumez
  • 4 edits in trunk/Source/WebKit

Avoid unnecessary WorkQueue dispatch in WebResourceLoadStatisticsStore::processStatisticsAndDataRecords()
https://bugs.webkit.org/show_bug.cgi?id=174686

Reviewed by Geoffrey Garen.

Avoid unnecessary WorkQueue dispatch in WebResourceLoadStatisticsStore::processStatisticsAndDataRecords(). The most common
call site is already on the right thread.

  • UIProcess/API/Cocoa/WKWebsiteDataStore.mm:

(-[WKWebsiteDataStore _resourceLoadStatisticsProcessStatisticsAndDataRecords]):

  • UIProcess/WebResourceLoadStatisticsStore.cpp:

(WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
(WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):

  • UIProcess/WebResourceLoadStatisticsStore.h:
2:09 PM Changeset in webkit [219704] by Matt Lewis
  • 2 edits in trunk/LayoutTests

Rebaselined svg/css/getComputedStyle-basic.xhtml.

Unreviewed test gardening.

  • platform/mac-highsierra/svg/css/getComputedStyle-basic-expected.txt:
2:08 PM Changeset in webkit [219703] by Chris Dumez
  • 4 edits in trunk/Source

Regression(ITP): May get frequently logged out of wsj.com
https://bugs.webkit.org/show_bug.cgi?id=174661
<rdar://problem/32343256>

Reviewed by Geoffrey Garen.

Source/WebCore:

Add the concept of associated domains in the ResourceLoadObserver. We
previously ignore loads to and from the same domains. We now do the same
if the to and from domains are associated (i.e. owned by the same entity).

For now, only add domains owned by Dow Jones & Company, Inc. to the list,
to address login issues on wsj.com.

No new tests, verified manually on wsj.com.

  • loader/ResourceLoadObserver.cpp:

(WebCore::areDomainsAssociated):
(WebCore::ResourceLoadObserver::logFrameNavigation):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):

Source/WebKit:

Bump statistics file version to blow away old statistics on disk since those do not
take into account associated domains.

  • UIProcess/WebResourceLoadStatisticsStore.cpp:
2:06 PM Changeset in webkit [219702] by Chris Dumez
  • 78 edits in trunk/Source

Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable
https://bugs.webkit.org/show_bug.cgi?id=174660

Reviewed by Geoffrey Garen.

Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable.
This essentially replaces a branch to figure out if the new size is less or greater than the
current size by an assertion.

Source/bmalloc:

  • bmalloc/Map.h:

(bmalloc::Hash>::rehash):

Source/JavaScriptCore:

  • b3/B3BasicBlockUtils.h:

(JSC::B3::clearPredecessors):

  • b3/B3InferSwitches.cpp:
  • b3/B3LowerToAir.cpp:

(JSC::B3::Air::LowerToAir::finishAppendingInstructions):

  • b3/B3ReduceStrength.cpp:
  • b3/B3SparseCollection.h:

(JSC::B3::SparseCollection::packIndices):

  • b3/B3UseCounts.cpp:

(JSC::B3::UseCounts::UseCounts):

  • b3/air/AirAllocateRegistersAndStackByLinearScan.cpp:
  • b3/air/AirEmitShuffle.cpp:

(JSC::B3::Air::emitShuffle):

  • b3/air/AirLowerAfterRegAlloc.cpp:

(JSC::B3::Air::lowerAfterRegAlloc):

  • b3/air/AirOptimizeBlockOrder.cpp:

(JSC::B3::Air::optimizeBlockOrder):

  • bytecode/Operands.h:

(JSC::Operands::ensureLocals):

  • bytecode/PreciseJumpTargets.cpp:

(JSC::computePreciseJumpTargetsInternal):

  • dfg/DFGBlockInsertionSet.cpp:

(JSC::DFG::BlockInsertionSet::execute):

  • dfg/DFGBlockMapInlines.h:

(JSC::DFG::BlockMap<T>::BlockMap):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::processSetLocalQueue):
(JSC::DFG::ByteCodeParser::clearCaches):

  • dfg/DFGDisassembler.cpp:

(JSC::DFG::Disassembler::Disassembler):

  • dfg/DFGFlowIndexing.cpp:

(JSC::DFG::FlowIndexing::recompute):

  • dfg/DFGGraph.cpp:

(JSC::DFG::Graph::registerFrozenValues):

  • dfg/DFGInPlaceAbstractState.cpp:

(JSC::DFG::setLiveValues):

  • dfg/DFGLICMPhase.cpp:

(JSC::DFG::LICMPhase::run):

  • dfg/DFGLivenessAnalysisPhase.cpp:
  • dfg/DFGNaturalLoops.cpp:

(JSC::DFG::NaturalLoops::NaturalLoops):

  • dfg/DFGStoreBarrierClusteringPhase.cpp:
  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileNode):

  • heap/CodeBlockSet.cpp:

(JSC::CodeBlockSet::deleteUnmarkedAndUnreferenced):

  • heap/MarkedSpace.cpp:

(JSC::MarkedSpace::sweepLargeAllocations):

  • inspector/ContentSearchUtilities.cpp:

(Inspector::ContentSearchUtilities::findMagicComment):

  • interpreter/ShadowChicken.cpp:

(JSC::ShadowChicken::update):

  • parser/ASTBuilder.h:

(JSC::ASTBuilder::shrinkOperandStackBy):

  • parser/Lexer.h:

(JSC::Lexer::setOffset):

  • runtime/RegExpInlines.h:

(JSC::RegExp::matchInline):

  • runtime/RegExpPrototype.cpp:

(JSC::genericSplit):

  • yarr/RegularExpression.cpp:

(JSC::Yarr::RegularExpression::match):

Source/WebCore:

  • Modules/gamepad/Gamepad.cpp:

(WebCore::Gamepad::Gamepad):

  • Modules/webaudio/AudioContext.cpp:

(WebCore::AudioContext::addReaction):

  • Modules/websockets/WebSocketChannel.cpp:

(WebCore::WebSocketChannel::skipBuffer):

  • Modules/websockets/WebSocketDeflater.cpp:

(WebCore::WebSocketDeflater::finish):

  • contentextensions/ContentExtensionCompiler.cpp:

(WebCore::ContentExtensions::serializeSelector):

  • contentextensions/DFABytecodeCompiler.cpp:

(WebCore::ContentExtensions::append):

  • crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:

(WebCore::gcryptEncrypt):
(WebCore::gcryptDecrypt):

  • crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp:

(WebCore::gcryptDerive):

  • platform/gamepad/cocoa/GameControllerGamepadProvider.mm:

(WebCore::GameControllerGamepadProvider::controllerDidConnect):

  • platform/gamepad/mac/HIDGamepadProvider.cpp:

(WebCore::HIDGamepadProvider::deviceAdded):

  • platform/graphics/ImageBackingStore.h:

(WebCore::ImageBackingStore::setSize):

  • platform/graphics/WOFFFileFormat.cpp:
  • platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:

(WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes):
(WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues):

  • platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:

(WebCore::InbandTextTrackPrivateAVF::resetCueValues):
(WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer):

  • platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:

(WebCore::InbandTextTrackPrivateAVCF::readNativeSampleBuffer):

  • platform/graphics/cg/ImageBufferCG.cpp:

(WebCore::cfData):

  • platform/image-decoders/bmp/BMPImageDecoder.cpp:

(WebCore::BMPImageDecoder::frameBufferAtIndex):

  • platform/image-decoders/ico/ICOImageDecoder.cpp:

(WebCore::ICOImageDecoder::decode):

  • platform/image-decoders/jpeg/JPEGImageDecoder.cpp:

(WebCore::JPEGImageDecoder::frameBufferAtIndex):

  • platform/image-decoders/png/PNGImageDecoder.cpp:

(WebCore::PNGImageDecoder::frameBufferAtIndex):
(WebCore::PNGImageDecoder::readChunks):

  • platform/image-decoders/webp/WEBPImageDecoder.cpp:

(WebCore::WEBPImageDecoder::frameBufferAtIndex):

  • platform/image-encoders/JPEGImageEncoder.cpp:

(WebCore::compressRGBABigEndianToJPEG):

  • platform/text/DecodeEscapeSequences.h:

(WebCore::URLEscapeSequence::decodeRun):

  • platform/text/SuffixTree.h:

(WebCore::SuffixTree::Node::Node):

  • rendering/Grid.cpp:

(WebCore::Grid::setNeedsItemsPlacement):

  • rendering/RenderTable.cpp:

(WebCore::RenderTable::invalidateCachedColumns):

Source/WebKit:

  • Platform/IPC/ArgumentCoders.h:
  • UIProcess/Gamepad/UIGamepadProvider.cpp:

(WebKit::UIGamepadProvider::platformGamepadConnected):

  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::setInitialConnectedGamepads):

  • WebProcess/Network/WebLoaderStrategy.cpp:

(WebKit::WebLoaderStrategy::loadResourceSynchronously):

  • WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp:

(WebKit::WebPasteboardOverrides::getDataForOverride):

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::requestAutocorrectionData):

Source/WebKitLegacy/mac:

  • Plugins/WebNetscapePluginView.mm:

(-[WebNetscapePluginView saveAndSetNewPortStateForUpdate:]):

Source/WTF:

  • wtf/IndexSparseSet.h:

(WTF::OverflowHandler>::IndexSparseSet):
(WTF::OverflowHandler>::clear):

  • wtf/Insertion.h:

(WTF::executeInsertions):

  • wtf/RangeSet.h:

(WTF::RangeSet::compact):

  • wtf/Vector.h:

(WTF::removeRepeatedElements):

  • wtf/persistence/Coders.h:
1:52 PM Changeset in webkit [219701] by Chris Dumez
  • 4 edits in trunk/Source

Regression(ITP): Can no longer log in on abc.go.com
https://bugs.webkit.org/show_bug.cgi?id=174533
<rdar://problem/33325881>

Reviewed by Geoffrey Garen.

Source/WebCore:

Add quirk for sp.auth.adobe.com which is used for SSO by web sites such as
abc.go.com. This would otherwise cause adobe.com to be identified as a
tracker and log in on abc.go.com would break.

No new tests, tested manually on abc.go.com.

  • loader/ResourceLoadObserver.cpp:

(WebCore::resourceNeedsSSOQuirk):
(WebCore::ResourceLoadObserver::logSubresourceLoading):

Source/WebKit:

Bump statistics database version to blow away any existing statistics. Without this, SSO providers
for which we added a quirk may already be in the database and identified as trackers. The quirk
merely prevents the specified SSO providers from being identified as trackers.

  • UIProcess/WebResourceLoadStatisticsStore.cpp:
1:47 PM Changeset in webkit [219700] by commit-queue@webkit.org
  • 10 edits in trunk

Turn tests at media/modern-media-controls/start-support back on
https://bugs.webkit.org/show_bug.cgi?id=174683

Patch by Antoine Quint <Antoine Quint> on 2017-07-20
Reviewed by Dean Jackson.

Source/WebCore:

Turning those tests back on revealed a small bug that is unlikely to really affect content
on the Web. In the case where the size of the video is known right away, without the need
for loading its metadata, as is the case in the start-support-click-to-start.html test with
a local media resource, all queued layouts are flushed at once and we may call the layout()
method of the left ButtonsContainer which originally is set to contain the play/pause button,
which would remove the play/pause button from the center of the media. So before we potentially
set the play/pause button as the central button, we first assign the default button set for
the two ButtonsContainer instances and only add the play/pause button when we're not showing
the prominent play/pause button.

  • Modules/modern-media-controls/controls/inline-media-controls.js:

(InlineMediaControls.prototype.layout):
(InlineMediaControls.prototype._leftContainerButtons):

LayoutTests:

  • media/modern-media-controls/start-support/start-support-click-to-start-expected.txt:
  • media/modern-media-controls/start-support/start-support-click-to-start.html:
  • media/modern-media-controls/start-support/start-support-fullscreen.html:
  • media/modern-media-controls/start-support/start-support-lowPowerMode-expected.txt:
  • media/modern-media-controls/start-support/start-support-lowPowerMode.html:
  • platform/ios-simulator/TestExpectations:
  • platform/mac/TestExpectations:
1:35 PM Changeset in webkit [219699] by Chris Dumez
  • 12 edits
    3 deletes in trunk

Drop legacy FileException type
https://bugs.webkit.org/show_bug.cgi?id=174676

Reviewed by Alex Christensen.

Drop legacy FileException type and use DOMException instead, as per the latest
File API specification:

Both Firefox and Chrome no longer expose FileException.

  • CMakeLists.txt:
  • DerivedSources.cpp:
  • DerivedSources.make:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSDOMExceptionHandling.cpp:

(WebCore::createDOMException):

  • dom/DOMExceptions.in:
  • fileapi/FileException.cpp: Removed.
  • fileapi/FileException.h: Removed.
  • fileapi/FileException.idl: Removed.
  • fileapi/FileReaderLoader.cpp:

(WebCore::FileReaderLoader::FileReaderLoader):
(WebCore::FileReaderLoader::failed):

  • fileapi/FileReaderLoader.h:

(WebCore::FileReaderLoader::errorCode):

  • fileapi/FileReaderSync.cpp:

(WebCore::errorCodeToExceptionCode):
(WebCore::FileReaderSync::startLoading):

1:34 PM Changeset in webkit [219698] by beidson@apple.com
  • 2 edits in trunk/Tools

Test WebKit2CustomProtocolsTest.ProcessPoolDestroyedDuringLoading added in r219664 fails on El Capitan.
https://bugs.webkit.org/show_bug.cgi?id=174685

Reviewed by Andy Estes.

  • TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm:

(TestWebKitAPI::TEST): Use a scoped AutodrainedPool instead of a RetainPtr<NSAutoreleasePool>.

12:06 PM Changeset in webkit [219697] by Matt Lewis
  • 2 edits in trunk/LayoutTests

Marked media/modern-media-controls/scrubber-support/scrubber-support-drag.html as flaky
https://bugs.webkit.org/show_bug.cgi?id=174682

Unreviewed test gardening.

  • platform/mac/TestExpectations:
11:32 AM Changeset in webkit [219696] by Yusuke Suzuki
  • 10 edits in trunk/Source

[WTF] Use ThreadGroup to bookkeep active threads for Mach exception
https://bugs.webkit.org/show_bug.cgi?id=174678

Reviewed by Mark Lam.

Source/JavaScriptCore:

Use Thread& instead.

  • runtime/JSLock.cpp:

(JSC::JSLock::didAcquireLock):

Source/WTF:

We can use ThreadGroup to bookkeep active threads for Mach exceptions.
When the thread dies, it is automatically removed from the thread groups.
So we do not need to call unregisterThreadForMachExceptionHandling.

  • wtf/ThreadGroup.cpp:

(WTF::ThreadGroup::~ThreadGroup):
(WTF::ThreadGroup::add):

  • wtf/ThreadGroup.h:
  • wtf/ThreadHolder.cpp:

(WTF::ThreadHolder::~ThreadHolder):

  • wtf/Threading.cpp:

(WTF::Thread::addToThreadGroup):
(WTF::Thread::removeFromThreadGroup):

  • wtf/Threading.h:
  • wtf/threads/Signals.cpp:

(WTF::setExceptionPorts):
(WTF::activeThreads):
(WTF::registerThreadForMachExceptionHandling):
(WTF::installSignalHandler):
(WTF::unregisterThreadForMachExceptionHandling): Deleted.

  • wtf/threads/Signals.h:
11:07 AM Changeset in webkit [219695] by beidson@apple.com
  • 11 edits
    3 deletes in trunk

Deprecate WebIconDatabase in WebKitLegacy/mac.
https://bugs.webkit.org/show_bug.cgi?id=174607

Reviewed by Alex Christensen.

Source/WebKitLegacy/mac:

This patch:
1 - Formally deprecates WebIconDatabase (which was never API anyways)
2 - Guts the class to where it can only return the default icon at the small size
3 - Reworks other parts of WebKitLegacy that used it for anything to either

use something else or to not do anything.

This patch *could* go much farther. A future patch is what will remove WebCore/IconDatabase
and that patch will remove all of the last remnants of WebIconDatabase.

  • History/WebHistoryItem.mm:

(-[WebHistoryItem icon]):

  • Misc/WebIconDatabase.h:
  • Misc/WebIconDatabase.mm:

(-[WebIconDatabase init]):
(-[WebIconDatabase iconForURL:withSize:cache:]):
(-[WebIconDatabase iconForURL:withSize:]):
(-[WebIconDatabase defaultIconWithSize:]):
(-[WebIconDatabase defaultIconForURL:withSize:]):
(-[WebIconDatabase iconURLForURL:]):
(-[WebIconDatabase retainIconForURL:]):
(-[WebIconDatabase releaseIconForURL:]):
(+[WebIconDatabase delayDatabaseCleanup]):
(+[WebIconDatabase allowDatabaseCleanup]):
(-[WebIconDatabase setDelegate:]):
(-[WebIconDatabase delegate]):
(+[WebIconDatabase initialize]): Deleted.
(-[WebIconDatabase isEnabled]): Deleted.
(-[WebIconDatabase setEnabled:]): Deleted.
(-[WebIconDatabase removeAllIcons]): Deleted.
(+[WebIconDatabase _checkIntegrityBeforeOpening]): Deleted.
(-[WebIconDatabase _sendNotificationForURL:]): Deleted.
(-[WebIconDatabase _sendDidRemoveAllIconsNotification]): Deleted.
(-[WebIconDatabase _startUpIconDatabase]): Deleted.
(-[WebIconDatabase _shutDownIconDatabase]): Deleted.
(-[WebIconDatabase _applicationWillTerminate:]): Deleted.
(-[WebIconDatabase _iconForFileURL:withSize:]): Deleted.
(-[WebIconDatabase _resetCachedWebPreferences:]): Deleted.
(-[WebIconDatabase _largestIconFromDictionary:]): Deleted.
(-[WebIconDatabase _iconsBySplittingRepresentationsOfIcon:]): Deleted.
(-[WebIconDatabase _iconFromDictionary:forSize:cache:]): Deleted.
(-[WebIconDatabase _scaleIcon:toSize:]): Deleted.
(-[WebIconDatabase _databaseDirectory]): Deleted.
(webGetNSImage): Deleted.

  • Misc/WebIconDatabaseDelegate.h: Removed.
  • Misc/WebIconDatabaseInternal.h: Removed.
  • Misc/WebIconDatabasePrivate.h: Removed.
  • WebCoreSupport/WebFrameLoaderClient.mm:

(webGetNSImage):

  • WebCoreSupport/WebIconDatabaseClient.mm:

(WebIconDatabaseClient::didRemoveAllIcons):
(WebIconDatabaseClient::didImportIconURLForPageURL):

  • WebView/WebView.mm:

(-[WebView setFrameLoadDelegate:]):
(-[WebView mainFrameIcon]):

Tools:

  • DumpRenderTree/mac/TestRunnerMac.mm:
10:45 AM Changeset in webkit [219694] by Chris Dumez
  • 11 edits in trunk/LayoutTests

Unreviewed, rebaseline test on all platforms after r219673.

  • js/dom/global-constructors-attributes-expected.txt:
  • platform/gtk/js/dom/global-constructors-attributes-expected.txt:
  • platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt:
  • platform/mac-highsierra-wk1/js/dom/global-constructors-attributes-expected.txt:
  • platform/mac-highsierra/js/dom/global-constructors-attributes-expected.txt:
  • platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
  • platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
  • platform/mac/js/dom/global-constructors-attributes-expected.txt:
  • platform/win/js/dom/global-constructors-attributes-expected.txt:
  • platform/wpe/js/dom/global-constructors-attributes-expected.txt:
10:18 AM Changeset in webkit [219693] by jiewen_tan@apple.com
  • 1 edit
    1 add in trunk/Websites/webkit.org

Unreviewed, add the final demo page for a WebCrypto API blog post

  • demos/webcrypto/pbkdf2.html: Added.
10:00 AM Changeset in webkit [219692] by Chris Dumez
  • 2 edits in trunk/LayoutTests/imported/w3c

Unreviewed, rebaseline test after r219663.

  • web-platform-tests/WebCryptoAPI/import_export/test_rsa_importKey.https-expected.txt:
9:58 AM Changeset in webkit [219691] by commit-queue@webkit.org
  • 7 edits
    1 delete in trunk/Source/WebCore

[WebIDL] Remove custom bindings for InspectorFrontendHost
https://bugs.webkit.org/show_bug.cgi?id=174659

Patch by Sam Weinig <sam@webkit.org> on 2017-07-20
Reviewed by Chris Dumez.

  • CMakeLists.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSBindingsAllInOne.cpp:
  • bindings/js/JSInspectorFrontendHostCustom.cpp: Removed.

Remove JSInspectorFrontendHostCustom.cpp.

  • inspector/InspectorFrontendHost.cpp:

(WebCore::populateContextMenu):
(WebCore::InspectorFrontendHost::showContextMenu):

  • inspector/InspectorFrontendHost.h:
  • inspector/InspectorFrontendHost.idl:

Re-implement showContextMenu by using an IDL defined ContextMenuItem dictionary
and converting from that to a WebCore::ContextMenu in the implementation.

9:42 AM Changeset in webkit [219690] by jiewen_tan@apple.com
  • 2 edits
    3 adds in trunk/Websites/webkit.org

Unreviewed, add yet another demo page for a WebCrypto API blog post

  • demos/webcrypto/aes-gcm.html:
  • demos/webcrypto/alice.png: Added.
  • demos/webcrypto/bob.png: Added.
  • demos/webcrypto/ecdh.html: Added.
9:33 AM Changeset in webkit [219689] by Jonathan Bedard
  • 3 edits in trunk/Tools

lint-test-expectations should be run during style checking
https://bugs.webkit.org/show_bug.cgi?id=173559
<rdar://problem/32854941>

Reviewed by Aakash Jain.

  • Scripts/webkitpy/layout_tests/models/test_expectations.py:

(TestExpectationsModel._already_seen_better_match): Append returns 'None' when successful,
prevents identifying errors on specific lines in a file.

  • Scripts/webkitpy/style/main_unittest.py:

(ExpectationLinterInStyleCheckerTest.test_linter_duplicate_line_edit_in_file): Test for the
case where a linter error is in the file modified, but the line modified is not related to
the linter error.

8:59 AM Changeset in webkit [219688] by commit-queue@webkit.org
  • 4 edits in trunk

[GTK] Layout Test http/tests/media/hls/hls-progress.html is failing
https://bugs.webkit.org/show_bug.cgi?id=141469

Patch by Charlie Turner <cturner@igalia.com> on 2017-07-20
Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

A work-around for getting progress information in a timely manner from
live pipelines. We cannot rely on getting BUFFERING messages within
the stalled time window (3s), so we have to poll for progress
information somehow.

Makes the following pass reliably

http/tests/media/hls/hls-audio-tracks-has-audio.html passed unexpectedly
http/tests/media/hls/hls-audio-tracks.html passed unexpectedly
http/tests/media/hls/hls-progress.html passed unexpectedly

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:

(WebCore::findHLSQueue):
(WebCore::isHLSProgressing):
(WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):

LayoutTests:

Fixes the removed tests.

  • platform/gtk/TestExpectations:
8:48 AM Changeset in webkit [219687] by Michael Catanzaro
  • 2 edits in trunk/LayoutTests

Unreviewed GTK test gardening

  • platform/gtk/TestExpectations:
8:46 AM Changeset in webkit [219686] by jiewen_tan@apple.com
  • 2 edits
    2 adds in trunk/Websites/webkit.org

Unreviewed, add another demo page for a WebCrypto API blog post

  • demos/webcrypto/aes-gcm.html: Added.
  • demos/webcrypto/asynchronous-execution.html:
  • demos/webcrypto/common.js: Added.
7:37 AM Changeset in webkit [219685] by akling@apple.com
  • 5 edits in trunk/Source/WebCore

Minor Node->Element type tightening fixes
https://bugs.webkit.org/show_bug.cgi?id=174651

Reviewed by Sam Weinig.

Tighten up some Node* into Element* or even better, Element&.

  • dom/Document.cpp:

(WebCore::acceptsEditingFocus): Take a const Element&.
(WebCore::Document::setFocusedElement):

  • editing/Editor.cpp:

(WebCore::Editor::findEventTargetFrom): Return an Element*.
(WebCore::Editor::findEventTargetFromSelection): Ditto.
(WebCore::Editor::pasteAsPlainText):
(WebCore::Editor::pasteAsFragment):
(WebCore::Editor::dispatchCPPEvent):

  • editing/Editor.h:
  • page/DragController.cpp:

(WebCore::DragController::dispatchTextInputEventFor):

7:30 AM Changeset in webkit [219684] by beidson@apple.com
  • 12 edits
    3 deletes in trunk

Remove WebIconDatabase from WebKitLegacy/win.
https://bugs.webkit.org/show_bug.cgi?id=174608

Reviewed by Alex Christensen.

Source/WebKitLegacy/win:

It is unused.

  • ForEachCoClass.h:
  • Interfaces/IWebIconDatabase.idl: Removed.
  • Interfaces/WebKit.idl:
  • WebCoreStatistics.cpp:

(WebCoreStatistics::iconPageURLMappingCount):
(WebCoreStatistics::iconRetainedPageURLCount):
(WebCoreStatistics::iconRecordCount):
(WebCoreStatistics::iconsWithDataCount):

  • WebIconDatabase.cpp: Removed.
  • WebIconDatabase.h: Removed.
  • WebKitClassFactory.cpp:
  • WebKitDLL.cpp:

(shutDownWebKit):

  • WebKitLogging.h:
  • WebView.cpp:

(WebView::close):
(WebView::notifyDidAddIcon):
(WebView::registerForIconNotification):
(WebView::dispatchDidReceiveIconFromWebFrame):
(WebView::onNotify):

Tools:

  • DumpRenderTree/win/DumpRenderTree.cpp:

(main):

  • DumpRenderTree/win/TestRunnerWin.cpp:

(TestRunner::setIconDatabaseEnabled):

7:28 AM Changeset in webkit [219683] by beidson@apple.com
  • 4 edits in trunk/Source/WebCore

WKHTTPCookieStore API tests fail on High Sierra.
<rdar://problem/33410271> and https://bugs.webkit.org/show_bug.cgi?id=174666

Reviewed by Andy Estes.

Covered by existing API tests.

In r219567 I'd moved cookie storage observation off of NSHTTPCookieStorage and NSNotificationCenter
to CFHTTPCookieStorage observation callbacks.

This is because notifications were only sent for the default [NSHTTPCookieStorage sharedHTTPCookieStorage]
and not any of the other ones we keep in flight.

Unfortunately that SPI has been disabled in High Sierra.
Fortunately we found a way we can get non-shared NSHTTPCookieStorages to send notifications that works everywhere.

  • platform/network/cocoa/CookieStorageObserver.h:
  • platform/network/cocoa/CookieStorageObserver.mm:

(-[WebCookieObserverAdapter initWithObserver:]):
(-[WebCookieObserverAdapter cookiesChangedNotificationHandler:]):
(WebCore::CookieStorageObserver::create):
(WebCore::CookieStorageObserver::CookieStorageObserver):
(WebCore::CookieStorageObserver::~CookieStorageObserver):
(WebCore::CookieStorageObserver::startObserving): Use a trick to call some SPI on non-shared NSHTTPCookieStorages

to get them to send notifications.

(WebCore::CookieStorageObserver::stopObserving):
(WebCore::cookiesChanged): Deleted.

  • platform/network/cocoa/NetworkStorageSessionCocoa.mm:

(WebCore::NetworkStorageSession::cookieStorageObserver):

7:25 AM Changeset in webkit [219682] by jiewen_tan@apple.com
  • 1 edit
    3 adds in trunk/Websites/webkit.org

Unreviewed, add a demo page for a WebCrypto API blog post

  • demos/webcrypto/asynchronous-execution-worker.js: Added.
  • demos/webcrypto/asynchronous-execution.html: Added.
6:07 AM Changeset in webkit [219681] by magomez@igalia.com
  • 2 edits in trunk/Source/WebCore

[GStreamer] Some layout tests issue "g_mutex_clear() called on uninitialised or locked mutex" and flaky crash in ~MediaPlayerPrivateGStreamerBase
https://bugs.webkit.org/show_bug.cgi?id=173952

Reviewed by Carlos Garcia Campos.

Adjust MediaPlayerPrivateGStreamerBase to avoid concurrence problems with the GStreamer thread when
destroying the object.

Covered by existent tests.

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:

(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::repaint):
(WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):

5:11 AM Changeset in webkit [219680] by zandobersek@gmail.com
  • 2 edits in trunk/Tools

[WPE] Adjust priority of GSource used in WKTR's HeadlessViewBackend
https://bugs.webkit.org/show_bug.cgi?id=174671

Reviewed by Carlos Garcia Campos.

  • WebKitTestRunner/wpe/HeadlessViewBackend.cpp:

(HeadlessViewBackend::HeadlessViewBackend): Use the RunLoopDispatcher
priority for this source in order to have it dispatched on the same
priority as the other WebKit-controlled GSource objects.

2:12 AM WikiStart edited by clopez@igalia.com
(diff)
2:07 AM WPE edited by clopez@igalia.com
(diff)
2:05 AM WPE created by clopez@igalia.com
12:46 AM Changeset in webkit [219679] by zandobersek@gmail.com
  • 37 edits in trunk/LayoutTests

Unreviewed WPE gardening. Updating test baselines after r219663.

  • platform/wpe/crypto/subtle/aes-cbc-cfb-decrypt-malformed-parameters-expected.txt:
  • platform/wpe/crypto/subtle/aes-cbc-cfb-encrypt-malformed-parameters-expected.txt:
  • platform/wpe/crypto/subtle/aes-export-key-malformed-parameters-expected.txt:
  • platform/wpe/crypto/subtle/aes-generate-key-malformed-parameters-expected.txt:
  • platform/wpe/crypto/subtle/aes-import-key-malformed-parameters-expected.txt:
  • platform/wpe/crypto/subtle/rsa-generate-key-malformed-parameters-expected.txt:
  • platform/wpe/crypto/subtle/rsa-import-key-malformed-parameters-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-destroy-persistent-license-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-license-events-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-license-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-usage-record-events-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-usage-record-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-destroy-persistent-license-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-license-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-usage-record-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-clear-encrypted-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-encrypted-clear-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-encrypted-clear-sources-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-events-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential-readyState-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multisession-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-after-src-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-after-update-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-immediately-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-onencrypted-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-two-videos-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-requestmediakeysystemaccess-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-reset-src-after-setmediakeys-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-again-after-resetting-src-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-multiple-times-with-the-same-mediakeys-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-unique-origin-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-not-callable-after-createsession-expected.txt:

Jul 19, 2017:

11:09 PM Changeset in webkit [219678] by zandobersek@gmail.com
  • 13 edits
    10 adds
    2 deletes in trunk/Source/WebCore

[EME] Push CDMInstance, CDMPrivate and associated types into the Platform layer
https://bugs.webkit.org/show_bug.cgi?id=174496

Reviewed by Xabier Rodriguez-Calvar.

Move the CDMInstance and CDMPrivate interfaces into the platform layer, enabling
implementations of specific key systems at that level, as well as integration with
the MediaPlayerPrivate stack without any layering violations.

While the platform layer still uses the WebCore namespace, the two interface files
have now been moved under the platform/encryptedmedia/ directory and out of the
Modules/encryptedmedia/ directory where the Web-facing API implementation resides.

The two interfaces integrated closely with the Web-facing enumerations and
dictionaries: MediaKeyMessageType, MediaKeySessionType, MediaKeyStatus,
MediaKeySystemConfiguration, MediaKeySystemCapability, MediaKeysRequirement
and MediaKeysRestrictions. Definitions of these types are also moved to the
platform layer without any changes (apart from renaming), and the previous
types now alias against the types now located in the platform layer.

No new tests -- no change in behavior.

  • CMakeLists.txt:
  • Modules/encryptedmedia/CDM.cpp:
  • Modules/encryptedmedia/CDM.h:
  • Modules/encryptedmedia/MediaKeyMessageType.h:
  • Modules/encryptedmedia/MediaKeySessionType.h:
  • Modules/encryptedmedia/MediaKeyStatus.h:
  • Modules/encryptedmedia/MediaKeySystemAccess.cpp:
  • Modules/encryptedmedia/MediaKeySystemAccess.h:
  • Modules/encryptedmedia/MediaKeySystemConfiguration.h:
  • Modules/encryptedmedia/MediaKeySystemMediaCapability.h:
  • Modules/encryptedmedia/MediaKeysRequirement.h:
  • Modules/encryptedmedia/MediaKeysRestrictions.h:
  • platform/encryptedmedia/CDMInstance.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMInstance.h.
  • platform/encryptedmedia/CDMKeyStatus.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeyStatus.h.
  • platform/encryptedmedia/CDMKeySystemConfiguration.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySystemConfiguration.h.
  • platform/encryptedmedia/CDMMediaCapability.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySystemMediaCapability.h.
  • platform/encryptedmedia/CDMMessageType.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageType.h.
  • platform/encryptedmedia/CDMPrivate.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivate.h.
  • platform/encryptedmedia/CDMRequirement.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeysRequirement.h.
  • platform/encryptedmedia/CDMRestrictions.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeysRestrictions.h.
  • platform/encryptedmedia/CDMSessionType.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySessionType.h.
11:08 PM Changeset in webkit [219677] by zandobersek@gmail.com
  • 2 edits in trunk/Source/WebCore

Unreviewed follow-up to r219674.

  • page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:

Remove the AsyncScrollingCoordinator.h header include that was added by accident.

10:57 PM Changeset in webkit [219676] by zandobersek@gmail.com
  • 7 edits
    1 add in trunk/Source

[CMake] Clean up Web Crypto build targets
https://bugs.webkit.org/show_bug.cgi?id=174253

Reviewed by Alex Christensen.

Gather the common WebCrypto source files in CMakeLists.txt, including them
in the build unconditionally and instead relying on ENABLE_SUBTLE_CRYPTO
build guards to exclude the code from compilation if the feature is disabled.

PlatformGTK.cmake, PlatformMac.cmake and PlatformWPE.cmake can then remove
duplicated build targets. PlatformMac.cmake still lists all the Mac-specific
Web Crypto build targets.

PlatformGTK.cmake and PlatformWPE.cmake now include GCrypt.cmake if the
USE_GCRYPT variable is enabled. Both ports at the moment enable that variable
though as they by default leverage a libgcrypt-based CrpytoDigest implementation
in the PAL library.

The new GCrypt.cmake file adds the libgcrypt-specific Web Crypto build targets to
the build and also sets up libgcrypt include directiories and libraries.

No new tests -- no change in behavior.

  • CMakeLists.txt:
  • PlatformGTK.cmake:
  • PlatformMac.cmake:
  • PlatformWPE.cmake:
  • platform/GCrypt.cmake: Added.
10:46 PM Changeset in webkit [219675] by commit-queue@webkit.org
  • 8 edits
    1 delete in trunk/Source/WebCore

[WebIDL] Remove custom bindings for CommandLineAPIHost
https://bugs.webkit.org/show_bug.cgi?id=174642

Patch by Sam Weinig <sam@webkit.org> on 2017-07-19
Reviewed by Joseph Pecoraro.

  • CMakeLists.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSBindingsAllInOne.cpp:
  • bindings/js/JSCommandLineAPIHostCustom.cpp: Removed.

Remove JSCommandLineAPIHostCustom.cpp.

  • bindings/js/JSDOMConvertObject.h:

(WebCore::JSConverter<IDLObject>::convert):
Add missing JSConverter specialization for IDLObject.

  • inspector/CommandLineAPIHost.cpp:

(WebCore::CommandLineAPIHost::inspect):
(WebCore::listenerEntriesFromListenerInfo):
(WebCore::CommandLineAPIHost::inspectedObject):
(WebCore::CommandLineAPIHost::databaseId):
(WebCore::CommandLineAPIHost::storageId):
(WebCore::CommandLineAPIHost::inspectImpl): Deleted.
(WebCore::CommandLineAPIHost::getEventListenersImpl): Deleted.
(WebCore::CommandLineAPIHost::databaseIdImpl): Deleted.
(WebCore::CommandLineAPIHost::storageIdImpl): Deleted.

  • inspector/CommandLineAPIHost.h:
  • inspector/CommandLineAPIHost.idl:

Replace custom bindings with modern bindings affordances: dictionaries, records and sequences.

10:43 PM Changeset in webkit [219674] by zandobersek@gmail.com
  • 2 edits in trunk/Source/WebCore

Unreviewed CoordGraphics build fix.

  • page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:

(WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeViewportConstraints):
This should be defined for the ScrollingCoordinatorCoordinatedGraphics class.
Also fix the setFixedToViewport() call, fishing out the GraphicsLayer object from
the ScrollingStateNode's LayerRepresentation.
(WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints): Deleted.

10:23 PM Changeset in webkit [219673] by Chris Dumez
  • 11 edits
    3 deletes in trunk/Source

Drop SQLException type
https://bugs.webkit.org/show_bug.cgi?id=174665

Reviewed by Sam Weinig.

Source/WebCore:

Drop SQLException type. We never throw such exception. Also, Firefox
and Chrome no longer expose this type.

  • CMakeLists.txt:
  • DerivedSources.cpp:
  • DerivedSources.make:
  • Modules/webdatabase/SQLException.cpp: Removed.
  • Modules/webdatabase/SQLException.h: Removed.
  • Modules/webdatabase/SQLException.idl: Removed.
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSDOMExceptionHandling.cpp:

(WebCore::createDOMException):

  • bindings/js/JSExceptionBase.cpp:

(WebCore::toExceptionBase):

  • dom/DOMExceptions.in:

Source/WebInspectorUI:

Use SQLError instead of SQLException, this is what the script should really
use here since it is checking the code of an SQLError.

  • .eslintrc:
  • UserInterface/Models/DatabaseObject.js:

(WebInspector.DatabaseObject.prototype.executeSQL.queryCallback):
(WebInspector.DatabaseObject.prototype.executeSQL):
(WebInspector.DatabaseObject):

8:49 PM Changeset in webkit [219672] by mitz@apple.com
  • 7 copies
    1 add in releases/Apple/iOS 10.3.3

Added a tag for iOS 10.3.3.

8:49 PM Changeset in webkit [219671] by mitz@apple.com
  • 8 copies
    1 add in releases/Apple/Safari 10.1.2

Added a tag for Safari 10.1.2.

7:14 PM Changeset in webkit [219670] by Wenson Hsieh
  • 2 edits in trunk/Source/WebCore

Unreviewed, tweak a comment above TemporarySelectionOptionIgnoreSelectionChanges in Editor.cpp.

The comment references the UI process, but it describes an entity in WebCore. This should have been generalized
to instead refer to the client layer in general (i.e. WebKit1 or WebKit2).

  • editing/Editor.h:
5:17 PM Changeset in webkit [219669] by Jonathan Bedard
  • 4 edits in trunk/Tools

lint-test-expectations should be run during style checking
https://bugs.webkit.org/show_bug.cgi?id=173559
<rdar://problem/32854941>

Reviewed by Daniel Bates.

Follow up fix addressing style and a few minor bugs.

  • Scripts/webkitpy/layout_tests/models/test_expectations.py:

(TestExpectationParser.init): Use lambda x: x instead of str
(TestExpectationsModel.init): Make lambda x: x the default argument.
(TestExpectationsModel._already_seen_better_match): Use a temporary variable to
reduce the calls of _shorten_filename, fix minor bug in appending the current
expectation's line number instead of the previous ones, clarify treatment of None
in file-to-line-number mapping.
(TestExpectations._report_warnings): Collapse call.

  • Scripts/webkitpy/style/checkers/test_expectations.py:

(TestExpectationsChecker.lint_test_expectations):

  • Scripts/webkitpy/style/filereader.py: Re-write comment.

(TextFileReader.process_file): Add comment explaining treatment of None in
file-to-line-number mapping.
(TextFileReader.delete_file): Collapse call.

5:15 PM Changeset in webkit [219668] by Simon Fraser
  • 28 edits
    1 copy in trunk

getBoundingClientRects not updated for programmatic scrolls
https://bugs.webkit.org/show_bug.cgi?id=174538
rdar://problem/33049012

Reviewed by Tim Horton.
Source/WebCore:

Baidu.com has two event handlers on its <input>, and both query the input location with getBoundingClientRect()
and the current pageYOffset (via jQuery), then try to scroll the input to the top of the screen. The bug is that
programmatic scrolls did not immediately update the layout viewport rect, so the second call to
getBoundingClientRect() would return stale coordinates, triggering an extra scroll.

To fix this, undo the fix for r219320 which tried to keep getBoundingClientRect() current during unstable scroll
updates by adding a shadow layout viewport rect. Instead, almost always update the layout viewport rect on
FrameView, even during unstable visible rect updates, but not if content insets are being changed interactively,
since changing viewport heights cause problems with bottom-fixed elements. Also, we need to compute a new layout
viewport rect in FrameView::updateLayoutViewport() for programmatic scrolls.

However, always updating the layout viewport triggered issues with the scrolling tree. The scrolling state tree
fossilizes layer positions relative to a specific viewport rect, and that relationship has to be maintained.
There are code paths that recompute fixed/sticky viewport constraints when the layout viewport has changed but
we haven't done layout or recomputed layer positions (e.g. updating viewport-constrained layers via
updateScrollCoordinatedLayersAfterFlush()) and in these cases using a new layout viewport for those computations
results in an inconsistent scrolling tree.

Fix this by not updating scrolling constraints every time we have to re-register scrolling nodes.
updateScrollCoordinatedLayersAfterFlush() only needs to update the layer on the scrolling node (to handle
tiled/non-tiled switches), so make updateScrollCoordinatedLayer() a little more fine-grained, and only update
constraints when we've just computed layer geometry. This allows for different scrolling nodes to have
constraints computed at different times, with different layout viewports, which happens.

Two additional fixes were required to make bottom-fixed bars behave correctly.

First, FrameView::computeLayoutViewportOrigin() had a bug where rounding of half-pixel values would cause it to
fall into the if (visualViewport.height() > layoutViewport.height()) clause, but then fail to clamp for
rubber-banding.

Second, the FrameView::unscaledMaximumScrollPosition() was wrong after zooming on iOS, since it uses visibleSize()
which is affected by page scale on iOS only (and the function wants scale-independent values). Fix with a hack that
should be cleaned up via webkit.org/b/174648.

Tested by existing tests.

  • page/FrameView.cpp:

(WebCore::FrameView::computeUpdatedLayoutViewportRect):
(WebCore::FrameView::computeLayoutViewportOrigin):
(WebCore::FrameView::setLayoutViewportOverrideRect):
(WebCore::FrameView::updateLayoutViewport):
(WebCore::FrameView::unscaledMaximumScrollPosition):
(WebCore::FrameView::documentToClientOffset):
(WebCore::FrameView::setUnstableLayoutViewportRect): Deleted.

  • page/FrameView.h:
  • page/scrolling/AsyncScrollingCoordinator.cpp:

(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
(WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions):
(WebCore::AsyncScrollingCoordinator::updateNodeLayer):
(WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints):
(WebCore::AsyncScrollingCoordinator::updateViewportConstrainedNode): Deleted.

  • page/scrolling/AsyncScrollingCoordinator.h:
  • page/scrolling/ScrollingCoordinator.cpp:

(WebCore::operator<<):

  • page/scrolling/ScrollingCoordinator.h:

(WebCore::ScrollingCoordinator::reconcileScrollingState):
(WebCore::ScrollingCoordinator::updateNodeLayer):
(WebCore::ScrollingCoordinator::updateNodeViewportConstraints):
(WebCore::ScrollingCoordinator::updateViewportConstrainedNode): Deleted.

  • page/scrolling/ScrollingStateFixedNode.cpp:

(WebCore::ScrollingStateFixedNode::updateConstraints):

  • page/scrolling/ScrollingStateStickyNode.cpp:

(WebCore::ScrollingStateStickyNode::updateConstraints):
(WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect):

  • page/scrolling/ScrollingTree.cpp:

(WebCore::ScrollingTree::commitTreeState):

  • page/scrolling/mac/ScrollingTreeFixedNode.mm:

(WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):

  • page/scrolling/mac/ScrollingTreeStickyNode.mm:

(WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::updateGeometry):

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::fixedRootBackgroundLayerChanged):
(WebCore::RenderLayerCompositor::requiresCompositingForPosition):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
(WebCore::RenderLayerCompositor::computeFixedViewportConstraints):
(WebCore::RenderLayerCompositor::computeStickyViewportConstraints):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
(WebCore::RenderLayerCompositor::didAddScrollingLayer):

  • rendering/RenderLayerCompositor.h:

Source/WebKit:

Feed ViewportRectStability and ScrollingLayerPositionAction into reconcileScrollingState().

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::updateVisibleContentRects):

LayoutTests:

New results for these tests, reflecting the fact that programmatic scrolls now update
the layout viewport.

Clean up fast/dom/elementFromPoint-relative-to-viewport.html, and land an iOS expectation. The test
uses eventSender.zoomPageOut() which is not expected to work correctly on iOS. It works when tested
manually.

  • fast/dom/elementFromPoint-relative-to-viewport-expected.txt:
  • fast/dom/elementFromPoint-relative-to-viewport.html:
  • platform/ios-wk2/fast/dom/elementFromPoint-relative-to-viewport-expected.txt: Copied from LayoutTests/fast/dom/elementFromPoint-relative-to-viewport-expected.txt.
  • platform/ios-wk2/fast/visual-viewport/client-rects-relative-to-layout-viewport-expected.txt:
  • platform/ios-wk2/fast/visual-viewport/rtl-zoomed-rects-expected.txt:
  • platform/ios-wk2/fast/visual-viewport/zoomed-fixed-scroll-down-then-up-expected.txt:
  • platform/ios-wk2/fast/visual-viewport/zoomed-rects-expected.txt:
  • platform/ios/fast/visual-viewport/zoomed-fixed-expected.txt:
  • platform/ios/fast/visual-viewport/zoomed-fixed-header-and-footer-expected.txt:
4:59 PM Changeset in webkit [219667] by Chris Dumez
  • 2 edits in trunk/Tools

Unreviewed attempt to fix API test failure after r219663.

The test was hard-coding an exception string and the string has changed slightly
in r219663.

  • TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.mm:

(TEST):

4:57 PM Changeset in webkit [219666] by Megan Gardner
  • 5 edits in trunk

Don't write file URLs to iOS Pasteboard
https://bugs.webkit.org/show_bug.cgi?id=174647
<rdar://problem/33199730>

Reviewed by Wenson Hsieh.

Source/WebCore:

Tests updated to reflect the changes. We are no longer vending file URLs in Drag & Drop and Copy/Paste.

  • editing/ios/EditorIOS.mm:

(WebCore::Editor::writeImageToPasteboard):

  • platform/ios/PlatformPasteboardIOS.mm:

(WebCore::PlatformPasteboard::write):

Tools:

Updating tests to reflect the lack of file URLs for images.

  • TestWebKitAPI/Tests/ios/DataInteractionTests.mm:

(checkTypeIdentifierAndIsNotOtherTypeIdentifier):
(checkEstimatedSize):
(TestWebKitAPI::TEST):

4:38 PM Changeset in webkit [219665] by mmaxfield@apple.com
  • 4 edits
    10 adds in trunk

Setting the minimum font size preference doesn’t affect absolute line-height values, so lines overlap
https://bugs.webkit.org/show_bug.cgi?id=174406
Source/WebCore:

Reviewed by Simon Fraser.
<rdar://problem/10139227>

Reviewed by NOBODY.

When the minimumFontSize API preference is set, we will increase the font size without increasing
the line height. If the content specifies line-height as an absolute value, there can be two
unfortunate results:

  • Adjacent lines in a paragraph can overlap
  • If the paragraph (or containin block or whatever) uses overflow: hidden, the first and last lines

can be cut off and potentially indecipherable.

Instead, we should use the minimum font size preference as a signal that we should increase the
line-height as well as the font-size. Eventually, we will want to increase it by an amount
proportional to the increase in font-size (which can be due to minimumFontSize, minimumLogicalFontSize,
text autosizing, etc.). However, because minimumLogicalFontSize is on by default, this would cause
a behavior change on many webpages which use small text, so such a change would be too risky right now.
Instead, we can pretend that minimumFontSize is the only cause that text increases, and use this as the
only signal to boost the corresponding line-height.

Tests: fast/text/line-height-minimumFontSize-text-zoom.html

fast/text/line-height-minimumFontSize-visual.html
fast/text/line-height-minimumFontSize-zoom.html
fast/text/line-height-minimumFontSize.html
fast/text/line-height-minimumFontSize-autosize.html

  • css/StyleBuilderCustom.h:

(WebCore::computeBaseSpecifiedFontSize):
(WebCore::computeLineHeightMultiplierDueToFontSize):
(WebCore::StyleBuilderCustom::applyValueLineHeight):
(WebCore::StyleBuilderCustom::applyValueFill):
(WebCore::StyleBuilderCustom::applyValueStroke):
(WebCore::StyleBuilderCustom::applyValueContent):

  • rendering/TextAutoSizing.cpp:

LayoutTests:

<rdar://problem/10139227>

Reviewed by Simon Fraser.

  • fast/text/line-height-minimumFontSize-autosize-expected.text: Added.
  • fast/text/line-height-minimumFontSize-autosize.html: Added.
  • fast/text/line-height-minimumFontSize-expected.txt: Added.
  • fast/text/line-height-minimumFontSize-text-zoom-expected.html: Added.
  • fast/text/line-height-minimumFontSize-text-zoom.html: Added.
  • fast/text/line-height-minimumFontSize-visual-expected.html: Added.
  • fast/text/line-height-minimumFontSize-visual.html: Added.
  • fast/text/line-height-minimumFontSize-zoom-expected.html: Added.
  • fast/text/line-height-minimumFontSize-zoom.html: Added.
  • fast/text/line-height-minimumFontSize.html: Added.
1:42 PM Changeset in webkit [219664] by beidson@apple.com
  • 10 edits in trunk

iBooks sometimes crashes when closing a book.
<rdar://problem/31180331> and https://bugs.webkit.org/show_bug.cgi?id=174658

Reviewed by Oliver Hunt.

Source/WebKit:

  • LegacyCustomProtocolManagerProxy should not reference a WebProcessPool directly.
  • LegacyCustomProtocolManagerProxy should invalidate in its destructor.
  • UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.cpp:

(WebKit::LegacyCustomProtocolManagerProxy::LegacyCustomProtocolManagerProxy):
(WebKit::LegacyCustomProtocolManagerProxy::~LegacyCustomProtocolManagerProxy):
(WebKit::LegacyCustomProtocolManagerProxy::startLoading):
(WebKit::LegacyCustomProtocolManagerProxy::stopLoading):
(WebKit::LegacyCustomProtocolManagerProxy::invalidate):
(WebKit::LegacyCustomProtocolManagerProxy::wasRedirectedToRequest):
(WebKit::LegacyCustomProtocolManagerProxy::didReceiveResponse):
(WebKit::LegacyCustomProtocolManagerProxy::didLoadData):
(WebKit::LegacyCustomProtocolManagerProxy::didFailWithError):
(WebKit::LegacyCustomProtocolManagerProxy::didFinishLoading):
(WebKit::LegacyCustomProtocolManagerProxy::processDidClose): Deleted.

  • UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.h:
  • UIProcess/Network/NetworkProcessProxy.cpp:

(WebKit::NetworkProcessProxy::NetworkProcessProxy):
(WebKit::NetworkProcessProxy::didClose):

  • UIProcess/Network/NetworkProcessProxy.h:

(WebKit::NetworkProcessProxy::processPool):

Tools:

  • TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm:

(-[ProcessPoolDestroyedDuringLoadingProtocol startLoading]):
(-[ProcessPoolDestroyedDuringLoadingProtocol finishTheLoad]):
(-[ProcessPoolDestroyedDuringLoadingProtocol stopLoading]):
(TestWebKitAPI::TEST):

Add a "spin the runloop X number of times" utility:

  • TestWebKitAPI/Utilities.h:
  • TestWebKitAPI/cocoa/UtilitiesCocoa.mm:

(TestWebKitAPI::Util::spinRunLoop):

1:24 PM Changeset in webkit [219663] by Chris Dumez
  • 537 edits in trunk

DOMException should not have its own toString()
https://bugs.webkit.org/show_bug.cgi?id=174630

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Rebaseline existing tests now that more checks are passing.

  • web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-custom-bindings.any-expected.txt:
  • web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-custom-bindings.any.worker-expected.txt:

Source/WebCore:

DOMException should not have its own toString() and should use the one from Error.prototype.toString()
instead:

No new tests, rebaselined existing tests.

  • dom/DOMCoreException.idl:

LayoutTests:

Rebaseline existing tests as the exception string is now slightly different.

1:13 PM Changeset in webkit [219662] by commit-queue@webkit.org
  • 10 edits in trunk

[iOS] REGRESSION: Scrubbing media using built-in controls does not pause media
https://bugs.webkit.org/show_bug.cgi?id=174650
<rdar://problem/33401877>

Patch by Antoine Quint <Antoine Quint> on 2017-07-19
Reviewed by Dean Jackson.

Source/WebCore:

We would only pause when scrubbing on macOS because we only listened to "mousedown" events on the
scrubber's backing <input> element to identify that the user had started interacting with the
scrubber.

Implementing the same technique on iOS required a little more work than just listening to "touchstart"
events on the same element. On top of that, we needed to make sure that we would only respond to
"touchstart" events on the slider's thumb, and not on the track, since only on macOS should the user
be able to click anywhere on the track to scrub. So we turn off pointer-events for the <input> on iOS
only, and turn them back on specifically for the thumb.

There is also some finessing when dealing with touch events where we need to track the identifier of
the touch that started the user interaction. So we keep track of it in an ivar and wait until we get
a "touchend" event where the changedTouches list contains a touch with that same identifier to ensure
the same touch that initiates and ends the scrubbing interaction.

Finally, we fix another issue that was uncovered while turning back on the ScrubbingSupport tests
where we would not trash the cached _value ivar when we initiated scrubbing, which was important since
we would mistakenly use the pre-srubbing value during a scrub.

  • Modules/modern-media-controls/controls/slider.css:

(.ios .slider > input):
(.slider > input::-webkit-slider-thumb):

  • Modules/modern-media-controls/controls/slider.js:

(Slider.prototype.handleEvent):
(Slider.prototype._handleMousedownEvent):
(Slider.prototype._interactionEndTarget):
(Slider.prototype._handleTouchstartEvent):
(Slider.prototype._valueWillStartChanging):
(Slider.prototype._valueDidStopChanging):
(Slider.prototype._handleMouseupEvent):
(Slider.prototype._handleTouchendEvent):

LayoutTests:

Rebaseline and turn back on all the ScrubberSupport tests on macOS and iOS.

  • media/modern-media-controls/scrubber-support/ipad/scrubber-support-drag-expected.txt:
  • media/modern-media-controls/scrubber-support/ipad/scrubber-support-drag.html:
  • media/modern-media-controls/scrubber-support/scrubber-support-media-api-expected.txt:
  • media/modern-media-controls/scrubber-support/scrubber-support-media-api.html:
  • platform/ios-simulator/TestExpectations:
  • platform/mac/TestExpectations:
12:18 PM Changeset in webkit [219661] by n_wang@apple.com
  • 3 edits
    2 adds in trunk

AX: Web page reloaded when a node is labelling multiple childnodes
https://bugs.webkit.org/show_bug.cgi?id=174655

Reviewed by Chris Fleizach.

Source/WebCore:

When we are asking for the aria-labelledby attribute of a node and its
sibling is also labelled by the same node, we get into an infinite loop
in textUnderElement since we only ignore one child. Added checks for
siblings to avoid such loop.

Test: accessibility/mac/aria-labelledby-multiple-child-crash.html

  • accessibility/AccessibilityNodeObject.cpp:

(WebCore::AccessibilityNodeObject::textUnderElement):

LayoutTests:

  • accessibility/mac/aria-labelledby-multiple-child-crash-expected.txt: Added.
  • accessibility/mac/aria-labelledby-multiple-child-crash.html: Added.
11:16 AM Changeset in webkit [219660] by aestes@apple.com
  • 2 edits in trunk/Source/WebCore

Use a cast to work around clang's false -Wobjc-literal-conversion warnings
https://bugs.webkit.org/show_bug.cgi?id=174631

Reviewed by Dan Bernstein.

Instead of ignoring -Wobjc-literal-conversion, use a cast to work around rdar://problem/33383354.

  • platform/ios/PlatformPasteboardIOS.mm:

(WebCore::PlatformPasteboard::write):

11:16 AM Changeset in webkit [219659] by Chris Dumez
  • 15 edits in trunk

Make cross-origin properties enumerable
https://bugs.webkit.org/show_bug.cgi?id=174576

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Re-sync tests from upstream and rebaseline to improve test coverage.

  • web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt:
  • web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html:
  • web-platform-tests/html/browsers/the-window-object/window-indexed-properties-expected.txt:
  • web-platform-tests/html/browsers/the-window-object/window-indexed-properties.html:

Source/WebCore:

Makes cross-origin properties enumerable on Window and Location objects
as per:

This simplifies our code quite a bit.

No new tests, updated existing tests.

  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
(WebCore::JSDOMWindow::getOwnPropertyNames):

  • bindings/js/JSLocationCustom.cpp:

(WebCore::getOwnPropertySlotCommon):
(WebCore::JSLocation::getOwnPropertyNames):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateHeader):

LayoutTests:

Update / rebaseline some tests to reflect behavior change.

  • http/tests/security/cross-origin-descriptors-expected.txt:
  • http/tests/security/cross-origin-descriptors.html:
  • js/dom/getOwnPropertyDescriptor-expected.txt:
  • js/resources/getOwnPropertyDescriptor.js:
10:27 AM Changeset in webkit [219658] by clopez@igalia.com
  • 2 edits in trunk/Source/WebCore

[EME] Build failure with Clang-3.8 on InitDataRegistry.cpp
https://bugs.webkit.org/show_bug.cgi?id=174628

Reviewed by Žan Doberšek.

  • Modules/encryptedmedia/InitDataRegistry.cpp:

(WebCore::extractKeyIDsKeyids): Add an explicit cast to unsigned.

10:09 AM Changeset in webkit [219657] by Jonathan Bedard
  • 12 edits in trunk/Tools

lint-test-expectations should be run during style checking
https://bugs.webkit.org/show_bug.cgi?id=173559
<rdar://problem/32854941>

Reviewed by David Kilzer.

Running the test expectation linter requires reading both files and lines not in the
patch because, for example, deletion of a test can cause a lint failure even though
no test expectations where modified. This means that the linter will occasionally warn
about lines which were not changed in a given patch but whose error is related to a
change made in that patch.

  • Scripts/webkitpy/common/system/filesystem_mock.py:

(MockFileSystem.open_text_file_for_reading): Add 'errors' argument to mimic filesystem.

  • Scripts/webkitpy/layout_tests/models/test_expectations.py:

(TestExpectationWarning): Added class to pass warnings as an object instead of a string.
(TestExpectationWarning.init): Construct warning with file name, line number, line
content, description of the error and the name of the associated test.
(TestExpectationWarning.str): Convert to string so that existing printing code works.
(TestExpectationParser.init): Pass shorten_filename function to
TestExpectationsParser to add a deleted file to the related_files dictionary.
(TestExpectationParser._check_test_exists): If the test does not exist, add the
missing path to the related_files dictionary.
(TestExpectationLine.init): Add related_files dictionary, which tracks
files and line numbers related to this test expectation line. This will allow
tracking linter errors in the style checker occurring across multiple files.
(TestExpectationsModel._already_seen_better_match): Add redundant expectation
lines to related_files dictionary.
(TestExpectations.init): Pass self._shorten_filename to TestExpectationParser.
(TestExpectations._report_warnings): Construct warning object instead of string
when adding to warnings list.

  • Scripts/webkitpy/port/win.py: Changed logging level form warning to debug to

clean-up log.

  • Scripts/webkitpy/style/checker.py:

(ProcessorBase.do_association_check): Add required function for processor classes.
(StyleProcessor):
(StyleProcessor.do_association_check): Run the TestExpectations linter when
checking for errors between associated files.

  • Scripts/webkitpy/style/checkers/test_expectations.py:

(TestExpectationsChecker.check_test_expectations): Reflect changed import statements.
(TestExpectationsChecker):
(TestExpectationsChecker._should_log_linter_warning): Given a warning, a dictionary
of modified files, the current working directory and the host, determine if the linter
warning is associated with the changes.
(TestExpectationsChecker.lint_test_expectations): Lint test expectations for the
style checker.

  • Scripts/webkitpy/style/filereader.py:

(TextFileReader):
(TextFileReader.init): Track modified files in dictionary instead of a counter.
(TextFileReader.file_count): Use dictionary to determine the number of modified files.
(TextFileReader.process_file): Track both the number of files changed and which lines
in those files were changed.
(TextFileReader.do_association_check): Run the processor's association check on all
modified or deleted files processed by TextFileReader.
(TextFileReader.delete_file): Track deleted files in _files dictionary.
(TextFileReader.count_delete_only_file): Deleted.

  • Scripts/webkitpy/style/filereader_unittest.py:

(TextFileReaderTest.test_delete_file): Renamed function to reflect new function name.
(TextFileReaderTest.test_count_delete_only_file): Moved to test_delete_file.

  • Scripts/webkitpy/style/main.py:

(CheckWebKitStyle.main): When running the style checker on a specific list of files,
explicitly run the association check on the file reader.

  • Scripts/webkitpy/style/main_unittest.py:

(ExpectationLinterInStyleCheckerTest): Added to test the TestExpectationLinter now
embedded in the style checker.
(ExpectationLinterInStyleCheckerTest.setUp): Set up the style checker configuration.
(ExpectationLinterInStyleCheckerTest._generate_file_reader): Given a filesystem object,
construct the TextFileReader object with a StyleProcessor used to run style checks on
specific files.
(ExpectationLinterInStyleCheckerTest._generate_testing_host): Generate a host used for
testing the test expectation linter inside the style checker. This host must contain a
mock file system with the basic structure of test expectations.
(ExpectationLinterInStyleCheckerTest.test_no_linter_errors):
(ExpectationLinterInStyleCheckerTest.test_linter_duplicate_line):
(ExpectationLinterInStyleCheckerTest.test_linter_duplicate_line_no_edit):
(ExpectationLinterInStyleCheckerTest.test_linter_deleted_file):
(ExpectationLinterInStyleCheckerTest.test_linter_deleted_file_no_edit):

  • Scripts/webkitpy/style/patchreader.py:

(PatchReader.check): Specify which file was deleted, run the association check.

  • Scripts/webkitpy/style/patchreader_unittest.py:

(PatchReaderTest.MockTextFileReader.delete_file): Renamed count_delete_only_file.
(PatchReaderTest.MockTextFileReader.do_association_check): Added.
(PatchReaderTest.MockTextFileReader.count_delete_only_file): Renamed delete_file.

9:42 AM Changeset in webkit [219656] by Matt Lewis
  • 4 edits
    10 deletes in trunk

Unreviewed, rolling out r219646.

The test added are failing on all platforms

Reverted changeset:

"Setting the minimum font size preference doesn’t affect
absolute line-height values, so lines overlap"
https://bugs.webkit.org/show_bug.cgi?id=174406
http://trac.webkit.org/changeset/219646

7:10 AM Changeset in webkit [219655] by zandobersek@gmail.com
  • 2 edits in trunk/LayoutTests

Unreviewed WPE gardening.

  • platform/wpe/TestExpectations:

Unskip a bunch of Web Crypto tests that are passing now that
the underlying implementation has progressed.

3:44 AM Changeset in webkit [219654] by Yusuke Suzuki
  • 9 edits
    1 delete in trunk/Source/WTF

[WTF] Remove unnecessary indirection of WTF::Thread entry point
https://bugs.webkit.org/show_bug.cgi?id=174291

Reviewed by Mark Lam.

Now wtfThreadEntryPoint is almost the same. Only the difference is function signature due to platform APIs.
We remove ThreadFunctionInvocation indirection in ThreadingPthread.cpp and ThreadingWin.cpp.

Also, ThreadFunctionInvocation keeps a RefPtr to the Thread object. This was previously needed to keep the
Thread object alive until the thread itself could install the ThreadHolder into its thread local storage.
The ThreadHolder has a Ref that keeps the Thread object alive for the lifetime of the thread. Since
Thread::create() now waits for the thread to be initialized before returning and Thread::create() hold a Ref
to the Thread object, we are guaranteed that the Thread object will be alive long enough for it to be installed
in the thread's ThreadHolder, and we no longer need ThreadFunctionInvocation.

And we also simplify ThreadHolder::initialize a bit. Now Thread::create waits for the completion of Thread
initialization. So, after establishing thread handle, we can call ThreadHolder::initialize before completing
Thread initialization.

Also we drop errno.h ifdefs in ThreadingWin.cpp. This is introduced to support WinCE. But now WinCE port is removed.

  • WTF.xcodeproj/project.pbxproj:
  • wtf/ThreadFunctionInvocation.h: Removed.
  • wtf/ThreadHolder.h:
  • wtf/ThreadHolderWin.cpp:

(WTF::ThreadHolder::initialize):

  • wtf/Threading.cpp:

(WTF::Thread::entryPoint):
(WTF::Thread::create):
(WTF::threadEntryPoint): Deleted.

  • wtf/Threading.h:
  • wtf/ThreadingPthreads.cpp:

(WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
(WTF::wtfThreadEntryPoint):
(WTF::Thread::establishHandle):
(WTF::Thread::initializeCurrentThreadInternal):
(WTF::Thread::current):
(WTF::Thread::establishPlatformSpecificHandle):
(WTF::Thread::createInternal): Deleted.
(WTF::Thread::establish): Deleted.

  • wtf/ThreadingWin.cpp:

(WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
(WTF::Thread::initializeCurrentThreadInternal):
(WTF::wtfThreadEntryPoint):
(WTF::Thread::establishHandle):
(WTF::Thread::current):
(WTF::Thread::establishPlatformSpecificHandle):
(WTF::Thread::createInternal): Deleted.
(WTF::Thread::establish): Deleted.

  • wtf/win/MainThreadWin.cpp:

(WTF::initializeMainThreadPlatform):

1:43 AM Changeset in webkit [219653] by Yusuke Suzuki
  • 24 edits
    2 copies
    1 add in trunk

[WTF] Implement WTF::ThreadGroup
https://bugs.webkit.org/show_bug.cgi?id=174081

Reviewed by Mark Lam.

Source/JavaScriptCore:

Large part of MachineThreads are now removed and replaced with WTF::ThreadGroup.
And SamplingProfiler and others interact with WTF::Thread directly.

  • API/tests/ExecutionTimeLimitTest.cpp:
  • heap/MachineStackMarker.cpp:

(JSC::MachineThreads::MachineThreads):
(JSC::captureStack):
(JSC::MachineThreads::tryCopyOtherThreadStack):
(JSC::MachineThreads::tryCopyOtherThreadStacks):
(JSC::MachineThreads::gatherConservativeRoots):
(JSC::ActiveMachineThreadsManager::Locker::Locker): Deleted.
(JSC::ActiveMachineThreadsManager::add): Deleted.
(JSC::ActiveMachineThreadsManager::remove): Deleted.
(JSC::ActiveMachineThreadsManager::contains): Deleted.
(JSC::ActiveMachineThreadsManager::ActiveMachineThreadsManager): Deleted.
(JSC::activeMachineThreadsManager): Deleted.
(JSC::MachineThreads::~MachineThreads): Deleted.
(JSC::MachineThreads::addCurrentThread): Deleted.
(): Deleted.
(JSC::MachineThreads::removeThread): Deleted.
(JSC::MachineThreads::removeThreadIfFound): Deleted.
(JSC::MachineThreads::MachineThread::MachineThread): Deleted.
(JSC::MachineThreads::MachineThread::getRegisters): Deleted.
(JSC::MachineThreads::MachineThread::Registers::stackPointer): Deleted.
(JSC::MachineThreads::MachineThread::Registers::framePointer): Deleted.
(JSC::MachineThreads::MachineThread::Registers::instructionPointer): Deleted.
(JSC::MachineThreads::MachineThread::Registers::llintPC): Deleted.
(JSC::MachineThreads::MachineThread::captureStack): Deleted.

  • heap/MachineStackMarker.h:

(JSC::MachineThreads::addCurrentThread):
(JSC::MachineThreads::getLock):
(JSC::MachineThreads::threads):
(JSC::MachineThreads::MachineThread::suspend): Deleted.
(JSC::MachineThreads::MachineThread::resume): Deleted.
(JSC::MachineThreads::MachineThread::threadID): Deleted.
(JSC::MachineThreads::MachineThread::stackBase): Deleted.
(JSC::MachineThreads::MachineThread::stackEnd): Deleted.
(JSC::MachineThreads::threadsListHead): Deleted.

  • runtime/SamplingProfiler.cpp:

(JSC::FrameWalker::isValidFramePointer):
(JSC::SamplingProfiler::SamplingProfiler):
(JSC::SamplingProfiler::takeSample):
(JSC::SamplingProfiler::noticeCurrentThreadAsJSCExecutionThread):

  • runtime/SamplingProfiler.h:
  • wasm/WasmMachineThreads.cpp:

(JSC::Wasm::resetInstructionCacheOnAllThreads):

Source/WebCore:

  • page/ResourceUsageThread.h:

Source/WebKit:

  • Shared/AsyncRequest.h:

Source/WTF:

This patch implements WTF::ThreadGroup. It implements core of JSC::MachineThreads with more reliable way.
JSC::MachineThreads was complicated because of managing dead threads. Each JSC::MachineThreads has its
own TLS with a registered destructor. And everytime a thread dies, the registered TLS destructor is called.
And this destructor will remove the current dying thread from JSC::MachineThreads.

However the above implementation is tricky. And each JSC::MachineThreads requires own TLS space, which is
not considered in WTF's Windows ThreadSpecific implementation. Current design works well since we only
have small number of MachineThreads right now.

Instead, we use more reliable way. After introducing WTF::Thread, WTF::Thread has WTF::Thread::didExit,
which is called when associated TLS (with WTF::Thread) is destroyed. We leverage this mechanism to remove
WTF::Thread from MachineThreads.

This patch introduces WTF::ThreadGroup. It is tightly integrated with WTF::Thread: WTF::Thread knows
ThreadGroups which includes this thread. And WTF::ThreadGroup of course knows WTF::Threads added to it.
WTF::Thread::didExit carefully remove itself from WTF::ThreadGroups.

The most important part of this patch is locking. WTF::Thread can die. And WTF::ThreadGroup can die.
If we take a design using two fine grain locks in WTF::Thread and WTF::ThreadGroup, we easily encounter
dead lock. Consider the following case.

  1. When adding WTF::Thread (TH) to WTF::ThreadGroup (THG), we first hold a lock of THG, and hold a lock of TH (locking order is THG -> TH).
  2. When TH dies, TH need to hold a lock of TH to iterate THGs. And we hold a lock of THG to unregister TH from it (locking order is TH -> THG).
  3. When suspending and resuming THs in THG, we first hold a lock of THG. And then, we hold a lock of TH to suspend and resume it (locking order is THG -> TH).
  4. When destroying THG, we need to hold a lock of TH to unregister THG from TH. We can hold a lock of THG before that (locking order is THG -> TH).

Then, it easily causes dead lock. We cannot swap the locking order of (2) since iterating THG requires a lock of TH.
To solve this problem, we use std::shared_ptr and std::weak_ptr.

  1. When adding WTF::Thread (TH) to WTF::ThreadGroup (THG), we first hold THG, and hold a lock of TH. (THG -> TH)
  2. When TH dies, TH first hold lock of TH. And we use std::weak_ptr<>::lock() to retain non-destructed ThreadGroups.

If some of ThreadGroups are dying, we just ignore them. It is ok because such a ThreadGroup will be destructed. So we do not need to unregister this thread from
such a ThreadGroup. Then, we have Vector<std::shared_ptr<ThreadGroup>>. So we unlock a lock of TH. To unregister a thread from thread group, we first hold a
lock of THG and then hold a lock of TH. Both lifetime is ensured: THG is retained by std::shared_ptr. And TH is itself. (TH), (THG -> TH).

  1. When suspending and resuming THs in THG, we first hold a lock of THG. And then, we hold a lock of TH to suspend and resume it (THG -> TH).
  2. When destroying THG, we hold a lock of THG. And hold a lock of TH. During holding THG's lock, registered thread never dies because (2) holds THG lock. (THG -> TH).

We also fix suspend and resume locking mechanism to avoid dead lock. We should hold the global lock when suspending and resuming.
If we use per-thread lock, the suspended thread can hold the lock of the other threads. It causes dead lock.

  • WTF.xcodeproj/project.pbxproj:
  • wtf/AutomaticThread.cpp:
  • wtf/CMakeLists.txt:
  • wtf/CrossThreadCopier.h:
  • wtf/ParkingLot.h:
  • wtf/ThreadGroup.cpp: Copied from Source/JavaScriptCore/wasm/WasmMachineThreads.cpp.

(WTF::ThreadGroup::~ThreadGroup):
(WTF::ThreadGroup::add):
(WTF::ThreadGroup::addCurrentThread):

  • wtf/ThreadGroup.h: Copied from Source/JavaScriptCore/wasm/WasmMachineThreads.cpp.

(WTF::ThreadGroup::create):
(WTF::ThreadGroup::threads):
(WTF::ThreadGroup::getLock):
(WTF::ThreadGroup::weakFromThis):

  • wtf/Threading.cpp:

(WTF::shouldRemoveThreadFromThreadGroup):
(WTF::Thread::didExit):
(WTF::Thread::addToThreadGroup):
(WTF::Thread::removeFromThreadGroup):

  • wtf/Threading.h:
  • wtf/ThreadingPthreads.cpp:

(WTF::Thread::resume):
(WTF::Thread::getRegisters):

  • wtf/ThreadingWin.cpp:

(WTF::Thread::resume):
(WTF::Thread::getRegisters):

Tools:

Add WTF::ThreadGroup tests.

  • TestWebKitAPI/CMakeLists.txt:
  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WTF/ThreadGroup.cpp: Added.

(TestWebKitAPI::testThreadGroup):
(TestWebKitAPI::TEST):

Note: See TracTimeline for information about the timeline view.