Stop using deprecatedCharacters in WebCore/platform/win
https://bugs.webkit.org/show_bug.cgi?id=130515

Reviewed by Brent Fulgham.

* platform/graphics/TextRun.h:
(WebCore::TextRun::TextRun): Add a constructor that takes a StringView.
Later, we might want to exclusively use the StringView version and remove
some of the others.
(WebCore::TextRun::setText): Add a version of this function that takes a StringView.

* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::systemFallbackForCharacters): Use StringView::getCharactersWithUpconvert.
(WebCore::createGDIFont): Ditto.
(WebCore::FontCache::getTraitsInFamily): Ditto.
* platform/win/BString.cpp:
(WebCore::BString::BString): Use StringView::upconvertedCharacters.
* platform/win/ClipboardUtilitiesWin.cpp:
(WebCore::createGlobalData): Use StringView::getCharactersWithUpconvert.
* platform/win/FileSystemWin.cpp:
(WebCore::pathByAppendingComponent): Use StringBuilder and StringView::getCharactersWithUpconvert.
(WebCore::fileSystemRepresentation): Use StringView::upconvertedCharacters.
* platform/win/PasteboardWin.cpp:
(WebCore::filesystemPathFromUrlOrTitle): Use StringView::getCharactersWithUpconvert.
(WebCore::Pasteboard::writeURLToDataObject): Ditto.
(WebCore::createGlobalImageFileDescriptor): Ditto.

* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::calculatePositionAndSize): Use the new TextRun constructor.
* platform/win/WebCoreTextRenderer.cpp:
(WebCore::doDrawTextAtPoint): Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166063 268f45cc-cd09-0410-ab3c-d52691b4dbfc
StackLayoutPhase should find the union'ed calleeVariable before accessing its machineLocal.
<https://webkit.org/b/130566>

Reviewed by Filip Pizlo.

Source/JavaScriptCore: 

* dfg/DFGStackLayoutPhase.cpp:
(JSC::DFG::StackLayoutPhase::run):

LayoutTests: 

* js/regress-130566-expected.txt: Added.
* js/regress-130566.html: Added.
* js/script-tests/regress-130566.js: Added.
(test.doTest):
(test.for):
(test):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166064 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Bug 130345 - Refine childShouldCreateRenderer for MathML elements
https://bugs.webkit.org/show_bug.cgi?id=130345

Reviewed by Chris Fleizach.

Source/WebCore:

This is a follow-up of bug 124128. We add more restrictions on foreign
content of MathML elements.

Tests: mathml/presentation/annotation-children.html
       mathml/presentation/foreign-element-in-token.html

* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::isPresentationMathML): fix line wrapping
(WebCore::MathMLElement::isPhrasingContent):
- move the function from MathMLSelectElement.cpp
- add the constraint "is descendant of a map element" for area.
(WebCore::MathMLElement::isFlowContent): new function to test flow content.
(WebCore::MathMLElement::childShouldCreateRenderer):
- remove annotation since it is now tested in MathMLTextElement
- refine testing of annotation-xml
- do not create renderer for text content in MathML. Such content is only allowed inside token elements.
* mathml/MathMLElement.h: Declare isPhrasingContent and isFlowContent.
* mathml/MathMLSelectElement.cpp: Add new function to test MathML/SVG/HTML encodings.
(WebCore::MathMLSelectElement::isMathMLEncoding):
(WebCore::MathMLSelectElement::isSVGEncoding):
(WebCore::MathMLSelectElement::isHTMLEncoding):
(WebCore::MathMLSelectElement::getSelectedSemanticsChild): use the new functions.
* mathml/MathMLSelectElement.h: Declare the new public functions.
* mathml/MathMLTextElement.cpp: remove the isPhrasingContent function.
(WebCore::MathMLTextElement::childShouldCreateRenderer): Just in case, use the generic StyledElement::childShouldCreateRenderer.

LayoutTests:

We update the references of some tests after the additional
restrictions on MathML children. We replace the foreign-*.html with a
single foreign-element-in-token.html and write more tests to verify the
accepted and reject content.

* mathml/msub-anonymous-child-render-crash-expected.txt: Update reference now that text is only allowed in some token MathML elements.
* mathml/presentation/annotation-children-expected.html: Added.
* mathml/presentation/annotation-children.html: Added.
* mathml/presentation/foreign-element-in-annotation-xml.html: Added.
* mathml/presentation/foreign-element-in-annotation-xml-expected.txt: Added.
* mathml/presentation/foreign-element-in-token-expected.txt: Added.
* mathml/presentation/foreign-element-in-token.html: Added.
* mathml/presentation/foreign-mi-expected-mismatch.html: Removed.
* mathml/presentation/foreign-mi.html: Removed.
* mathml/presentation/foreign-mn-expected-mismatch.html: Removed.
* mathml/presentation/foreign-mn.html: Removed.
* mathml/presentation/foreign-mtext-expected-mismatch.html: Removed.
* mathml/presentation/foreign-mtext-rejected-expected.html: Removed.
* mathml/presentation/foreign-mtext-rejected.html: Removed.
* mathml/presentation/foreign-mtext.html: Removed.
* mathml/presentation/semantics-2.html: the mtext elements can not be direct child of annotation-xml. wrap them in a math tag.
* mathml/presentation/semantics-3.html: ditto.
* mathml/presentation/semantics-4.html: ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166065 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge WebVTT Tokenizer Updates
https://bugs.webkit.org/show_bug.cgi?id=130565

Reviewed by Eric Carlson.

Source/WebCore: 

Merged from Blink (patch by fs@opera.com):
https://chromium.googlesource.com/chromium/blink/+/923db263aa65d6efd71c5b55708ad7eea6b23f53
http://crbug.com/73813002
https://chromium.googlesource.com/chromium/blink/+/48375b1d56b2d8850ae93a6c6fb01c69fae82c75
http://crbug.com/77553004
https://chromium.googlesource.com/chromium/blink/+/98d4fc4f5cb716a31d11907120b10538d4ba0f09
http://crbug.com/78833002
https://chromium.googlesource.com/chromium/blink/+/0e53d4f9f140e979b7f32de495551684bc7f4cd2
http://crbug.com/81113003
https://chromium.googlesource.com/chromium/blink/+/730ef1e7f9a1919964f7e74e7ccb2f343e10a148
http://crbug.com/97103002
https://chromium.googlesource.com/chromium/blink/+/c373ee914ffabeaf833939129538251d8f2f4eca
http://crbug.com/98763004
https://chromium.googlesource.com/chromium/blink/+/4ddb4d57948228fa05e49e06bd58a1179c09f212
http://crbug.com/118263002
 
* html/track/VTTCue.cpp:
(WebCore::scanPercentage):
(WebCore::VTTCue::setCueSettings):
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTTreeBuilder::buildFromString):
(WebCore::WebVTTTreeBuilder::constructTreeFromToken):
* html/track/WebVTTToken.h:
(WebCore::WebVTTToken::WebVTTToken):
(WebCore::WebVTTToken::StringToken):
(WebCore::WebVTTToken::StartTag):
(WebCore::WebVTTToken::EndTag):
(WebCore::WebVTTToken::TimestampTag):
(WebCore::WebVTTToken::type):
(WebCore::WebVTTToken::name):
(WebCore::WebVTTToken::characters):
(WebCore::WebVTTToken::classes):
(WebCore::WebVTTToken::annotation):
* html/track/WebVTTTokenizer.cpp:
(WebCore::addNewClass):
(WebCore::emitToken):
(WebCore::advanceAndEmitToken):
(WebCore::WebVTTTokenizer::WebVTTTokenizer):
(WebCore::WebVTTTokenizer::nextToken):
* html/track/WebVTTTokenizer.h:
(WebCore::WebVTTTokenizer::shouldSkipNullCharacters):

LayoutTests: 

Merged from Blink (patch by fs@opera.com):
https://chromium.googlesource.com/chromium/blink/+/923db263aa65d6efd71c5b55708ad7eea6b23f53
http://crbug.com/73813002
https://chromium.googlesource.com/chromium/blink/+/48375b1d56b2d8850ae93a6c6fb01c69fae82c75
http://crbug.com/77553004
https://chromium.googlesource.com/chromium/blink/+/98d4fc4f5cb716a31d11907120b10538d4ba0f09
http://crbug.com/78833002
https://chromium.googlesource.com/chromium/blink/+/0e53d4f9f140e979b7f32de495551684bc7f4cd2
http://crbug.com/81113003
https://chromium.googlesource.com/chromium/blink/+/730ef1e7f9a1919964f7e74e7ccb2f343e10a148
http://crbug.com/97103002
https://chromium.googlesource.com/chromium/blink/+/c373ee914ffabeaf833939129538251d8f2f4eca
http://crbug.com/98763004
https://chromium.googlesource.com/chromium/blink/+/4ddb4d57948228fa05e49e06bd58a1179c09f212
http://crbug.com/118263002

* TestExpectations:
* media/track/captions-webvtt/tc022-entities-wrong.vtt:
* media/track/captions-webvtt/tc022-entities.vtt:
* media/track/track-webvtt-tc022-entities-expected.txt:
* media/track/track-webvtt-tc022-entities.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Regions] incorrect clipping when the content has CSS Transforms like rotation
https://bugs.webkit.org/show_bug.cgi?id=110198

Reviewed by David Hyatt.

Added test that confirms the issue of transformed content being clipped was fixed.

* fast/regions/overflow-content-transform-rotate-expected.html: Added.
* fast/regions/overflow-content-transform-rotate.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166067 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed test fix after my last checkin. Add missing test expectation.

* http/tests/media/track/track-webvtt-slow-loading-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166068 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: Replace DEPRECATED_DEFINE_STATIC_LOCAL by static NeverDestroyed
https://bugs.webkit.org/show_bug.cgi?id=130594

Reviewed by Chris Fleizach.

Use static NeverDestroyed<T> in new code.

* accessibility/AccessibilityMediaControls.cpp:
(WebCore::AccessibilityMediaControl::controlTypeName):
(WebCore::AccessibilityMediaControl::title):
(WebCore::AccessibilityMediaControlsContainer::elementTypeName):
(WebCore::AccessibilityMediaTimeline::helpText):
(WebCore::AccessibilityMediaTimeDisplay::accessibilityDescription):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::actionVerb):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
(WebCore::AccessibilityRenderObject::ariaLiveRegionStatus):
(WebCore::AccessibilityRenderObject::ariaLiveRegionRelevant):
(WebCore::AccessibilityRenderObject::actionVerb):
* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::notifyChildrenSelectionChange):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166069 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Change CodeGeneratorJS.pm special cases for "DOMWindow" to be general purpose
https://bugs.webkit.org/show_bug.cgi?id=130553

Reviewed by Geoffrey Garen.

Eliminated 'if ($interfaceName eq "DOMWindow") {' sections in CodeGeneratorJS where
it was used to do DOMWindow specific casting to a JSObject, either a JSDOMWindow* or
a JSDOMWindowShell*.  Instead the code generator will use the existing 
JSDOMWindow* toJSDOMWindow(JSValue value) function based on a newly added attribute
"CustomProxyToJSObject".  That attribute will emit a call to the function
${className}* to${className}(JSValue).

This is being done to clean up the code generator and for a subsequent patch that
will use a similar custom to{className} function for workers,
JSDedicatedWorkerGlobalScope* toJSDedicatedWorkerGlobalScope(JSValue).

Changes covered by existing tests.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/IDLAttributes.txt:
* page/DOMWindow.idl:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Replace DEPRECATED_DEFINE_STATIC_LOCAL by static NeverDestroyed<T> in bridge/
https://bugs.webkit.org/show_bug.cgi?id=130601

Reviewed by Darin Adler.

* bridge/IdentifierRep.cpp:
(WebCore::identifierSet):
(WebCore::intIdentifierMap):
(WebCore::stringIdentifierMap):
* bridge/NP_jsobject.cpp:
(objectMap):
* bridge/runtime_root.cpp:
(JSC::Bindings::rootObjectSet): Return a reference instead of
a pointer.
(JSC::Bindings::findProtectingRootObject):
(JSC::Bindings::findRootObject):
(JSC::Bindings::RootObject::RootObject):
(JSC::Bindings::RootObject::invalidate):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166071 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WindowFeatures.{x|y|width|height} are not initialized
<http://webkit.org/b/130547>
<rdar://problem/16383151>

Reviewed by Darin Adler.

Based on a Blink patch in CRBug 342591 by zhaoqin.

* page/WindowFeatures.cpp:
(WebCore::WindowFeatures::WindowFeatures):
- Initialize x, y, width, height in String constructor.
- Move 'resizeable' variable to short-hand initialization since
  it is true in both cases.
- Use String::isEmpty() instead of checking its length.
* page/WindowFeatures.h:
(WebCore::WindowFeatures::WindowFeatures): Initialize x, y,
width, height in no-argument constructor.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166072 268f45cc-cd09-0410-ab3c-d52691b4dbfc