Add a hasBreakpointFlag arg to the op_debug bytecode.
https://bugs.webkit.org/show_bug.cgi?id=127230.

Reviewed by Geoffrey Garen.

This is in anticipation of upcoming changes to support bytecode level
breakpoints. This patch adds the flag to the op_debug bytecode and
initializes it, but does not use it yet.

* bytecode/Opcode.h:
(JSC::padOpcodeName):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitDebugHook):
* llint/LowLevelInterpreter.asm:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162270 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Flesh out session APIs (still not enabled at API level).
https://bugs.webkit.org/show_bug.cgi?id=126918

Patch by Martin Hock <mhock@apple.com> on 2014-01-18
Reviewed by Alexey Proskuryakov.

* CMakeLists.txt:
* GNUmakefile.list.am:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::storageSession):
(WebKit::NetworkConnectionToWebProcess::startDownload):
(WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
(WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
(WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
(WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
(WebKit::NetworkConnectionToWebProcess::getRawCookies):
(WebKit::NetworkConnectionToWebProcess::deleteCookie):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::ensurePrivateBrowsingSession):
(WebKit::NetworkProcess::destroyPrivateBrowsingSession):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/RemoteNetworkingContext.h:
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::storageSession):
(WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
* NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
(WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
* Shared/SessionTracker.cpp: Copied from Source/WebKit2/UIProcess/APISession.cpp.
(WebKit::sessionMap):
(WebKit::identifierBase):
(WebKit::SessionTracker::getSessionMap):
(WebKit::SessionTracker::getIdentifierBase):
(WebKit::SessionTracker::session):
(WebKit::SessionTracker::destroySession):
(WebKit::SessionTracker::setIdentifierBase):
* Shared/SessionTracker.h: Copied from Source/WebKit2/UIProcess/APISession.h.
(WebKit::SessionTracker::isEphemeralID):
* Shared/mac/CookieStorageShim.cpp:
(WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL):
* UIProcess/APISession.cpp:
(API::generateID):
(API::Session::defaultSession):
(API::Session::legacyPrivateSession):
(API::Session::Session):
(API::Session::create):
(API::Session::isEphemeral):
(API::Session::getID):
* UIProcess/APISession.h:
* UIProcess/WebContext.cpp:
(WebKit::WebContext::setAnyPageGroupMightHavePrivateBrowsingEnabled):
(WebKit::WebContext::createNewWebProcess):
(WebKit::WebContext::createWebPage):
* UIProcess/WebContext.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::create):
(WebKit::WebPageProxy::WebPageProxy):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::sessionID):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::createWebPage):
* UIProcess/WebProcessProxy.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setPrivateBrowsingEnabled):
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::legacySessionID):
(WebKit::WebPlatformStrategies::cookiesForDOM):
(WebKit::WebPlatformStrategies::setCookiesFromDOM):
(WebKit::WebPlatformStrategies::cookiesEnabled):
(WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
(WebKit::WebPlatformStrategies::getRawCookies):
(WebKit::WebPlatformStrategies::deleteCookie):
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
(WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
(WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts):
(WebKit::WebFrameNetworkingContext::storageSession):
* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
(WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
(WebKit::WebFrameNetworkingContext::storageSession):
* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::ensurePrivateBrowsingSession):
(WebKit::WebProcess::destroyPrivateBrowsingSession):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162271 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove support for the viewsource attribute
https://bugs.webkit.org/show_bug.cgi?id=127232

Reviewed by Andreas Kling.

Source/WebCore:

The 'viewsource' attribute on frames is nonstandard, not used by anyone (the inspector has
its own syntax highlighting) and not audited.

This patch removes parsing of the viewsource attribute and the associated tests. A subsequent
patch will remove the code as well.

* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::parseAttribute):

Source/WTF:

* wtf/FeatureDefines.h:

LayoutTests:

* .gitattributes:
* fast/frames/resources/viewsource-fake-image-file.png: Removed.
* fast/frames/resources/viewsource-frame-1.html: Removed.
* fast/frames/resources/viewsource-frame-2.html: Removed.
* fast/frames/resources/viewsource-frame-3.html: Removed.
* fast/frames/resources/viewsource-frame-4.html: Removed.
* fast/frames/resources/viewsource-frame-5.html: Removed.
* fast/frames/resources/viewsource-frame-unfinished-script.html: Removed.
* fast/frames/resources/viewsource-frame-unfinished-textarea.html: Removed.
* fast/frames/viewsource-attribute.html: Removed.
* fast/frames/viewsource-empty-attribute-value-expected.txt: Removed.
* fast/frames/viewsource-empty-attribute-value.html: Removed.
* fast/frames/viewsource-linebreak-expected.txt: Removed.
* fast/frames/viewsource-linebreak.html: Removed.
* fast/frames/viewsource-link-on-href-value-expected.txt: Removed.
* fast/frames/viewsource-link-on-href-value.html: Removed.
* fast/frames/viewsource-on-image-file.html: Removed.
* fast/frames/viewsource-plain-text-tags-expected.txt: Removed.
* fast/frames/viewsource-plain-text-tags.html: Removed.
* fast/frames/viewsource-unfinished-tags-expected.txt: Removed.
* fast/frames/viewsource-unfinished-tags.html: Removed.
* fast/frames/viewsource-xml-expected.txt: Removed.
* fast/frames/viewsource-xml.html: Removed.
* http/tests/security/resources/view-source-no-refresh.php: Removed.
* http/tests/security/view-source-javascript-url-in-document-expected.txt: Removed.
* http/tests/security/view-source-javascript-url-in-document.html: Removed.
* http/tests/security/view-source-no-javascript-url-expected.txt: Removed.
* http/tests/security/view-source-no-javascript-url.html: Removed.
* http/tests/security/view-source-no-refresh-expected.txt: Removed.
* http/tests/security/view-source-no-refresh.html: Removed.
* platform/efl/fast/frames/viewsource-attribute-expected.png: Removed.
* platform/efl/fast/frames/viewsource-attribute-expected.txt: Removed.
* platform/efl/fast/frames/viewsource-on-image-file-expected.png: Removed.
* platform/efl/fast/frames/viewsource-on-image-file-expected.txt: Removed.
* platform/mac/fast/frames/viewsource-attribute-expected.png: Removed.
* platform/mac/fast/frames/viewsource-attribute-expected.txt: Removed.
* platform/mac/fast/frames/viewsource-on-image-file-expected.png: Removed.
* platform/mac/fast/frames/viewsource-on-image-file-expected.txt: Removed.
* platform/win/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162272 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Subpixel layout: IntRect::infiniteRect() overflows when subpixel layout is enabled.
https://bugs.webkit.org/show_bug.cgi?id=126899

Reviewed by Tim Horton.

Use LayoutUnits when setting the infinite values on IntRect::infiniteRect() to ensure
it won't overflow later when the IntRect gets converted to LayoutRect.

Source/WebCore:

Covered by existing tests.

* platform/graphics/IntRect.h:
(WebCore::IntRect::infiniteRect):

LayoutTests:

* platform/mac/TestExpectations: Unskipping svg test (failed with subpixel on)


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162273 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make ElementData JIT friendly
https://bugs.webkit.org/show_bug.cgi?id=127209

Reviewed by Geoffrey Garen.

The offsets of ElementData's flags were not accessible by the JIT. This patch
refactor ElementData to use explicit flags so that they can be used from
the code generators.

* dom/Element.cpp:
(WebCore::Element::synchronizeAllAttributes):
(WebCore::Element::synchronizeAttribute):
(WebCore::Element::attributeChanged):
(WebCore::Element::removeAttribute):
* dom/ElementData.cpp:
(WebCore::ElementData::destroy):
(WebCore::ElementData::ElementData):
(WebCore::ShareableElementData::ShareableElementData):
(WebCore::ShareableElementData::~ShareableElementData):
(WebCore::ElementData::arraySizeAndFlagsFromOther):
* dom/ElementData.h:
(WebCore::ElementData::hasName):
(WebCore::ElementData::isUnique):
(WebCore::ElementData::updateFlag):
(WebCore::ElementData::arraySize):
(WebCore::ElementData::setHasNameAttribute):
(WebCore::ElementData::styleAttributeIsDirty):
(WebCore::ElementData::setStyleAttributeIsDirty):
(WebCore::ElementData::presentationAttributeStyleIsDirty):
(WebCore::ElementData::setPresentationAttributeStyleIsDirty):
(WebCore::ElementData::animatedSVGAttributesAreDirty):
(WebCore::ElementData::setAnimatedSVGAttributesAreDirty):
(WebCore::ElementData::length):
(WebCore::ElementData::attributeBase):
(WebCore::ElementData::presentationAttributeStyle):
* dom/StyledElement.cpp:
(WebCore::StyledElement::synchronizeStyleAttributeInternal):
(WebCore::StyledElement::attributeChanged):
(WebCore::StyledElement::styleAttributeChanged):
(WebCore::StyledElement::inlineStyleChanged):
(WebCore::StyledElement::rebuildPresentationAttributeStyle):
* dom/StyledElement.h:
(WebCore::StyledElement::invalidateStyleAttribute):
(WebCore::StyledElement::presentationAttributeStyle):
* svg/SVGElement.cpp:
(WebCore::SVGElement::synchronizeAnimatedSVGAttribute):
* svg/SVGElement.h:
(WebCore::SVGElement::invalidateSVGAttributes):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162274 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modernize HTML parser code
https://bugs.webkit.org/show_bug.cgi?id=127236

Reviewed by Andreas Kling.

* html/parser/AtomicHTMLToken.h:
* html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::emitRule):
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::HTMLDocumentParser):
(WebCore::HTMLDocumentParser::detach):
(WebCore::HTMLDocumentParser::stopParsing):
(WebCore::HTMLDocumentParser::pumpTokenizer):
(WebCore::HTMLDocumentParser::insert):
(WebCore::HTMLDocumentParser::append):
(WebCore::HTMLDocumentParser::resumeParsingAfterScriptExecution):
* html/parser/HTMLDocumentParser.h:
* html/parser/HTMLElementStack.cpp:
(WebCore::HTMLElementStack::ElementRecord::ElementRecord):
(WebCore::HTMLElementStack::insertAbove):
(WebCore::HTMLElementStack::pushCommon):
* html/parser/HTMLElementStack.h:
(WebCore::HTMLElementStack::ElementRecord::releaseNext):
(WebCore::HTMLElementStack::ElementRecord::setNext):
* html/parser/HTMLMetaCharsetParser.cpp:
(WebCore::HTMLMetaCharsetParser::HTMLMetaCharsetParser):
* html/parser/HTMLMetaCharsetParser.h:
* html/parser/HTMLParserScheduler.h:
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest):
(WebCore::TokenPreloadScanner::scan):
(WebCore::HTMLPreloadScanner::HTMLPreloadScanner):
* html/parser/HTMLPreloadScanner.h:
* html/parser/HTMLResourcePreloader.cpp:
(WebCore::HTMLResourcePreloader::takeAndPreload):
(WebCore::HTMLResourcePreloader::preload):
* html/parser/HTMLResourcePreloader.h:
(WebCore::PreloadRequest::PreloadRequest):
* html/parser/HTMLScriptRunner.h:
* html/parser/HTMLToken.h:
(WebCore::HTMLToken::beginDOCTYPE):
(WebCore::HTMLToken::releaseDoctypeData):
* html/parser/HTMLTokenizer.h:
* html/parser/HTMLTreeBuilder.h:
* html/parser/HTMLViewSourceParser.cpp:
(WebCore::HTMLViewSourceParser::HTMLViewSourceParser):
* html/parser/HTMLViewSourceParser.h:
* html/parser/XSSAuditor.cpp:
(WebCore::XSSAuditor::init):
(WebCore::XSSAuditor::filterToken):
* html/parser/XSSAuditor.h:
* html/parser/XSSAuditorDelegate.h:
(WebCore::XSSInfo::XSSInfo):
* loader/TextResourceDecoder.cpp:
(WebCore::TextResourceDecoder::checkForHeadCharset):
(WebCore::TextResourceDecoder::checkForMetaCharset):
* loader/TextResourceDecoder.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162275 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Replace a couple of uses of WTF::Function with std::function
https://bugs.webkit.org/show_bug.cgi?id=127218

Reviewed by Andreas Kling.

Source/WebCore:

* WebCore.exp.in:
* page/scrolling/ScrollingThread.cpp:
(WebCore::ScrollingThread::dispatch):
(WebCore::ScrollingThread::dispatchBarrier):
(WebCore::ScrollingThread::shared):
(WebCore::ScrollingThread::createThreadIfNeeded):
(WebCore::ScrollingThread::dispatchFunctionsFromScrollingThread):
* page/scrolling/ScrollingThread.h:
* page/scrolling/mac/ScrollingThreadMac.mm:
(WebCore::ScrollingThread::initializeRunLoop):

Source/WebKit2:

* Platform/IPC/mac/ConnectionMac.cpp:
(IPC::createDataAvailableSource):
* Platform/WorkQueue.h:
* Platform/mac/WorkQueueMac.cpp:
(WorkQueue::dispatch):
(WorkQueue::dispatchAfter):
* Shared/ChildProcess.cpp:
(WebKit::didCloseOnConnectionWorkQueue):
* UIProcess/Storage/LocalStorageDatabase.cpp:
(WebKit::LocalStorageDatabase::scheduleDatabaseUpdate):
* WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162276 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CodeBlock: Size m_exceptionHandlers to fit from creation.
<https://webkit.org/b/127234>

Avoid allocation churn for CodeBlock::m_exceptionHandlers.

Reviewed by Anders Carlsson.

* bytecode/CodeBlock.h:

    Removed unused CodeBlock::allocateHandlers() function.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):

    Use resizeToFit() instead of grow() for m_exceptionHandlers
    since we know it's never going to change size.

(JSC::CodeBlock::shrinkToFit):

    No need to shrink m_exceptionHandlers here since it's already
    the perfect size.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove two unused CodeBlock functions.
<https://webkit.org/b/127235>

Kill copyPostParseDataFrom() and copyPostParseDataFromAlternative()
since they are not used.

Reviewed by Anders Carlsson.

* bytecode/CodeBlock.cpp:
* bytecode/CodeBlock.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162278 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove unused CodeBlock::m_additionalIdentifiers member.
<https://webkit.org/b/127237>

Reviewed by Anders Carlsson.

* bytecode/CodeBlock.h:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::shrinkToFit):

    Remove m_additionalIdentifiers, nothing uses it.


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