Timeline
May 8, 2016:
- 10:51 PM Changeset in webkit [200569] by
-
- 3 edits in trunk/Source/WebCore
RenderMathMLOperator: refactor management of stretchy data and italic correction
https://bugs.webkit.org/show_bug.cgi?id=156913
Patch by Frederic Wang <fwang@igalia.com> on 2016-05-08
Reviewed by Darin Adler.
No new tests, behavior is not changed.
The stretchy data uses a shared space to describe horizontal / vertical directions and
unstretched / size variant / glyph assembly. We use a simple struct with some unions to
represent it instead of the current implementation with a class.
We also modify the signature of some functions to retrieve display operator and stretchy
data to use that new structure and prepare the move to a separate MathOperator class.
Finally, we introduce some helper functions to easily set the stretchy data.
- rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Use the new data members and
function signatures.
(WebCore::RenderMathMLOperator::setSizeVariant): New helper function to set a size variant.
(WebCore::RenderMathMLOperator::setGlyphAssembly): New helper function to set a glyph
assembly.
(WebCore::RenderMathMLOperator::getGlyphAssemblyFallBack): We change the signature to use a
GlyphAssemblyData.
(WebCore::RenderMathMLOperator::findDisplayStyleLargeOperator): We rename the function and
change its signature to remove the return value. We now also set the italic correction when
a display operator is found.
(WebCore::RenderMathMLOperator::findStretchyData): We change the signature to introduce a
target size and remove the return value. This also does the early return when the base glyph
is large enough.
(WebCore::RenderMathMLOperator::updateStyle): We use the new data members and function
signatures. The check for the base glyph size is now done in findStretchyData, so we just
check whether m_stretchType is Unstretched to do an early return.
(WebCore::RenderMathMLOperator::firstLineBaseline): We use m_stretchType.
(WebCore::RenderMathMLOperator::computeLogicalHeight): Ditto.
(WebCore::RenderMathMLOperator::fillWithVerticalExtensionGlyph): Use the new class members.
(WebCore::RenderMathMLOperator::fillWithHorizontalExtensionGlyph): Ditto.
(WebCore::RenderMathMLOperator::paint): Ditto.
(WebCore::RenderMathMLOperator::paintVerticalGlyphAssembly): Ditto.
(WebCore::RenderMathMLOperator::paintHorizontalGlyphAssembly): Ditto.
(WebCore::RenderMathMLOperator::paintChildren): Ditto.
(WebCore::RenderMathMLOperator::trailingSpaceError): Ditto.
(WebCore::RenderMathMLOperator::italicCorrection): Moved to RenderMathMLOperator.h.
(WebCore::RenderMathMLOperator::getDisplayStyleLargeOperator): Deleted.
- rendering/mathml/RenderMathMLOperator.h:
(WebCore::RenderMathMLOperator::italicCorrection): We just return m_italicCorrection.
(WebCore::RenderMathMLOperator::GlyphAssemblyData::GlyphAssemblyData): New class to store an
assembly of GlyphData.
(WebCore::RenderMathMLOperator::StretchyData::mode): Deleted.
(WebCore::RenderMathMLOperator::StretchyData::variant): Deleted.
(WebCore::RenderMathMLOperator::StretchyData::top): Deleted.
(WebCore::RenderMathMLOperator::StretchyData::extension): Deleted.
(WebCore::RenderMathMLOperator::StretchyData::bottom): Deleted.
(WebCore::RenderMathMLOperator::StretchyData::middle): Deleted.
(WebCore::RenderMathMLOperator::StretchyData::left): Deleted.
(WebCore::RenderMathMLOperator::StretchyData::right): Deleted.
(WebCore::RenderMathMLOperator::StretchyData::setNormalMode): Deleted.
(WebCore::RenderMathMLOperator::StretchyData::setSizeVariantMode): Deleted.
(WebCore::RenderMathMLOperator::StretchyData::setGlyphAssemblyMode): Deleted.
(WebCore::RenderMathMLOperator::StretchyData::StretchyData): Deleted.
- 10:51 PM MathML/Early_2016_Refactoring edited by
- (diff)
- 9:55 PM Changeset in webkit [200568] by
-
- 9 edits2 deletes in trunk/Source
[COCOA] Disable HAVE_DTRACE at build time
https://bugs.webkit.org/show_bug.cgi?id=157433
<rdar://problem/26148841>
Reviewed by Mark Lam.
Source/JavaScriptCore:
Drop DTRACE-related code from JSC since it is very old and seems
unused.
- JavaScriptCore.xcodeproj/project.pbxproj:
- PlatformMac.cmake:
- heap/Heap.cpp:
(JSC::Heap::collectImpl): Deleted.
(JSC::Heap::didFinishCollection): Deleted.
- profiler/ProfileGenerator.cpp:
(JSC::ProfileGenerator::willExecute): Deleted.
(JSC::ProfileGenerator::didExecute): Deleted.
- runtime/Tracing.d: Removed.
- runtime/Tracing.h: Removed.
Source/WTF:
Disable HAVE_DTRACE on COCOA since it is mostly unused and has a performance
impact, at least on iOS.
- wtf/Platform.h:
- 7:37 PM Changeset in webkit [200567] by
-
- 3 edits2 adds in trunk
iOS selection: Use inflow containing block for positioned <br>.
https://bugs.webkit.org/show_bug.cgi?id=157115
<rdar://problem/25969295>
Reviewed by Ryosuke Niwa.
Similarly to RenderText, we should just use the inflow containing block for
selected <br> even when it is positioned out of flow. This visually matches Mac OS X
behaviour (selection painting does not get extended to the positioned <br>).
Source/WebCore:
Test: fast/text/fixed-positioned-br-crash.html
- rendering/RenderLineBreak.cpp:
(WebCore::RenderLineBreak::collectSelectionRects):
LayoutTests:
- fast/text/fixed-positioned-br-crash-expected.txt: Added.
- fast/text/fixed-positioned-br-crash.html: Added.
- 4:57 PM Changeset in webkit [200566] by
-
- 4 edits in trunk/Source/WebInspectorUI
Web Inspector: Add Breakpoints and Scripts folders to Debugger sidebar
https://bugs.webkit.org/show_bug.cgi?id=151119
<rdar://problem/23488916>
Reviewed by Timothy Hatcher.
Add a collapsible Sources section to the Debugger beneath the existing
Breakpoints section.
- UserInterface/Views/DebuggerSidebarPanel.css:
Remove unused CSS class names.
(.sidebar > .panel.navigation.debugger .details-section.scripts:not(.collapsed)):
Hide scripts section bottom border when expanded. As the last
section, a border only adds visual clutter.
(.sidebar > .panel.navigation.debugger .details-section.scripts): Deleted.
(.sidebar > .panel.navigation.debugger.paused .details-section.scripts): Deleted.
(.sidebar > .panel.navigation.debugger .details-section.scripts .header): Deleted.
(.sidebar > .panel.navigation.debugger.paused .details-section.scripts .header): Deleted.
(.sidebar > .panel.navigation.debugger .details-section.scripts.collapsed > .content): Deleted.
(.sidebar > .panel.navigation.debugger.paused .details-section.scripts.collapsed > .content): Deleted.
No longer needed.
- UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel):
Create separate "Breakpoints" and "Sources" sections, and make filter
placeholder text generic. Remove unused class from breakpoints tree.
(WebInspector.DebuggerSidebarPanel.prototype.treeElementForRepresentedObject):
Check both breakpoint and scripts tree outlines.
(WebInspector.DebuggerSidebarPanel.prototype._addBreakpoint):
(WebInspector.DebuggerSidebarPanel.prototype._addTreeElementForSourceCodeToTreeOutline):
Make helper function generic.
(WebInspector.DebuggerSidebarPanel.prototype._addResource):
(WebInspector.DebuggerSidebarPanel.prototype._mainResourceDidChange):
(WebInspector.DebuggerSidebarPanel.prototype._addScript):
Add resources to the scripts tree.
(WebInspector.DebuggerSidebarPanel.prototype._scriptsCleared):
Clear the scripts tree.
(WebInspector.DebuggerSidebarPanel.prototype._removeDebuggerTreeElement):
Remove script element when last breakpoint is removed.
(WebInspector.DebuggerSidebarPanel.prototype._addIssue):
(WebInspector.DebuggerSidebarPanel.prototype._addTreeElementForSourceCodeToContentTreeOutline): Deleted.
Renamed _addTreeElementForSourceCodeToTreeOutline.
- 4:55 PM Changeset in webkit [200565] by
-
- 2 edits in trunk/Source/WebInspectorUI
Web Inspector: SourceCodeTextEditor issue widgets/line styles should reset when log is cleared
https://bugs.webkit.org/show_bug.cgi?id=157460
<rdar://problem/26159633>
Reviewed by Timothy Hatcher.
- UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor):
(WebInspector.SourceCodeTextEditor.prototype._logCleared):
Clear issue widgets and CodeMirror line class names when log cleared.
- 4:03 PM Changeset in webkit [200564] by
-
- 2 edits in trunk/Source/WebCore
[iOS] Build fix after r200563
Unreviewed.
- editing/cocoa/HTMLConverter.mm:
(_font):
- 3:54 PM Changeset in webkit [200563] by
-
- 16 edits in trunk/Source
[OS X] Migrate our Font classes entirely off of NSFont
https://bugs.webkit.org/show_bug.cgi?id=157464
Reviewed by Darin Adler.
Source/WebCore:
Because NSFont and CTFont are toll-free-bridged, we don't need NSFont at all anywhere.
No new tests because there is no behavior change.
- accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute):
(textMarkerRangeFromRange):
(visiblePositionForStartOfTextMarkerRange):
(visiblePositionForEndOfTextMarkerRange):
(AXAttributedStringRangeIsValid):
(AXAttributeStringSetFont):
(CreateCGColorIfDifferent):
(AXAttributeStringSetStyle):
(textMarkerRangeFromVisiblePositions):
- bindings/objc/DOM.mm:
(-[DOMElement _font]):
- bindings/objc/DOMPrivate.h:
- editing/cocoa/HTMLConverter.mm:
(_font):
(WebCore::editingAttributedStringFromRange):
- editing/mac/EditorMac.mm:
(WebCore::Editor::fontAttributesForSelectionStart):
- platform/graphics/Font.h:
(WebCore::Font::getCTFont):
(WebCore::Font::getNSFont): Deleted.
- platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::nsFont): Deleted.
- platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::determinePitch):
(WebCore::advanceForColorBitmapFont):
(WebCore::Font::platformWidthForGlyph):
(WebCore::renderingStyle): Deleted.
- platform/graphics/cocoa/FontPlatformDataCocoa.mm:
Source/WebKit/mac:
- WebCoreSupport/PopupMenuMac.mm:
(PopupMenuMac::populate):
(PopupMenuMac::show):
- WebView/WebHTMLView.mm:
(fontNameForDescription):
(-[WebHTMLView _addToStyle:fontA:fontB:]):
Source/WebKit2:
- WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
(WebKit::WebPopupMenu::setUpPlatformData):
- WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::fontAtSelection):
- 2:56 PM Changeset in webkit [200562] by
-
- 8 edits in trunk/Source
[Bindings] Simplify [RequiresExistingAtomicString] IDL extended attribute handling
https://bugs.webkit.org/show_bug.cgi?id=157465
Reviewed by Darin Adler.
Source/WebCore:
Simplify [RequiresExistingAtomicString] IDL extended attribute handling
in the bindings generator.
- bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheck):
Drop code specific to [RequiresExistingAtomicString].
(JSValueToNative):
Deal with [RequiresExistingAtomicString] IDL extended attribute,
similarly to [AtomicString] and [TreatNullAs].
- bindings/scripts/test/JS/JSTestObj.cpp:
- bindings/scripts/test/TestObj.idl:
Add bindings test coverage.
- dom/DocumentFragment.cpp:
(WebCore::DocumentFragment::getElementById):
- svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::getElementById):
Add null check for the id parameter. The generated bindings used to do
this null check for us but it is no longer the case (to make the bindings
generator a bit simpler). This extended attribute is not commonly used
and is meant as a micro-optimization for getElementById().
Source/WTF:
Add an AtomicString(RefPtr<AtomicStringImpl>&&) constructor that is now
used by the bindings when [RequiresExistingAtomicString] is used. This
is more efficient than using AtomicString(AtomicStringImpl*) as the
caller has a RefPtr<AtomicStringImpl> and is consistent with the
pre-existing String(RefPtr<AtomicStringImpl>&&) constructor.
- wtf/text/AtomicString.h:
(WTF::AtomicString::AtomicString):
- 12:11 PM Changeset in webkit [200561] by
-
- 2 edits in trunk/Source/WebCore
Roll out: ThreadSanitizer: Data race and thread leak in WebCore::ScrollingThread::createThreadIfNeeded
<https://webkit.org/b/157462>
This reverts commit r200554.
This doesn't fix the data race, and the thread leak is a
separate issue.
- page/scrolling/ScrollingThread.cpp:
(WebCore::ScrollingThread::createThreadIfNeeded): Roll out the
change.
- 12:05 PM Changeset in webkit [200560] by
-
- 2 edits in trunk/Source/WTF
- wtf/text/WTFString.h: Remove pragma once. Not working for some reason.
- 12:00 PM Changeset in webkit [200559] by
-
- 4 edits in trunk/Source
WTF:
Follow-up to that last patch (missed review comments).
- wtf/text/WTFString.h: Use nullptr instead of 0 as needed. Also use pragma once.
WebCore:
Follow-up to that last patch (missed review comments).
- page/EventSource.cpp:
(WebCore::EventSource::parseEventStream): Pre-increment, not post-increment.
(WebCore::EventSource::dispatchMessageEvent): More elegant form without explicit StringView.
- 11:46 AM Changeset in webkit [200558] by
-
- 8 edits in trunk/Source
Change EventSource constructor to take an IDL dictionary instead of a WebCore::Dictionary
https://bugs.webkit.org/show_bug.cgi?id=157459
Reviewed by Chris Dumez.
Source/WebCore:
Patch also includes some updating of EventSource class to modern idioms.
- page/EventSource.cpp:
(WebCore::EventSource::EventSource): Initialize based on Init.
(WebCore::EventSource::create): Take/pass Init instead of Dictionary.
- bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize): Take a StringView instead of a string
so callers don't have to allocate a String just to use this.
(WebCore::SerializedScriptValue::create): Ditto.
- bindings/js/SerializedScriptValue.h: Ditto.
- page/EventSource.cpp: Changed defaultReconnectDelay to be a uint64_t
instead of an unsigned long long.
(WebCore::EventSource::EventSource): Changed constructor to take a struct
instead of a Dictionary for eventSourceInit. Also moved initialization of
data members to the header and used ASCIILiteral.
(WebCore::EventSource::create): Changed type to Init and streamlined code
a little bit using auto.
(WebCore::EventSource::connect): Used a reference instead of a pointer.
Also added a FIXME since I noticed that m_requestInFlight is probably not
needed, since it's basically the same thing as "is m_loader null".
(WebCore::EventSource::url): Moved to the header and made it inline.
(WebCore::EventSource::networkRequestEnded): Removed unneeded check that
is already done by all callers and turned it into an assertion.
(WebCore::EventSource::withCredentials): Ditto.
(WebCore::EventSource::readyState): Ditto.
(WebCore::EventSource::responseIsValid): Added. Helper function to make
the logic in didReceiveResponse easier to read. Fixed logic to compare
MIME type ignoring ASCII case, since that's how MIME types work.
(WebCore::EventSource::didReceiveResponse): Use the helper above, and also
move the m_eventStreamOrigin set up code into the valid response case,
since there is no point doing it if the response is not valid. Also use
the early return idiom.
(WebCore::EventSource::didReceiveData): Removed the unneeded explicit
conversion to StringView here. Also removed a FIXME that I fixed.
(WebCore::EventSource::didFinishLoading): Added code to flush the decoder
as mentioned in didReceiveData. Added FIXME about peculiar clearing code
that exists only here. Removed check for empty receive buffer and data
that is not needed since parseEventStream does sufficient checking.
(WebCore::EventSource::didFail): Added FIXME because of things that
didFinishLoading does that seem equally valuable here.
(WebCore::EventSource::parseEventStream): Tweaked types and names of local
variables, and changed to use Optional instead of magic number -1. Also
added a FIXME about how the buffer type is probably not right since we
keep moving the characters in the buffer as we consume the start of it.
(WebCore::EventSource::parseEventStreamLine): Refactor and reorganize so
this doesn't do so much string allocation and is easier to read
(WebCore::EventSource::canSuspendForDocumentSuspension): Tweaked comment.
(WebCore::EventSource::dispatchMessageEvent): Renamed this from
createMessageEvent, and moved more code in here. We now don't have to
allocate a temporary string just to pass it to SerializedScriptValue.
- page/EventSource.h: Updated for changes above. Use pragma once.
Define and use EventSource::Init struct. Other small cleanup.
- page/EventSource.idl: Define EventSourceInit dictionary and use it.
Other small cleanup.
- page/EventSource.idl: U
Source/WTF:
- wtf/text/WTFString.h: Export a symbol now used in WebCore.
- 11:35 AM Changeset in webkit [200557] by
-
- 4 edits in trunk/Source/WebCore
Change HTMLSlotElement::assignedNodes to take a IDL dictionary instead of a WebCore::Dictionary
https://bugs.webkit.org/show_bug.cgi?id=157457
Reviewed by Chris Dumez.
- html/HTMLSlotElement.cpp:
(WebCore::HTMLSlotElement::removedFrom): Fixed typo in comment.
(WebCore::HTMLSlotElement::assignedNodes): Renamed assignedNodesForBindings back to this
and changed the argument type to Optional<AssignedNodesOptions> instead of Dictionary.
Also streamlined the logic a bit.
(WebCore::HTMLSlotElement::enqueueSlotChangeEvent): Changed to use a pointer to the
enqueued event instead of a boolean. With only a boolean, we could end up clearing the
flag in cases where we don't really want to.
(WebCore::HTMLSlotElement::dispatchEvent): Ditto.
(WebCore::HTMLSlotElement::assignedNodesForBindings): Deleted.
- html/HTMLSlotElement.h: Use pragma once. Added AssignedNodeOptions. Changed for the
above, including changing the data member.
- html/HTMLSlotElement.idl: Removed use of ImplementedAs. Fixed the type of the options
dictionary.
- 11:29 AM Changeset in webkit [200556] by
-
- 22 edits in trunk/Source/WebCore
[Bindings] Add convert<>() template specializations for integer types
https://bugs.webkit.org/show_bug.cgi?id=157458
Reviewed by Darin Adler.
Add convert<>() template specializations for integer types and use them
in the JS bindings. Also, treat non-32bit types the same way as the
32bit ones, allowing the compiler to optimize out branching based on
the IntegerConversionConfiguration.
- bindings/js/JSCryptoAlgorithmDictionary.cpp:
- bindings/js/JSDOMBinding.cpp:
(WebCore::enforceRange):
(WebCore::toSmallerInt):
(WebCore::toSmallerUInt):
(WebCore::toInt8EnforceRange):
(WebCore::toUInt8EnforceRange):
(WebCore::toInt8Clamp):
(WebCore::toUInt8Clamp):
(WebCore::toInt8):
(WebCore::toUInt8):
(WebCore::toInt16EnforceRange):
(WebCore::toUInt16EnforceRange):
(WebCore::toInt16Clamp):
(WebCore::toUInt16Clamp):
(WebCore::toInt16):
(WebCore::toUInt16):
(WebCore::toInt32EnforceRange):
(WebCore::toInt32Clamp):
(WebCore::toUInt32Clamp):
(WebCore::toUInt32EnforceRange):
(WebCore::toInt64EnforceRange):
(WebCore::toUInt64EnforceRange):
(WebCore::toInt64Clamp):
(WebCore::toUInt64Clamp):
(WebCore::toInt64):
(WebCore::toUInt64):
- bindings/js/JSDOMBinding.h:
- Splt some integer conversion functions into 3 Normal / Clamp / Enforce versions, similarly to what was done for 32bit types already. This is so that these can be called from the inline functions in JSDOMConvert.h, allowing the compiler to optimize out the branches.
- Get rid of some unnecessary state.hadException() checks.
- bindings/js/JSDOMConvert.h:
Add convert<> specializations for integer types.
- bindings/js/JSNodeFilterCustom.cpp:
(WebCore::JSNodeFilter::acceptNode):
- bindings/scripts/CodeGenerator.pm:
- Add utility function to distinguish integer types.
- Have IsNumericType() using the integerType / floatingPointType hashes to avoid duplication.
- Stop int / unsigned int from integer types as those are not in Web IDL and they are not used.
- bindings/scripts/CodeGeneratorJS.pm:
(GetIntegerConversionType):
(JSValueToNative):
Use convert<>() for converting JSValue to integer types.
- bindings/scripts/IDLParser.pm:
Stop allowing int / unsigned int types as those are not in Web IDL.
- bindings/scripts/test/JS/JSTestEventTarget.cpp:
- bindings/scripts/test/JS/JSTestGlobalObject.cpp:
- bindings/scripts/test/JS/JSTestObj.cpp:
- bindings/scripts/test/JS/JSTestTypedefs.cpp:
Rebaseline bindings tests.
- 9:54 AM Changeset in webkit [200555] by
-
- 9 edits in trunk
Correct dictionary bindings handling of optional, null, and undefined
https://bugs.webkit.org/show_bug.cgi?id=157463
Reviewed by Chris Dumez.
Source/WebCore:
- bindings/js/JSDOMBinding.cpp:
(WebCore::propertyValue): Deleted.
- bindings/js/JSDOMBinding.h: Deleted propertyValue, not all that helpful for now.
- bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent): Added a new early exit for convert to
a dictionary type when the value is undefined or null and all members are either
optional or have a default value. This returns the default values for everything
without raising an exception. Added checking that requires that the dictionary
argument is an object and not a regular expression, since that's also called for
in the latest draft of the Web IDL specification. This ends up speeding up the
code a bit since we now use JSObject::get for properties instead of JSValue::get.
(GenerateParametersCheck): Renamed some local variables. Taught the code that
optional dictionaries all have a default value; before it was doing that for the
type "Dictionary" but not the real dictionary types (IsDictionaryType).
- bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
- css/FontFace.cpp:
(WebCore::FontFace::create): Changed argument to be Descriptors instead of
Optional<Descriptors>. It would have compiled the other way, but there is now
no caller that will pass a null. Because the IDL dictionary support was new,
this was the only place that was doing it wrong. Good that we "nipped it in the bud"
before doing this in more places.
- css/FontFace.h: Ditto.
LayoutTests:
- fast/dom/MutationObserver/observe-exceptions-expected.txt: Reverted that
change to expect a more specific TypeError just as it was a day ago before
my last patch. The TypeError is back to being a problem with the specifics
of the arguments passed rather than a problem with null and undefined
themselves being invalid.
- 8:22 AM Changeset in webkit [200554] by
-
- 2 edits in trunk/Source/WebCore
ThreadSanitizer: Data race and thread leak in WebCore::ScrollingThread::createThreadIfNeeded
<https://webkit.org/b/157462>
Reviewed by Darin Adler.
Reproduced with multiple existing tests.
- page/scrolling/ScrollingThread.cpp:
(WebCore::ScrollingThread::createThreadIfNeeded): Use a
std::once_flag to initialize Scrolling Thread since this may be
called from background threads.
- 12:11 AM Changeset in webkit [200553] by
-
- 2 edits in trunk/Source/WebCore
Try to fix build without rolling out that last change.
- bindings/js/JSDOMConvert.h:
(WebCore::convert<Vector<String>>): Make this an inline. Just call toNativeArray.
May 7, 2016:
- 11:39 PM Changeset in webkit [200552] by
-
- 12 edits in trunk
Change MutationObserver::observe to take an IDL dictionary, rather than WebCore::Dictionary
https://bugs.webkit.org/show_bug.cgi?id=157456
Reviewed by Chris Dumez.
Source/WebCore:
- bindings/js/JSDOMConvert.h:
(WebCore::convertOptional): Use a specific Optional null rather than Nullopt so we
can compile the ternary operator.
(WebCore::convert<bool>): Added.
(WebCore::convert<Vector<String>>): Added. Later we probably need to change convert to use
a member function of a class template rather than a function template so we can make partial
specialization work and do this just once for all Vector<T>.
- bindings/js/JSMutationObserverCustom.cpp:
(WebCore::JSMutationObserverOwner::isReachableFromOpaqueRoots): Streamlined code and removed
some local variables. Changed to call the new observedNodes rather than getObservedNodes.
- bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent): Fixed bug where we tried to call the version of
the convert function with a default value even when there was none.
- bindings/scripts/test/TestObj.idl: Added a test case basically identical to what's needed
in MutationObserver.idl.
- bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
- dom/MutationObserver.cpp:
(WebCore::MutationObserver::observe): Chagned function to take a MutationObserver::Init
instead of a Dictionary.
(WebCore::MutationObserver::observationStarted): Changed argument type to a reference.
(WebCore::MutationObserver::observationEnded): Ditto.
(WebCore::MutationObserverMicrotask): Removed unneeded explicit constructor and destructor.
(WebCore::queueMutationObserverCompoundMicrotask): Got rid of unnneeded local variable.
(WebCore::MutationObserver::observedNodes): Renamed to remove the "get" prefix.
- dom/MutationObserver.h: Reduced includes. Added MutationObserver::Init struct and
used it for the type of the argument to the observe function. Changed a few argument
types and removed unused forward declarations.
- dom/MutationObserver.idl: Added MutationObserverInit and used it instead of Dictionary.
- dom/MutationObserverRegistration.cpp:
(WebCore::MutationObserverRegistration::MutationObserverRegistration): Pass a reference.
(WebCore::MutationObserverRegistration::~MutationObserverRegistration): Ditto.
LayoutTests:
- fast/dom/MutationObserver/observe-exceptions-expected.txt: Updated to expect
the specific TypeError generated by the bindings code rather than the generic
TypeError we got before generated inside the C++ DOM.
- 9:57 PM Changeset in webkit [200551] by
-
- 2 edits in trunk/Websites/perf.webkit.org
Add horizontal between categories of tests
https://bugs.webkit.org/show_bug.cgi?id=157386
Reviewed by Darin Adler.
Wrap tests in each category by tbody and add a horizontal bar between each category.
- public/v3/pages/summary-page.js:
(SummaryPage.prototype._constructTable):
(SummaryPage.cssTemplate):
- 9:39 PM Changeset in webkit [200550] by
-
- 29 edits1 add in trunk/Source/WebCore
Reduce special handling of XPathNSResolver type in the bindings
https://bugs.webkit.org/show_bug.cgi?id=157454
Reviewed by Darin Adler.
Reduce special handling of XPathNSResolver type in the bindings.
- CMakeLists.txt:
- WebCore.xcodeproj/project.pbxproj:
- bindings/js/JSBindingsAllInOne.cpp:
Add new JSXPathNSResolverCustom.cpp file.
- bindings/js/JSDOMStringListCustom.cpp:
(WebCore::JSDOMStringList::toWrapped):
Take the ExecState by reference instead of pointer.
- bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::toWrapped):
Update to take an ExecState& parameter. The bindings now pass
an ExecState to all custom toWrapped() methods for consistency
and flexibility.
- bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
Pass an ExecState now that those toWrapped() methods expect
it.
- bindings/js/JSEventTargetCustom.cpp:
(WebCore::JSEventTarget::toWrapped):
Update to take an ExecState& parameter.
- bindings/js/JSIDBDatabaseCustom.cpp:
(WebCore::JSIDBDatabase::transaction):
Pass ExecState by reference instead of pointer.
- bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent):
Pass ExecState to JSDOMWindow::toWrapped().
- bindings/js/JSXPathNSResolverCustom.cpp: Added.
(WebCore::JSXPathNSResolver::toWrapped):
Provide a custom implementation of JSXPathNSResolver::toWrapped()
instead of having the custom code in the bindings generator.
- bindings/scripts/CodeGeneratorJS.pm:
(AddIncludesForType):
Drop special includes for XPathNSResolver as they are no longer needed.
(GenerateHeader):
Drop special casing of certain types for generating the toWrapped()
declaration by:
- Relying on GetNativeType() for the return value as certain types return a RefPtr instead of a raw pointer.
- Adding an extra ExecState parameter when a custom implementation of toWrapped() is provided, given that some of them need it.
(GenerateParametersCheck):
Drop custom code for XPathNSResolver and use the normal code path for
this type now. The custom code now resides in the custom implementation
of JSXPathNSResolver::toWrapped(), in custom bindings.
(JSValueToNative):
- Drop NodeFilter from the nativeType hash map as it was updated to be a callback interface a while back.
- Add XPathNSResolver to nativeType hash map so that we now to use a RefPtr<> instead of a raw pointer in the bindings. We should probably add an IDL extended attribute for this at some point.
- Drop special casing for DOMStringList which was outdated since there is no toDOMStringList() function. DOMStringList has a custom toWrapped() function instead nowadays so we now call this one instead. We apparently do not have any DOMStringList parameters outside our bindings tests at the moment, which is why no one noticed.
- Pass an ExecState to toWrapped() if the interface has the JSCustomToNativeObject IDL extended attribute.
- bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
- bindings/scripts/test/GObject/WebKitDOMTestObj.h:
- bindings/scripts/test/JS/JSTestObj.cpp:
- bindings/scripts/test/ObjC/DOMTestObj.h:
- bindings/scripts/test/ObjC/DOMTestObj.mm:
- bindings/scripts/test/TestObj.idl:
Add bindings test coverage for having an operation with an
XPathNSResolver parameter.
- dom/Document.idl:
- xml/XPathEvaluator.idl:
Drop some unnecessary default parameter values.
- xml/XPathNSResolver.idl:
Add JSCustomToNativeObject IDL extended attribute so that we can
provide our own custom implementation of JSXPathNSResolver::toWrapped(),
instead of having the custom code in the bindings generator.
- dom/Document.cpp:
(WebCore::Document::createExpression):
(WebCore::Document::evaluate):
- dom/Document.h:
- inspector/InspectorNodeFinder.cpp:
- xml/XPathEvaluator.cpp:
(WebCore::XPathEvaluator::createExpression):
(WebCore::XPathEvaluator::evaluate):
- xml/XPathEvaluator.h:
- xml/XPathExpression.cpp:
(WebCore::XPathExpression::createExpression):
- xml/XPathExpression.h:
- xml/XPathParser.cpp:
(WebCore::XPath::Parser::Parser):
(WebCore::XPath::Parser::parseStatement):
- xml/XPathParser.h:
Take XPathNSResolver parameter as a Ref<XPathNSResolver>&& as this is
what the generated bindings now provide us, given that this sometimes
have to create a wrapper around a JSObject.
- 3:29 PM Changeset in webkit [200549] by
-
- 2 edits in trunk/Source/WebCore
Fix crash introduced by the last patch.
Fix suggested by Chris Dumez.
- css/FontFace.cpp:
(WebCore::FontFace::FontFace): Roll out incorrect change. Things were getting
initialized in the wrong order in a change I had made to the FontFace constructor
that takes a CSSFontSelector.
- 2:36 PM Changeset in webkit [200548] by
-
- 2 edits in trunk/Source/WebCore
Unreviewed, rebaseline bindings tests after r200547.
- bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convert<TestObj::FontFaceDescriptors>):
- 2:14 PM Changeset in webkit [200547] by
-
- 18 edits1 move in trunk
Next step on dictionary bindings, along with other bindings refinements
https://bugs.webkit.org/show_bug.cgi?id=157451
Reviewed by Chris Dumez.
Source/WebCore:
Converted one dictionary, the one passed to the constructor in FontFace.
- WebCore.xcodeproj/project.pbxproj: Updated for name change of JSDOMBuild.h to
JSDOMConvert.h and also let Xcode update a file type.
- bindings/js/JSDOMBinding.cpp:
(WebCore::propertyValue): Added.
- bindings/js/JSDOMBinding.h: Use pragma once. Remove unnecessary forward declaration.
Move all declarations to the top of the file, separating them from definitions. This
is a small step toward better overview of what's in this file and paves the way for
future simplifications and improvements we can make after we observe patterns.
Also removed a couple unused functions.
- bindings/js/JSDOMConvert.h: Renamed from JSDOMBuild.h.
Renamed function templates from build to convert. Added convertOptional.
- bindings/js/ReadableStreamController.cpp:
(WebCore::callFunction): Use auto and remove some unneeded namespacing.
(WebCore::ReadableStreamController::invoke): Ditto. Also remove use of helper function
getPropertyFromObject, since this was the only call site and it was not very helpful.
(WebCore::ReadableStreamController::isControlledReadableStreamLocked): Ditto.
(WebCore::createReadableStream): Ditto.
(WebCore::getReadableStreamReader): Ditto.
- bindings/scripts/CodeGeneratorJS.pm:
(GenerateEnumerationImplementationContent): Updated for name change from build to
convert and JSDOMBuild.h to JSDOMConvert.h.
(GenerateDictionaryImplementationContent): Ditto. Also added code to handle optional
and added explicit exception checking, using local variables. Not clear longer term
if the local variable approach is OK since this will unnecessarily change types like
const String& to String.
(GenerateParametersCheck): Removed local variable $optional and use $parameter->isOptional
directly consistently. This is slightly clearer because the old code used a mix of the
two, and also is a better pattern for when we refactor this into smaller functions.
Note that this function name is not good any more--this is a lot more then parameter checks.
(GetNativeType): Return appropriate name for dictionary types.
(JSValueToNative): Updated for name change from build to convert and JSDOMBuild.h to
JSDOMConvert.h.
- bindings/scripts/test/JS/JSTestObj.cpp:
- bindings/scripts/test/JS/JSTestTypedefs.cpp:
Regenerated results.
- bindings/scripts/test/TestObj.idl: Added another dictionary test case, just a copy
of the current state of the one in FontFace.idl.
- css/CSSFontFace.cpp:
(WebCore::CSSFontFace::setUnicodeRange): Update for simplified UnicodeRange struct.
(WebCore::CSSFontFace::setFeatureSettings): Fix to correctly handle being called
with "normal". Also fix so it doesn't call fontPropertyChanged if nothing changed.
Also got rid of return value, which had no real value: it was returning false for
some bad inputs, but others would just lead to assertions, and the real reason this
was OK is that this function is only passed known-valid values.
- css/CSSFontFace.h: Used prama once. Tweaked formatting. Removed return value from
the setFeatureSettings function. Changed UnicodeRange to be struct with public data
members instead a struct with a constructor and getter functions.
- css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule): Updated since setFeatureSettings no
longer has a boolean return value.
- css/CSSSegmentedFontFace.cpp:
(WebCore::appendFontWithInvalidUnicodeRangeIfLoading): Updated for simplified
UnicodeRange struct.
- css/FontFace.cpp:
(WebCore::valueFromDictionary): Deleted.
(WebCore::FontFace::create): Updated to take the descriptors as a struct instead of
a WebCore::Dictionary. Also made that argument optional as specified in the current
specification draft.
(WebCore::FontFace::setFeatureSettings): Updated since setFeatureSettings no longer
has a boolean return value.
(WebCore::FontFace::unicodeRange): Updated for simplified UnicodeRange struct.
- css/FontFace.h: Used pragma once. Removed unneeded includes and forward declarations.
Derived privately from CSSFontFace::Client. Added a FontFace::Descriptors struct and
used it as an argument to the create function as described above.
- css/FontFace.idl: Added FontFaceDescriptors and changed the argument to the
constructor to be an optional FontFaceDescriptors instead of a Dictionary.
Tools:
- Scripts/do-webcore-rename: Use this to rename JSDOMBuild.h to JSDOMConvert.h.
Also skip test expectations in a directory that this was modifying unnecessarily.
- 1:04 PM Changeset in webkit [200546] by
-
- 15 edits in trunk/Source/WebCore
Rework FontFace promise attribute handling
https://bugs.webkit.org/show_bug.cgi?id=157310
Reviewed by Myles C. Maxfield.
Making promise attributes cached attributes, so that they are created only once.
They are created in the custom binding code and passed to DOM class as needed.
Removed usage of ExecState& from DOM iterators.
No change should be visible from user scripts.
- Modules/fetch/FetchHeaders.cpp:
(WebCore::FetchHeaders::Iterator::next): Removing ExecState parameter.
- Modules/fetch/FetchHeaders.h:
- bindings/js/JSDOMIterator.h:
(WebCore::keyValueIteratorForEach):
(WebCore::JSDOMIterator<JSWrapper>::next): Ditto.
- bindings/js/JSDOMPromise.cpp:
(WebCore::DeferredWrapper::promise): Removed deferred() and added access to promise directly.
- bindings/js/JSDOMPromise.h:
- bindings/js/JSFontFaceCustom.cpp:
(WebCore::JSFontFace::loaded): Using cached attribute to call FontFace::loaded only once.
- bindings/js/JSFontFaceSetCustom.cpp:
(WebCore::JSFontFaceSet::ready): Using cached attribute to call FontFaceSet::ready only once.
- css/CSSFontFace.cpp:
(WebCore::CSSFontFace::wrapper): Removing ExecState parameter.
- css/CSSFontFace.h:
- css/FontFace.cpp:
(WebCore::FontFace::create): Ditto.
(WebCore::FontFace::FontFace): Ditto.
(WebCore::FontFace::fontStateChanged): Updating promise handling.
(WebCore::FontFace::registerLoaded): Resolving/rejecting promise if backing CSSFontFace loading is ended.
(WebCore::FontFace::load): Calling backing load.
- css/FontFace.h:
- css/FontFaceSet.cpp:
(WebCore::FontFaceSet::Iterator::next): Removing ExecState parameter.
(WebCore::FontFaceSet::load): Removing ExecState and ExceptionCode parameter.
(WebCore::FontFaceSet::registerReady): Resolving promise if ready otherwise storing it for resolving it later.
(WebCore::FontFaceSet::completedLoading): Resolving promise if any is stored.
(WebCore::FontFaceSet::create): Deleted.
- css/FontFaceSet.h:
- css/FontFaceSet.idl:
- 1:02 PM Changeset in webkit [200545] by
-
- 2 edits in trunk/Source/WebCore
Fix an incorrect usage of OS(DARWIN) with PLATFORM(COCOA)
https://bugs.webkit.org/show_bug.cgi?id=157167
Patch by Jeremy Huddleston Sequoia <jeremyhu@apple.com> on 2016-05-07
Reviewed by Myles C. Maxfield.
- platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::hash):
- 9:51 AM Changeset in webkit [200544] by
-
- 7 edits3 adds in trunk/PerformanceTests
Update Animometer design
https://bugs.webkit.org/show_bug.cgi?id=157449
Reviewed by Darin Adler.
- Animometer/developer.html: Stop including runner/animometer.css.
- Animometer/index.html: Udpated elements to fit new styles.
- Animometer/resources/debug-runner/animometer.css:
Copy the old runner/animometer.css to here so the debug runner is unaffected.
- Animometer/resources/runner/animometer.css:
New styles for the design. Drop flex box for broad browser support.
- Animometer/resources/runner/animometer.js:
(ResultsTable.clear): Use textContent.
(window.sectionsManager.showSection): Add class to the body.
(window.sectionsManager.setSectionScore): Use textContent, not innerHTML.
- Animometer/resources/runner/crystal.svg: Added.
- Animometer/resources/runner/lines.svg: Added.
- Animometer/resources/runner/logo.svg: Added.
- Animometer/resources/runner/tests.js: Shorten test name and title case them.
- 9:20 AM Changeset in webkit [200543] by
-
- 6 edits2 moves in trunk/Source/JavaScriptCore
Add JSC options bytecodeRangeToJITCompile and jitWhitelist.
https://bugs.webkit.org/show_bug.cgi?id=157428
Reviewed by Michael Saboff.
- Added Options::bytecodeRangeToJITCompile and Options::jitWhitelist options.
- Moved DFGFunctionWhitelist* to FunctionWhitelist* and made it generic so that it can be used for more than one whitelist instance. In this case, we now have two: the dfgWhitelist and the jitWhitelist.
- Added "can compile" checks in LLInt::shouldJIT() to check Options::bytecodeRangeToJITCompile and Options::jitWhitelist.
- CMakeLists.txt:
- JavaScriptCore.xcodeproj/project.pbxproj:
- dfg/DFGDriver.cpp:
(JSC::DFG::getNumCompilations):
(JSC::DFG::ensureGlobalDFGWhitelist):
(JSC::DFG::compileImpl):
- dfg/DFGFunctionWhitelist.cpp: Removed.
- dfg/DFGFunctionWhitelist.h: Removed.
- llint/LLIntSlowPaths.cpp:
(JSC::LLInt::ensureGlobalJITWhitelist):
(JSC::LLInt::shouldJIT):
- runtime/Options.h:
- tools/FunctionWhitelist.cpp: Copied from Source/JavaScriptCore/dfg/DFGFunctionWhitelist.cpp.
(JSC::FunctionWhitelist::FunctionWhitelist):
(JSC::FunctionWhitelist::contains):
(JSC::DFG::FunctionWhitelist::ensureGlobalWhitelist): Deleted.
(JSC::DFG::FunctionWhitelist::FunctionWhitelist): Deleted.
(JSC::DFG::FunctionWhitelist::parseFunctionNamesInFile): Deleted.
(JSC::DFG::FunctionWhitelist::contains): Deleted.
- tools/FunctionWhitelist.h: Copied from Source/JavaScriptCore/dfg/DFGFunctionWhitelist.h.
- 6:03 AM Changeset in webkit [200542] by
-
- 6 edits in trunk
REGRESSION(r196222): [AX][GTK] accessibility/gtk/caret-offsets.html failing
https://bugs.webkit.org/show_bug.cgi?id=153956
Reviewed by Chris Fleizach.
Source/WebCore:
The reason the test began failing is that it was checking the new caret offset
synchronously. For most of the test cases, this was not a problem. But when the
caret was moved out of a focused link, the focus change (and associated repainting)
delayed the caret-moved event long enough to cause the associated test case to fail.
The test now uses shouldBecomeEqualToString() instead of shouldBeEqualToString().
The test also had a supposedly-correct expectation which was wrong: When moving the
caret to a valid accessible offset, the caret-moved event should be for that offset.
This was not the case for the list item test case because emitTextSelectionChange()
was not adjusting the offset for the RenderListMarker, the text of which is exposed
as part of the ATK_ROLE_LIST_ITEM object. This bug was also fixed and the test case
updated accordingly.
No new tests are needed. The previously-failing test is now passing.
- editing/atk/FrameSelectionAtk.cpp:
(WebCore::emitTextSelectionChange):
LayoutTests:
Change the test to run asynchronously and update the expectations.
- accessibility/gtk/caret-offsets-expected.txt: Updated.
- accessibility/gtk/caret-offsets.html: Updated.
- platform/gtk/TestExpectations: Unskipped the previously-failing test.
- 1:19 AM Changeset in webkit [200541] by
-
- 2 edits in trunk/Source/JavaScriptCore
[JSC][32bit] stress/tagged-templates-template-object.js fails in debug
https://bugs.webkit.org/show_bug.cgi?id=157436
Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-05-07
Reviewed by Filip Pizlo.
- dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
The node OverridesHasInstance had a speculation after a jump.