[webkit-changes] [210784] trunk/Websites/perf.webkit.org
Title: [210784] trunk/Websites/perf.webkit.org Revision 210784 Author rn...@webkit.org Date 2017-01-15 16:14:40 -0800 (Sun, 15 Jan 2017) Log Message Add the build fix for browsers that don't yet support custom elements SPI. It was supposedly to be a part of the previous commit. * public/v3/components/base.js: (ComponentBase.defineElement): Modified Paths trunk/Websites/perf.webkit.org/ChangeLog trunk/Websites/perf.webkit.org/public/v3/components/base.js Diff Modified: trunk/Websites/perf.webkit.org/ChangeLog (210783 => 210784) --- trunk/Websites/perf.webkit.org/ChangeLog 2017-01-16 00:12:22 UTC (rev 210783) +++ trunk/Websites/perf.webkit.org/ChangeLog 2017-01-16 00:14:40 UTC (rev 210784) @@ -1,3 +1,11 @@ +2017-01-15 Ryosuke Niwa+ +Add the build fix for browsers that don't yet support custom elements SPI. +It was supposedly to be a part of the previous commit. + +* public/v3/components/base.js: +(ComponentBase.defineElement): + 2017-01-12 Ryosuke Niwa Adopt custom elements API in perf dashboard Modified: trunk/Websites/perf.webkit.org/public/v3/components/base.js (210783 => 210784) --- trunk/Websites/perf.webkit.org/public/v3/components/base.js 2017-01-16 00:12:22 UTC (rev 210783) +++ trunk/Websites/perf.webkit.org/public/v3/components/base.js 2017-01-16 00:14:40 UTC (rev 210784) @@ -94,6 +94,9 @@ ComponentBase._componentByName.set(name, elementInterface); ComponentBase._componentByClass.set(elementInterface, name); +if (!window.customElements) +return; + class elementClass extends HTMLElement { constructor() { ___ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes
[webkit-changes] [210783] trunk/Websites/perf.webkit.org
Title: [210783] trunk/Websites/perf.webkit.org Revision 210783 Author rn...@webkit.org Date 2017-01-15 16:12:22 -0800 (Sun, 15 Jan 2017) Log Message Adopt custom elements API in perf dashboard https://bugs.webkit.org/show_bug.cgi?id=167045 Reviewed by Darin Adler. Adopt custom elements API in ComponentBase, and create the shadow tree lazily in content() and render() instead of eagerly creating it inside the constructor. For now, create a separate element class for each component in ComponentBase.defineElement instead of making ComponentBase inherit from HTMLElement to preserve the semantics we have as well as to test the boundaries of what custom elements API allows for framework authors. In order to ensure one-to-one correspondence between elements and their components, we use a static map, ComponentBase._currentlyConstructedByInterface, to remember which element or component is being created and use that in custom element's constructor to update element.component() and this._element. Also dropped the support for not having attachShadow as we've shipped this feature in Safari 10. Finally, added tests to be ran inside a browser to test the front end code in browser-tests. * browser-tests/component-base-tests.js: Added. Basic tests for ComponentBase. * browser-tests/index.html: Added. * public/v3/components/base.js: (ComponentBase): Don't create the shadow tree. Use the currently constructed element as this._element if there is one (the custom element's constructor is getting called). Otherwise create a new element but store this component in the map to avoid creating a new component in the custom element's constructor. (ComponentBase.prototype.content): Lazily create the shadow tree now. (ComponentBase.prototype.render): Ditto. (ComponentBase.prototype._ensureShadowTree): Renamed from _constructShadowTree. Dropped the support for not having shadow DOM API. This is now required. Also use importNode instead of cloneNode in cloning the template content since the latter would not get upgraded. (ComponentBase.prototype._recursivelyReplaceUnknownElementsByComponents): Modernized the code. Don't re-create a component if its element had already been upgraded by its custom element constructor. (ComponentBase.defineElement): Add this component to the static maps. _componentByName is used by _recursivelyReplaceUnknownElementsByComponents to instantiate new components in the browsers that don't support custom elements API and _componentByClass is used by ComponentBase's constructor to lookup the element name. The latter should go away once all components fully adopt ComponentBase.defineElement. (ComponentBase.defineElement.elementClass): A class to define a custom element for the component. We need to reconfigure the property since class's name is not writable but configurable. * public/v3/components/button-base.js: (ButtonBase.htmlTemplate): Added. Extracted the common code from CloseButton and WarningIcon. (ButtonBase.buttonContent): Added. An abstract method overridden by CloseButton and WarningIcon. (ButtonBase.sizeFactor): Added. Overridden by WarningIcon. (ButtonBase.cssTemplate): Updated to use :host. * public/v3/components/close-button.js: (CloseButton.buttonContent): Renamed from htmlTemplate. * public/v3/components/spinner-icon.js: (SpinnerIcon.cssTemplate): Removed webkit prefixed properties, and updated it to animate stroke instead of opacity to reduce the power usage. (SpinnerIcon.htmlTemplate): Factored stroke, stroke-width, and stroke-linecap into cssTemplate. * public/v3/components/warning-icon.js: (WarningIcon.cssTemplate): Deleted. (WarningIcon.sizeFactor): Added. (WarningIcon.buttonContent): Renamed from htmlTemplate. * public/v3/pages/summary-page.js: (SummaryPage._constructRatioGraph): Fixed a bug that we were not never calling spinner.updateRendering(). (SummaryPage.prototype._renderCell): Modified Paths trunk/Websites/perf.webkit.org/ChangeLog trunk/Websites/perf.webkit.org/public/v3/components/base.js trunk/Websites/perf.webkit.org/public/v3/components/button-base.js trunk/Websites/perf.webkit.org/public/v3/components/close-button.js trunk/Websites/perf.webkit.org/public/v3/components/spinner-icon.js trunk/Websites/perf.webkit.org/public/v3/components/warning-icon.js trunk/Websites/perf.webkit.org/public/v3/main.js trunk/Websites/perf.webkit.org/public/v3/pages/summary-page.js Added Paths trunk/Websites/perf.webkit.org/browser-tests/ trunk/Websites/perf.webkit.org/browser-tests/component-base-tests.js trunk/Websites/perf.webkit.org/browser-tests/index.html Diff Modified: trunk/Websites/perf.webkit.org/ChangeLog (210782 => 210783) --- trunk/Websites/perf.webkit.org/ChangeLog 2017-01-15 22:42:53 UTC (rev 210782) +++ trunk/Websites/perf.webkit.org/ChangeLog 2017-01-16 00:12:22 UTC (rev 210783) @@ -1,3 +1,65 @@ +2017-01-12 Ryosuke Niwa+ +Adopt custom elements API in perf dashboard +https://bugs.webkit.org/show_bug.cgi?id=167045 +
[webkit-changes] [210782] trunk/Tools
Title: [210782] trunk/Tools Revision 210782 Author mcatanz...@igalia.com Date 2017-01-15 14:42:53 -0800 (Sun, 15 Jan 2017) Log Message Unreviewed, remove stale comment. This test was fixed by r163173. * TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp: Modified Paths trunk/Tools/ChangeLog trunk/Tools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp Diff Modified: trunk/Tools/ChangeLog (210781 => 210782) --- trunk/Tools/ChangeLog 2017-01-15 21:01:26 UTC (rev 210781) +++ trunk/Tools/ChangeLog 2017-01-15 22:42:53 UTC (rev 210782) @@ -1,3 +1,11 @@ +2017-01-15 Michael Catanzaro+ +Unreviewed, remove stale comment. + +This test was fixed by r163173. + +* TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp: + 2017-01-14 Yusuke Suzuki Annotate large string tests with largeHeap Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp (210781 => 210782) --- trunk/Tools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp 2017-01-15 21:01:26 UTC (rev 210781) +++ trunk/Tools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp 2017-01-15 22:42:53 UTC (rev 210782) @@ -111,7 +111,6 @@ WKFramePolicyListenerUse(listener); } -// FIXME: http://webkit.org/b/127934 REGRESSION (r163037): WebKit2.PageLoadBasic API test failing on Mountain Lion TEST(WebKit2, PageLoadBasic) { State state; ___ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes
[webkit-changes] [210781] trunk/Source/WebCore
Title: [210781] trunk/Source/WebCore Revision 210781 Author mcatanz...@igalia.com Date 2017-01-15 13:01:26 -0800 (Sun, 15 Jan 2017) Log Message [SOUP] SoupNetworkSession constructor should be explicit https://bugs.webkit.org/show_bug.cgi?id=167069 Reviewed by Darin Adler. * platform/network/soup/SoupNetworkSession.h: Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.h Diff Modified: trunk/Source/WebCore/ChangeLog (210780 => 210781) --- trunk/Source/WebCore/ChangeLog 2017-01-15 20:05:20 UTC (rev 210780) +++ trunk/Source/WebCore/ChangeLog 2017-01-15 21:01:26 UTC (rev 210781) @@ -1,3 +1,12 @@ +2017-01-15 Michael Catanzaro+ +[SOUP] SoupNetworkSession constructor should be explicit +https://bugs.webkit.org/show_bug.cgi?id=167069 + +Reviewed by Darin Adler. + +* platform/network/soup/SoupNetworkSession.h: + 2017-01-15 Sam Weinig [WebIDL] Remove custom bindings for HTMLInputElement, HTMLFrameElement, HTMLMediaElement and HTMLOptionsCollection Modified: trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.h (210780 => 210781) --- trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.h 2017-01-15 20:05:20 UTC (rev 210780) +++ trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.h 2017-01-15 21:01:26 UTC (rev 210781) @@ -46,7 +46,7 @@ class SoupNetworkSession { WTF_MAKE_NONCOPYABLE(SoupNetworkSession); WTF_MAKE_FAST_ALLOCATED; public: -SoupNetworkSession(SoupCookieJar* = nullptr); +explicit SoupNetworkSession(SoupCookieJar* = nullptr); ~SoupNetworkSession(); SoupSession* soupSession() const { return m_soupSession.get(); } ___ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes
[webkit-changes] [210780] trunk
Title: [210780] trunk Revision 210780 Author commit-qu...@webkit.org Date 2017-01-15 12:05:20 -0800 (Sun, 15 Jan 2017) Log Message [WebIDL] Remove custom bindings for HTMLInputElement, HTMLFrameElement, HTMLMediaElement and HTMLOptionsCollection https://bugs.webkit.org/show_bug.cgi?id=167039 Patch by Sam Weinigon 2017-01-15 Reviewed by Darin Adler. Source/WebCore: * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: * bindings/js/JSHTMLFrameElementCustom.cpp: Removed. * bindings/js/JSHTMLInputElementCustom.cpp: Removed. * bindings/js/JSHTMLMediaElementCustom.cpp: Removed. Remove files. * html/HTMLOptionsCollection.idl: * bindings/js/JSHTMLOptionsCollectionCustom.cpp: (WebCore::JSHTMLOptionsCollection::setLength): Deleted. Remove custom setLength. The bindings generator can handle this now. * html/HTMLFrameElement.idl: Resort to match spec. Replace custom annotation for location with SetterCallWith=ScriptState. * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::setLocation): * html/HTMLFrameElementBase.h: Add implementation of setLocation. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::selectionStartForBindings): (WebCore::HTMLInputElement::setSelectionStartForBindings): (WebCore::HTMLInputElement::selectionEndForBindings): (WebCore::HTMLInputElement::setSelectionEndForBindings): (WebCore::HTMLInputElement::selectionDirectionForBindings): (WebCore::HTMLInputElement::setSelectionDirectionForBindings): (WebCore::HTMLInputElement::setSelectionRangeForBindings): * html/HTMLInputElement.h: * html/HTMLInputElement.idl: Add variants of the selection properties that throw using the 'forBindings' suffix to differentiate. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::setControllerForBindings): * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::controllerForBindings): * html/HTMLMediaElement.idl: Add a variant of the controller property that unsets the media group, using the 'forBindings' suffix to differentiate. * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::setLength): Match other implementations by ignoring attempts to set large lengths (> 1) rather than clamping. LayoutTests: * fast/dom/HTMLSelectElement/select-selectedIndex-expected.txt: * fast/dom/HTMLSelectElement/select-selectedIndex-multiple-expected.txt: * fast/dom/HTMLSelectElement/select-selectedIndex-multiple.html: * fast/dom/HTMLSelectElement/select-selectedIndex.html: Update tests / results now that negative lengths don't throw, but do log due to be converted to a large number. * fast/forms/select-max-length-expected.txt: Update result now that a large length is not clamped, but rather, ignored. Modified Paths trunk/LayoutTests/ChangeLog trunk/LayoutTests/fast/dom/HTMLSelectElement/select-selectedIndex-expected.txt trunk/LayoutTests/fast/dom/HTMLSelectElement/select-selectedIndex-multiple-expected.txt trunk/LayoutTests/fast/dom/HTMLSelectElement/select-selectedIndex-multiple.html trunk/LayoutTests/fast/dom/HTMLSelectElement/select-selectedIndex.html trunk/LayoutTests/fast/forms/select-max-length-expected.txt trunk/LayoutTests/inspector/model/remote-object-get-properties-expected.txt trunk/Source/WebCore/CMakeLists.txt trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp trunk/Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp trunk/Source/WebCore/html/HTMLFrameElement.idl trunk/Source/WebCore/html/HTMLFrameElementBase.cpp trunk/Source/WebCore/html/HTMLFrameElementBase.h trunk/Source/WebCore/html/HTMLInputElement.cpp trunk/Source/WebCore/html/HTMLInputElement.h trunk/Source/WebCore/html/HTMLInputElement.idl trunk/Source/WebCore/html/HTMLMediaElement.cpp trunk/Source/WebCore/html/HTMLMediaElement.h trunk/Source/WebCore/html/HTMLMediaElement.idl trunk/Source/WebCore/html/HTMLOptionsCollection.idl trunk/Source/WebCore/html/HTMLSelectElement.cpp Removed Paths trunk/Source/WebCore/bindings/js/JSHTMLFrameElementCustom.cpp trunk/Source/WebCore/bindings/js/JSHTMLInputElementCustom.cpp trunk/Source/WebCore/bindings/js/JSHTMLMediaElementCustom.cpp Diff Modified: trunk/LayoutTests/ChangeLog (210779 => 210780) --- trunk/LayoutTests/ChangeLog 2017-01-15 19:39:39 UTC (rev 210779) +++ trunk/LayoutTests/ChangeLog 2017-01-15 20:05:20 UTC (rev 210780) @@ -1,3 +1,20 @@ +2017-01-15 Sam Weinig + +[WebIDL] Remove custom bindings for HTMLInputElement, HTMLFrameElement, HTMLMediaElement and HTMLOptionsCollection +https://bugs.webkit.org/show_bug.cgi?id=167039 + +Reviewed by Darin Adler. + +* fast/dom/HTMLSelectElement/select-selectedIndex-expected.txt: +* fast/dom/HTMLSelectElement/select-selectedIndex-multiple-expected.txt: +* fast/dom/HTMLSelectElement/select-selectedIndex-multiple.html: +* fast/dom/HTMLSelectElement/select-selectedIndex.html: +Update
[webkit-changes] [210779] trunk/Source
Title: [210779] trunk/Source Revision 210779 Author timothy_hor...@apple.com Date 2017-01-15 11:39:39 -0800 (Sun, 15 Jan 2017) Log Message De-duplicate more (nearly) identical code in Editor(Mac|IOS).mm https://bugs.webkit.org/show_bug.cgi?id=167063 Reviewed by Dan Bernstein. Source/WebCore: No new tests, just refactoring. * editing/Editor.h: Adjust to fontAttributesForSelectionStart returning a RetainPtr. * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle): Make use of more Obj-C literals (for NSNumber). (WebCore::Editor::fontAttributesForSelectionStart): Merge this from EditorMac and EditorIOS. There are a number of attributes that are currently only extracted on Mac, and it's not clear why (and probably should be shared). (WebCore::Editor::stringSelectionForPasteboard): (WebCore::Editor::stringSelectionForPasteboardWithImageAltText): Merge these functions from EditorMac and EditorIOS. The iOS implementation was missing a reasonable bug fix from r161925. (WebCore::Editor::createFragmentAndAddResources): Merge this from EditorMac and EditorIOS. The Mac implementation was missing a reasonable bug fix from r203482. * editing/ios/EditorIOS.mm: (WebCore::Editor::fontAttributesForSelectionStart): Deleted. (WebCore::Editor::stringSelectionForPasteboardWithImageAltText): Deleted. (WebCore::Editor::createFragmentAndAddResources): Deleted. * editing/mac/EditorMac.mm: (WebCore::Editor::fontAttributesForSelectionStart): Deleted. (WebCore::Editor::stringSelectionForPasteboard): Deleted. (WebCore::Editor::stringSelectionForPasteboardWithImageAltText): Deleted. (WebCore::Editor::createFragmentAndAddResources): Deleted. Source/WebKit/mac: * WebView/WebHTMLView.mm: (-[WebHTMLView _selectionStartFontAttributesAsRTF]): (-[WebHTMLView _updateFontPanel]): * WebView/WebView.mm: (-[WebView typingAttributes]): Adjust to fontAttributesForSelectionStart returning a RetainPtr. Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/editing/Editor.h trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm trunk/Source/WebCore/editing/ios/EditorIOS.mm trunk/Source/WebCore/editing/mac/EditorMac.mm trunk/Source/WebKit/mac/ChangeLog trunk/Source/WebKit/mac/WebView/WebHTMLView.mm trunk/Source/WebKit/mac/WebView/WebView.mm Diff Modified: trunk/Source/WebCore/ChangeLog (210778 => 210779) --- trunk/Source/WebCore/ChangeLog 2017-01-15 17:47:00 UTC (rev 210778) +++ trunk/Source/WebCore/ChangeLog 2017-01-15 19:39:39 UTC (rev 210779) @@ -1,3 +1,43 @@ +2017-01-15 Tim Horton+ +De-duplicate more (nearly) identical code in Editor(Mac|IOS).mm +https://bugs.webkit.org/show_bug.cgi?id=167063 + +Reviewed by Dan Bernstein. + +No new tests, just refactoring. + +* editing/Editor.h: +Adjust to fontAttributesForSelectionStart returning a RetainPtr. + +* editing/cocoa/EditorCocoa.mm: +(WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle): +Make use of more Obj-C literals (for NSNumber). + +(WebCore::Editor::fontAttributesForSelectionStart): +Merge this from EditorMac and EditorIOS. There are a number of attributes +that are currently only extracted on Mac, and it's not clear why (and +probably should be shared). + +(WebCore::Editor::stringSelectionForPasteboard): +(WebCore::Editor::stringSelectionForPasteboardWithImageAltText): +Merge these functions from EditorMac and EditorIOS. The iOS implementation +was missing a reasonable bug fix from r161925. + +(WebCore::Editor::createFragmentAndAddResources): +Merge this from EditorMac and EditorIOS. The Mac implementation was missing +a reasonable bug fix from r203482. + +* editing/ios/EditorIOS.mm: +(WebCore::Editor::fontAttributesForSelectionStart): Deleted. +(WebCore::Editor::stringSelectionForPasteboardWithImageAltText): Deleted. +(WebCore::Editor::createFragmentAndAddResources): Deleted. +* editing/mac/EditorMac.mm: +(WebCore::Editor::fontAttributesForSelectionStart): Deleted. +(WebCore::Editor::stringSelectionForPasteboard): Deleted. +(WebCore::Editor::stringSelectionForPasteboardWithImageAltText): Deleted. +(WebCore::Editor::createFragmentAndAddResources): Deleted. + 2017-01-15 Myles C. Maxfield [Cocoa] Unify FontPlatformData's hashing and equality operators Modified: trunk/Source/WebCore/editing/Editor.h (210778 => 210779) --- trunk/Source/WebCore/editing/Editor.h 2017-01-15 17:47:00 UTC (rev 210778) +++ trunk/Source/WebCore/editing/Editor.h 2017-01-15 19:39:39 UTC (rev 210779) @@ -448,7 +448,7 @@ #if PLATFORM(COCOA) void getTextDecorationAttributesRespectingTypingStyle(const RenderStyle&, NSMutableDictionary*) const; -WEBCORE_EXPORT NSDictionary *fontAttributesForSelectionStart() const; +
[webkit-changes] [210778] trunk/Source/WebCore
Title: [210778] trunk/Source/WebCore Revision 210778 Author mmaxfi...@apple.com Date 2017-01-15 09:47:00 -0800 (Sun, 15 Jan 2017) Log Message [Cocoa] Unify FontPlatformData's hashing and equality operators https://bugs.webkit.org/show_bug.cgi?id=167061 Reviewed by Darin Adler. On iOS, we were using CFEqual() and CFHash(), while on macOS we were using pointer hashing and pointer equality. Instead, we should be consistent about these operators. Right now, FontPlatformData holds two internal CTFontRefs, and switching to these higher-level CFEqual() and CFHash() functions is required for eliminating one of these two internal font objects. No new tests because there is no behavior change. * platform/graphics/FontPlatformData.h: (WebCore::FontPlatformData::hash): Deleted. * platform/graphics/cocoa/FontPlatformDataCocoa.mm: (WebCore::FontPlatformData::hash): (WebCore::FontPlatformData::platformIsEqual): (WebCore::cascadeToLastResortAttributesDictionary): * platform/graphics/freetype/FontPlatformDataFreeType.cpp: (WebCore::FontPlatformData::hash): * platform/graphics/win/FontPlatformDataCGWin.cpp: (WebCore::FontPlatformData::hash): * platform/graphics/win/FontPlatformDataCairoWin.cpp: (WebCore::FontPlatformData::hash): * platform/graphics/win/FontPlatformDataDirect2D.cpp: (WebCore::FontPlatformData::hash): Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/platform/graphics/FontPlatformData.h trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm trunk/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp trunk/Source/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp trunk/Source/WebCore/platform/graphics/win/FontPlatformDataCairoWin.cpp trunk/Source/WebCore/platform/graphics/win/FontPlatformDataDirect2D.cpp Diff Modified: trunk/Source/WebCore/ChangeLog (210777 => 210778) --- trunk/Source/WebCore/ChangeLog 2017-01-15 10:48:04 UTC (rev 210777) +++ trunk/Source/WebCore/ChangeLog 2017-01-15 17:47:00 UTC (rev 210778) @@ -1,3 +1,36 @@ +2017-01-15 Myles C. Maxfield+ +[Cocoa] Unify FontPlatformData's hashing and equality operators +https://bugs.webkit.org/show_bug.cgi?id=167061 + +Reviewed by Darin Adler. + +On iOS, we were using CFEqual() and CFHash(), while on macOS +we were using pointer hashing and pointer equality. Instead, +we should be consistent about these operators. + +Right now, FontPlatformData holds two internal CTFontRefs, and +switching to these higher-level CFEqual() and CFHash() +functions is required for eliminating one of these two +internal font objects. + +No new tests because there is no behavior change. + +* platform/graphics/FontPlatformData.h: +(WebCore::FontPlatformData::hash): Deleted. +* platform/graphics/cocoa/FontPlatformDataCocoa.mm: +(WebCore::FontPlatformData::hash): +(WebCore::FontPlatformData::platformIsEqual): +(WebCore::cascadeToLastResortAttributesDictionary): +* platform/graphics/freetype/FontPlatformDataFreeType.cpp: +(WebCore::FontPlatformData::hash): +* platform/graphics/win/FontPlatformDataCGWin.cpp: +(WebCore::FontPlatformData::hash): +* platform/graphics/win/FontPlatformDataCairoWin.cpp: +(WebCore::FontPlatformData::hash): +* platform/graphics/win/FontPlatformDataDirect2D.cpp: +(WebCore::FontPlatformData::hash): + 2017-01-15 Andreas Kling FrameView shouldn't keep dangling pointers into dead render trees. Modified: trunk/Source/WebCore/platform/graphics/FontPlatformData.h (210777 => 210778) --- trunk/Source/WebCore/platform/graphics/FontPlatformData.h 2017-01-15 10:48:04 UTC (rev 210777) +++ trunk/Source/WebCore/platform/graphics/FontPlatformData.h 2017-01-15 17:47:00 UTC (rev 210778) @@ -172,25 +172,7 @@ FcFontSet* fallbacks() const; #endif -unsigned hash() const -{ -#if USE(CAIRO) -return PtrHash ::hash(m_scaledFont.get()); -#elif PLATFORM(WIN) -return m_font ? m_font->hash() : 0; -#elif PLATFORM(COCOA) -uintptr_t flags = static_cast(m_isHashTableDeletedValue << 5 | m_textRenderingMode << 3 | m_orientation << 2 | m_syntheticBold << 1 | m_syntheticOblique); -#if USE(APPKIT) -uintptr_t fontHash = (uintptr_t)m_font.get(); -#else -uintptr_t fontHash = reinterpret_cast(CFHash(m_font.get())); -#endif -uintptr_t hashCodes[3] = { fontHash, m_widthVariant, flags }; -return StringHasher::hashMemory (hashCodes); -#else -#error "Unsupported configuration" -#endif -} +unsigned hash() const; bool operator==(const FontPlatformData& other) const { Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm (210777 => 210778) --- trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm 2017-01-15
[webkit-changes] [210777] trunk/Source/WebCore
Title: [210777] trunk/Source/WebCore Revision 210777 Author akl...@apple.com Date 2017-01-15 02:48:04 -0800 (Sun, 15 Jan 2017) Log Message FrameView shouldn't keep dangling pointers into dead render trees. Reviewed by Antti Koivisto. Added some pretty paranoid assertions to FrameView that verify all of its raw pointers into the render tree are gone after the render tree has been destroyed. They immediately caught two bugs, also fixed in this patch. * page/FrameView.h: * page/FrameView.cpp: (WebCore::FrameView::willDestroyRenderTree): (WebCore::FrameView::didDestroyRenderTree): Added these two callbacks for before/after Document tears down its render tree. The former clears the layout root, and detaches custom scrollbars. The latter contains a bunch of sanity assertions that pointers into the now-destroyed render tree are gone. * dom/Document.cpp: (WebCore::Document::destroyRenderTree): Notify FrameView before/after teardown. * page/animation/AnimationController.h: * page/animation/AnimationController.cpp: (WebCore::AnimationController::hasAnimations): Added a helper to check if there are any composite animations around, as these contain raw pointers to renderers. * rendering/RenderElement.cpp: (WebCore::RenderElement::willBeRemovedFromTree): (WebCore::RenderElement::willBeDestroyed): Moved slow repaint object unregistration from willBeRemovedFromTree() to willBeDestroyed(). The willBeRemovedFromTree() callback is skipped as an optimization during full tree teardown, but willBeDestroyed() always gets called. This fixes a bug where we'd fail to remove dangling pointers. Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/dom/Document.cpp trunk/Source/WebCore/page/FrameView.cpp trunk/Source/WebCore/page/FrameView.h trunk/Source/WebCore/page/animation/AnimationController.cpp trunk/Source/WebCore/page/animation/AnimationController.h trunk/Source/WebCore/rendering/RenderElement.cpp Diff Modified: trunk/Source/WebCore/ChangeLog (210776 => 210777) --- trunk/Source/WebCore/ChangeLog 2017-01-15 08:23:31 UTC (rev 210776) +++ trunk/Source/WebCore/ChangeLog 2017-01-15 10:48:04 UTC (rev 210777) @@ -1,3 +1,37 @@ +2017-01-15 Andreas Kling+ +FrameView shouldn't keep dangling pointers into dead render trees. + + +Reviewed by Antti Koivisto. + +Added some pretty paranoid assertions to FrameView that verify all of its raw pointers +into the render tree are gone after the render tree has been destroyed. +They immediately caught two bugs, also fixed in this patch. + +* page/FrameView.h: +* page/FrameView.cpp: +(WebCore::FrameView::willDestroyRenderTree): +(WebCore::FrameView::didDestroyRenderTree): Added these two callbacks for before/after +Document tears down its render tree. The former clears the layout root, and detaches +custom scrollbars. The latter contains a bunch of sanity assertions that pointers into +the now-destroyed render tree are gone. + +* dom/Document.cpp: +(WebCore::Document::destroyRenderTree): Notify FrameView before/after teardown. + +* page/animation/AnimationController.h: +* page/animation/AnimationController.cpp: +(WebCore::AnimationController::hasAnimations): Added a helper to check if there are +any composite animations around, as these contain raw pointers to renderers. + +* rendering/RenderElement.cpp: +(WebCore::RenderElement::willBeRemovedFromTree): +(WebCore::RenderElement::willBeDestroyed): Moved slow repaint object unregistration +from willBeRemovedFromTree() to willBeDestroyed(). The willBeRemovedFromTree() callback +is skipped as an optimization during full tree teardown, but willBeDestroyed() always +gets called. This fixes a bug where we'd fail to remove dangling pointers. + 2017-01-15 Myles C. Maxfield [Cocoa] Unify font fallback between macOS and iOS for when the font-family list is exhausted Modified: trunk/Source/WebCore/dom/Document.cpp (210776 => 210777) --- trunk/Source/WebCore/dom/Document.cpp 2017-01-15 08:23:31 UTC (rev 210776) +++ trunk/Source/WebCore/dom/Document.cpp 2017-01-15 10:48:04 UTC (rev 210777) @@ -2199,8 +2199,11 @@ { ASSERT(hasLivingRenderTree()); ASSERT(frame()); +ASSERT(frame()->view()); ASSERT(page()); +FrameView& frameView = *frame()->view(); + // Prevent Widget tree changes from committing until the RenderView is dead and gone. WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates; @@ -2211,8 +2214,7 @@ documentWillBecomeInactive(); -if (FrameView* frameView = view()) -frameView->detachCustomScrollbars(); +frameView.willDestroyRenderTree(); #if ENABLE(FULLSCREEN_API) if (m_fullScreenRenderer) @@ -2238,6 +2240,8 @@ // Do this before the arena is cleared, which is needed to deref
[webkit-changes] [210776] trunk/Source/WebCore
Title: [210776] trunk/Source/WebCore Revision 210776 Author mmaxfi...@apple.com Date 2017-01-15 00:23:31 -0800 (Sun, 15 Jan 2017) Log Message [Cocoa] Unify font fallback between macOS and iOS for when the font-family list is exhausted https://bugs.webkit.org/show_bug.cgi?id=167056 Reviewed by Darin Adler. When performing font fallback, each item in the font-family list is examined. If no appropriate fonts are found, WebKit asks the system for an appropriate font. As of a few years ago, both macOS and iOS used platform calls to produce a font; however, each platform used a different platform call. This patch migrates both platforms to use a shared function which uses only one of the platform calls (which means the other platform call is never used). There are still some behavior differences between macOS and iOS (which are now hidden behind a PLATFORM() guard), but I'd like to minimize and eliminate these in the future. Using a shared function is a step toward this goal. No new tests because there is no behavior change. * platform/graphics/FontCache.h: * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::lookupFallbackFont): (WebCore::FontCache::systemFallbackForCharacters): * platform/graphics/ios/FontCacheIOS.mm: (WebCore::getSystemFontFallbackForCharacters): Deleted. (WebCore::platformLookupFallbackFont): Deleted. * platform/graphics/mac/FontCacheMac.mm: (WebCore::platformLookupFallbackFont): Deleted. Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/platform/graphics/FontCache.h trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm Diff Modified: trunk/Source/WebCore/ChangeLog (210775 => 210776) --- trunk/Source/WebCore/ChangeLog 2017-01-15 07:22:19 UTC (rev 210775) +++ trunk/Source/WebCore/ChangeLog 2017-01-15 08:23:31 UTC (rev 210776) @@ -1,3 +1,33 @@ +2017-01-15 Myles C. Maxfield+ +[Cocoa] Unify font fallback between macOS and iOS for when the font-family list is exhausted +https://bugs.webkit.org/show_bug.cgi?id=167056 + +Reviewed by Darin Adler. + +When performing font fallback, each item in the font-family list is examined. +If no appropriate fonts are found, WebKit asks the system for an appropriate +font. As of a few years ago, both macOS and iOS used platform calls to +produce a font; however, each platform used a different platform call. This +patch migrates both platforms to use a shared function which uses only +one of the platform calls (which means the other platform call is never used). + +There are still some behavior differences between macOS and iOS (which are now +hidden behind a PLATFORM() guard), but I'd like to minimize and eliminate these +in the future. Using a shared function is a step toward this goal. + +No new tests because there is no behavior change. + +* platform/graphics/FontCache.h: +* platform/graphics/cocoa/FontCacheCoreText.cpp: +(WebCore::lookupFallbackFont): +(WebCore::FontCache::systemFallbackForCharacters): +* platform/graphics/ios/FontCacheIOS.mm: +(WebCore::getSystemFontFallbackForCharacters): Deleted. +(WebCore::platformLookupFallbackFont): Deleted. +* platform/graphics/mac/FontCacheMac.mm: +(WebCore::platformLookupFallbackFont): Deleted. + 2017-01-14 Chris Dumez Report CPU usage of tabs after they become non-visible using diagnostic logging Modified: trunk/Source/WebCore/platform/graphics/FontCache.h (210775 => 210776) --- trunk/Source/WebCore/platform/graphics/FontCache.h 2017-01-15 07:22:19 UTC (rev 210775) +++ trunk/Source/WebCore/platform/graphics/FontCache.h 2017-01-15 08:23:31 UTC (rev 210776) @@ -276,7 +276,6 @@ SynthesisPair computeNecessarySynthesis(CTFontRef, const FontDescription&, bool isPlatformFont = false); RetainPtr platformFontWithFamilySpecialCase(const AtomicString& family, FontWeight, CTFontSymbolicTraits, float size); RetainPtr platformFontWithFamily(const AtomicString& family, CTFontSymbolicTraits, FontWeight, TextRenderingMode, float size); -RetainPtr platformLookupFallbackFont(CTFontRef, FontWeight, const AtomicString& locale, const UChar* characters, unsigned length); bool requiresCustomFallbackFont(UChar32 character); #else Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (210775 => 210776) --- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp 2017-01-15 07:22:19 UTC (rev 210775) +++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp 2017-01-15 08:23:31 UTC (rev 210776) @@ -39,11 +39,11 @@ static inline void appendRawTrueTypeFeature(CFMutableArrayRef features, int type, int selector) { -RetainPtr typeNumber =