Only flush layers when the exposed rect actually changes
https://bugs.webkit.org/show_bug.cgi?id=134248

Reviewed by Anders Carlsson.


Source/WebCore: 
* WebCore.exp.in:

Source/WebKit2: 
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::setExposedContentRect):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170377 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add PageState to HistoryItem conversion code
https://bugs.webkit.org/show_bug.cgi?id=134259

Reviewed by Andreas Kling.

Source/WebKit2:
* Shared/SessionState.h:
* UIProcess/mac/LegacySessionStateCoding.cpp:
(WebKit::decodeBackForwardTreeNode):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/SessionStateConversion.cpp: Added.
(WebKit::toFormData):
(WebKit::applyFrameState):
(WebKit::toHistoryItem):
* WebProcess/WebCoreSupport/SessionStateConversion.h: Added.

Source/WTF:
* wtf/Optional.h:
(WTF::Optional::valueOr):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] process raw VTT in-band captions
https://bugs.webkit.org/show_bug.cgi?id=134178

Reviewed by Jer Noble.

* CMakeLists.txt: Add ISOVTTCue.cpp|h.
* WebCore.vcxproj/WebCore.vcxproj: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.

* html/track/BufferedLineReader.h:
(WebCore::BufferedLineReader::reset): New, empty the input buffer.

Make it possible to process WebVTT captions. 
* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::parser): Allocate, if necessary, and return a WebVTT parser.
(WebCore::InbandGenericTextTrack::parseWebVTTCueData): Pass a cue to the parser.
(WebCore::InbandGenericTextTrack::parseWebVTTFileHeader): Pass a VTT file header to the parser.
(WebCore::InbandGenericTextTrack::newCuesParsed): Parser callback.
(WebCore::InbandGenericTextTrack::newRegionsParsed): Ditto.
(WebCore::InbandGenericTextTrack::fileFailedToParse): Ditto.
* html/track/InbandGenericTextTrack.h:

* html/track/InbandTextTrack.h:

* html/track/InbandWebVTTTextTrack.cpp:
(WebCore::InbandWebVTTTextTrack::parser): New, parser accessor.
(WebCore::InbandWebVTTTextTrack::parseWebVTTCueData): New, parse VTT data in an ISOWebVTTCue
    object.
(WebCore::InbandWebVTTTextTrack::newCuesParsed): Cleanup.
(WebCore::InbandWebVTTTextTrack::newRegionsParsed): Implement.
(WebCore::InbandWebVTTTextTrack::fileFailedToParse): Change the error message.
* html/track/InbandWebVTTTextTrack.h:

* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::TextTrackCueGenericBoxElement): Change cue parameter
    from a pointer to a reference.
(WebCore::TextTrackCueGeneric::createDisplayTree): Ditto.

* html/track/VTTCue.cpp:
(WebCore::VTTCueBox::create): Change cue parameter from a pointer to a reference.
(WebCore::VTTCueBox::VTTCueBox): Ditto.
(WebCore::VTTCueBox::getCue): Return a reference.
(WebCore::VTTCueBox::applyCSSProperties): m_cue is a reference, not a pointer.
(WebCore::VTTCue::create): New, create a VTTCue from WebVTTCueData.
(WebCore::VTTCue::VTTCue): New, internal constructor that takes a WebVTTCueData.
(WebCore::VTTCue::initialize): New, shared constructor initialization.
(WebCore::VTTCue::createDisplayTree): m_cue is a reference, not a pointer.
(WebCore::VTTCue::markFutureAndPastNodes): Ditto.
(WebCore::VTTCue::setCueSettings): Ditto.
* html/track/VTTCue.h:
(WebCore::VTTCueBox::create): Deleted.
(WebCore::VTTCue::create): Deleted.

* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::parseFileHeader): New. Reset the line reader buffer and parser state, 
    call the parser.
(WebCore::WebVTTParser::parseCueData): Create a cue from ISOWebVTTCue.
(WebCore::WebVTTParser::collectTimingsAndSettings): Return immediately if the string is empty.
(WebCore::WebVTTParser::collectTimeStamp): Ditto.
* html/track/WebVTTParser.h:
(WebCore::WebVTTCueData::originalStartTime): New.
(WebCore::WebVTTCueData::setOriginalStartTime): New.
(WebCore::WebVTTCueData::WebVTTCueData):

* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::getNewCues): Cleanup, use the new VTTCue::create.

Parse ISO WebVTT cue boxes.
* platform/graphics/ISOVTTCue.cpp: Added.
(WebCore::ISOBox::ISOBox):
(WebCore::ISOBox::peekType):
(WebCore::ISOBox::peekLength):
(WebCore::ISOBox::peekString):
(WebCore::vttCueBoxType):
(WebCore::vttIdBoxType):
(WebCore::vttSettingsBoxType):
(WebCore::vttPayloadBoxType):
(WebCore::vttCurrentTimeBoxType):
(WebCore::vttCueSourceIDBoxType):
(WebCore::ISOWebVTTCue::boxType):
(WebCore::ISOWebVTTCue::ISOWebVTTCue):
* platform/graphics/ISOVTTCue.h: Added.
(WebCore::ISOBox::boxHeaderSize):
(WebCore::ISOBox::length):
(WebCore::ISOBox::type):
(WebCore::ISOWebVTTCue::presentationTime):
(WebCore::ISOWebVTTCue::duration):
(WebCore::ISOWebVTTCue::sourceID):
(WebCore::ISOWebVTTCue::id):
(WebCore::ISOWebVTTCue::originalStartTime):
(WebCore::ISOWebVTTCue::settings):
(WebCore::ISOWebVTTCue::cueText):

* platform/graphics/InbandTextTrackPrivateClient.h:
(WebCore::InbandTextTrackPrivateClient::parseWebVTTFileHeader): New.

* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
(WebCore::InbandTextTrackPrivateAVF::InbandTextTrackPrivateAVF): Add a cue format parameter.
(WebCore::InbandTextTrackPrivateAVF::processCue): Call processNativeSamples.
(WebCore::InbandTextTrackPrivateAVF::processAttributedStrings): Add logging. Minor cleanup.
(WebCore::InbandTextTrackPrivateAVF::processNativeSamples): New, process an array of 
    CMSampleBuffers, create ISOWebVTTCue from the sample data.
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h:

* platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
(WebCore::InbandTextTrackPrivateAVCF::InbandTextTrackPrivateAVCF):
* platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.h:
(WebCore::InbandTextTrackPrivateAVCF::create):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::processMediaSelectionOptions):
(WebCore::LegibleOutputData::LegibleOutputData):
(WebCore::AVFWrapper::processCue):
(WebCore::AVFWrapper::legibleOutputCallback):

* platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.h:
(WebCore::InbandTextTrackPrivateAVFObjC::create): Add a cue format parameter.
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
(WebCore::InbandTextTrackPrivateAVFObjC::InbandTextTrackPrivateAVFObjC): Ditto.

* platform/graphics/avfoundation/InbandTextTrackPrivateLegacyAVFObjC.cpp:
(WebCore::InbandTextTrackPrivateLegacyAVFObjC::InbandTextTrackPrivateLegacyAVFObjC): Pass cue
    format to base class.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Improve logging.
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Don't leak an NSDictionary.
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Don't process media selection
    options until we have tracks.
(WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions): 
(WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): Pass native samples as well as 
    attributed strings to track.
(-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
* platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h:
(WebCore::OutOfBandTextTrackPrivateAVF::OutOfBandTextTrackPrivateAVF):

* platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h:
(WebCore::OutOfBandTextTrackPrivateAVF::OutOfBandTextTrackPrivateAVF):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170379 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Try to fix build.

* WebCore.exp.in: Remove duplicate export, this should be in the iOS section only.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170380 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] MSVC mishandles enums in bitfields
https://bugs.webkit.org/show_bug.cgi?id=134237

Reviewed by Michael Saboff.

Replace uses of enum types in bit fields with unsigned to
avoid losing a bit to hold the sign value. This can result
in Windows interpreting the value of the field improperly.


../JavaScriptCore: 
* bytecode/StructureStubInfo.h:
* parser/Nodes.h:

../WebCore: 
* loader/ResourceLoaderOptions.h:
* platform/network/ResourceRequestBase.h:
* platform/network/cf/ResourceResponse.h:
* rendering/RenderLayer.h:
* rendering/RenderMarquee.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170381 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix.

* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
(WebCore::InbandTextTrackPrivateAVF::processNativeSamples): Cast variadic argument to int.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS WebKit2] Disable screen font substitution by default.
<https://webkit.org/b/134266>
<rdar://problem/17427740>

Just like OS X >= 10.9, screen font substitution should be disabled
by default in WebKit2 for iOS.

Reviewed by Anders Carlsson.

* Shared/WebPreferencesDefinitions.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170385 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r169703): Invalid cast in JSC::asGetterSetter / JSC::JSObject::defineOwnNonIndexProperty
https://bugs.webkit.org/show_bug.cgi?id=134046

Reviewed by Filip Pizlo.

* runtime/GetterSetter.h:
(JSC::asGetterSetter):
* runtime/JSObject.cpp:
(JSC::JSObject::defineOwnNonIndexProperty): We need to check for a CustomGetterSetter here as well as
a normal GetterSetter. If we encounter a CustomGetterSetter, we delete it, create a new normal GetterSetter,
and insert it like normal. We also need to check for CustomAccessors when checking for unconfigurable properties.


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