1. 10 Sep, 2013 29 commits
    • oliver@apple.com's avatar
      Support WeakMap · bfcc048e
      oliver@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=120912
      
      Reviewed by Geoffrey Garen.
      
      Source/JavaScriptCore:
      
      Add support for ES6 WeakMap.  Add the cluster of boilerplate
      classes around the core WeakMapData class.
      
      WeakMapData is a simple object->value hash table that uses a
      combo of WeakReferenceHarvester to conditionally keep the weak
      value reference live, and UnconditionalFinalizer to clean the
      dead keys from the table post-GC.
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
      * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * Target.pri:
      * runtime/CommonIdentifiers.h:
      * runtime/JSGlobalObject.cpp:
      * runtime/JSGlobalObject.h:
      (JSC::JSGlobalObject::weakMapDataStructure):
      * runtime/JSWeakMap.cpp: Added.
      (JSC::JSWeakMap::finishCreation):
      (JSC::JSWeakMap::visitChildren):
      * runtime/JSWeakMap.h: Added.
      (JSC::JSWeakMap::createStructure):
      (JSC::JSWeakMap::create):
      (JSC::JSWeakMap::weakMapData):
      (JSC::JSWeakMap::JSWeakMap):
      * runtime/WeakMapConstructor.cpp: Added.
      (JSC::WeakMapConstructor::finishCreation):
      (JSC::constructWeakMap):
      (JSC::WeakMapConstructor::getConstructData):
      (JSC::WeakMapConstructor::getCallData):
      * runtime/WeakMapConstructor.h: Added.
      (JSC::WeakMapConstructor::create):
      (JSC::WeakMapConstructor::createStructure):
      (JSC::WeakMapConstructor::WeakMapConstructor):
      * runtime/WeakMapData.cpp: Added.
      (JSC::WeakMapData::WeakMapData):
      (JSC::WeakMapData::finishCreation):
      (JSC::WeakMapData::destroy):
      (JSC::WeakMapData::visitChildren):
      (JSC::WeakMapData::set):
      (JSC::WeakMapData::get):
      (JSC::WeakMapData::remove):
      (JSC::WeakMapData::contains):
      (JSC::WeakMapData::clear):
      (JSC::WeakMapData::DeadKeyCleaner::visitWeakReferences):
      (JSC::WeakMapData::DeadKeyCleaner::finalizeUnconditionally):
      * runtime/WeakMapData.h: Added.
      (JSC::WeakMapData::create):
      (JSC::WeakMapData::createStructure):
      (JSC::WeakMapData::DeadKeyCleaner::DeadKeyCleaner):
      * runtime/WeakMapPrototype.cpp: Added.
      (JSC::WeakMapPrototype::finishCreation):
      (JSC::getWeakMapData):
      (JSC::protoFuncWeakMapClear):
      (JSC::protoFuncWeakMapDelete):
      (JSC::protoFuncWeakMapGet):
      (JSC::protoFuncWeakMapHas):
      (JSC::protoFuncWeakMapSet):
      * runtime/WeakMapPrototype.h: Added.
      (JSC::WeakMapPrototype::create):
      (JSC::WeakMapPrototype::createStructure):
      (JSC::WeakMapPrototype::WeakMapPrototype):
      
      LayoutTests:
      
      Basic tests.
      
      * js/basic-weakmap-expected.txt: Added.
      * js/basic-weakmap.html: Added.
      * js/script-tests/basic-weakmap.js: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155473 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bfcc048e
    • joepeck@webkit.org's avatar
      Web Inspector: [JSC] Caught exception is treated as uncaught · cbeb7656
      joepeck@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=93607
      
      Reviewed by Geoff Garen.
      
      Source/JavaScriptCore:
      
      Check up the entire call stack to see if there is an exception handler.
      
      * interpreter/Interpreter.cpp:
      (JSC::GetExceptionHandlerFunctor::GetExceptionHandlerFunctor):
      (JSC::GetExceptionHandlerFunctor::handler):
      (JSC::GetExceptionHandlerFunctor::operator()):
      
      LayoutTests:
      
      Add tests for different inspector pause on exceptions states.
      
      * inspector-protocol/debugger/resources/exception.js: Added.
      * inspector-protocol/debugger/setPauseOnExceptions-all-expected.txt: Added.
      * inspector-protocol/debugger/setPauseOnExceptions-all.html: Added.
      * inspector-protocol/debugger/setPauseOnExceptions-none-expected.txt: Added.
      * inspector-protocol/debugger/setPauseOnExceptions-none.html: Added.
      * inspector-protocol/debugger/setPauseOnExceptions-uncaught-expected.txt: Added.
      * inspector-protocol/debugger/setPauseOnExceptions-uncaught.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155471 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cbeb7656
    • andersca@apple.com's avatar
      Clean up wtf/Noncopyable.h · de9e47e4
      andersca@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=121115
      
      Reviewed by Darin Adler.
      
      Use std::aligned_storage instead of WTF::AlignedBuffer.
      
      * wtf/NeverDestroyed.h:
      (WTF::NeverDestroyed::NeverDestroyed):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155470 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      de9e47e4
    • timothy_horton@apple.com's avatar
      [mac] PDFDocumentImage should use PDFKit to draw · c61e814f
      timothy_horton@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=120651
      <rdar://problem/12810731>
      
      Unreviewed hopeful build fix.
      
      * platform/graphics/mac/PDFDocumentImageMac.mm:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155468 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c61e814f
    • fpizlo@apple.com's avatar
      SpecType should have SpecInt48AsDouble · cc5a1186
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=121065
      
      Reviewed by Oliver Hunt.
      
      * bytecode/SpeculatedType.cpp:
      (JSC::dumpSpeculation):
      (JSC::speculationToAbbreviatedString):
      (JSC::speculationFromValue):
      * bytecode/SpeculatedType.h:
      (JSC::isInt48AsDoubleSpeculation):
      (JSC::isIntegerSpeculation):
      (JSC::isDoubleRealSpeculation):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155466 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cc5a1186
    • timothy_horton@apple.com's avatar
      [mac] PDFDocumentImage should use PDFKit to draw · 4fca9bce
      timothy_horton@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=120651
      <rdar://problem/12810731>
      
      Reviewed by Alexey Proskuryakov.
      
      Use PDFKit to draw PDF-in-<img> on Mac, so that annotations in PDF are painted.
      
      Test: fast/images/pdf-as-image-with-annotations.html
      
      * WebCore.xcodeproj/project.pbxproj:
      Add PDFDocumentImageMac.mm.
      
      * platform/graphics/cg/PDFDocumentImage.cpp:
      (WebCore::PDFDocumentImage::PDFDocumentImage):
      We don't need to initialize m_document anymore because it's now a RetainPtr.
      Initialize m_hasPage to false.
      
      (WebCore::PDFDocumentImage::~PDFDocumentImage):
      We don't need to manually release our CGPDFDocumentRef anymore because it's now a RetainPtr.
      
      (WebCore::PDFDocumentImage::size):
      Use expandedIntSize for explicitness.
      
      (WebCore::PDFDocumentImage::applyRotationForPainting):
      Rename adjustCTM to applyRotationForPainting, and move the one non-rotation related transformation out.
      We need to do this because PDFKit applies the rotation transformation itself, so we don't need to.
      Also, explicitly use std::min instead of importing the whole std namespace.
      
      (WebCore::PDFDocumentImage::dataChanged):
      Assert that we don't re-enter dataChanged after we've created a document,
      because it seems like that shouldn't happen - we only create a document when
      we've supposedly received all data, and it would be nice if we didn't have
      all this varying code to deal with SharedBuffers changing out from under each other.
      Factor the code to create a CGPDFDocumentRef out into createPDFDocument, so we can
      replace it with a different implementation that creates a PDFDocument.
      
      (WebCore::PDFDocumentImage::setCurrentPage):
      Make all page-number-related things unsigned, since they are in CG and PDFKit,
      and add m_hasPage to denote whether we've acquired a valid page yet.
      Factor code to retrieve the PDF box bounds into computeBoundsForCurrentPage.
      Remove setCurrentPage itself, as we never use a page other than the first page;
      we will call computeBoundsForCurrentPage and set hasPage in dataChanged, now.
      
      (WebCore::PDFDocumentImage::draw):
      Fix a weird comment.
      Factor code that actually draws the PDF out into drawPDFPage.
      
      The rest of the functions in this file are only built for USE(CG) && !PLATFORM(MAC):
      
      (WebCore::PDFDocumentImage::createPDFDocument):
      Factored out of dataChanged(). Use the PLATFORM(MAC) way of making a
      CGDataProvider from a SharedBuffer everywhere; we're already using it on
      iOS, and it should also work for Windows, the only other USE(CG) platform.
      Since we only createPDFDocument() after all data has been received, remove
      the comment about the SharedBuffer being secretly written to behind its back.
      
      (WebCore::PDFDocumentImage::computeBoundsForCurrentPage):
      Factored out of setCurrentPage().
      Use deg2rad since we have it.
      
      (WebCore::PDFDocumentImage::pageCount):
      (WebCore::PDFDocumentImage::drawPDFPage):
      Factored out of draw().
      Reduced an unnecessary transform (we were effectively doing mediaBox.origin - cropBox.origin - mediaBox.origin).
      
      * platform/graphics/cg/PDFDocumentImage.h:
      Unindent all the things, as we don't indent the first level inside a namespace scope.
      Forward-declare PDFDocument.
      Make m_currentPage unsigned as it should be.
      Add m_hasPage.
      Make m_document a PDFDocument on PLATFORM(MAC) and a CGPDFDocumentRef on other platforms.
      
      * platform/graphics/mac/PDFDocumentImageMac.mm: Added.
      Soft-link in PDFKit and specifically the PDFDocument class.
      
      (WebCore::PDFDocumentImage::createPDFDocument):
      Create our PDFDocument from the SharedBuffer's NSData directly. This shouldn't be a problem
      (with respect to the SharedBuffer's data being appended to in secret), because we've waited
      for the document to finish loading before getting here.
      
      (WebCore::PDFDocumentImage::computeBoundsForCurrentPage):
      Ask PDFKit for the page's media and crop boxes; it automatically performs the correct fallback.
      Ask PDFKit for the page's rotation.
      
      (WebCore::PDFDocumentImage::pageCount):
      Ask PDFKit for the page count.
      
      (WebCore::PDFDocumentImage::drawPDFPage):
      Paint the current page of the PDF. Note that we do not apply the rotation here
      via applyRotationForPainting because PDFKit will do it itself.
      Save and restore two bits of CG state which aren't saved and restored with the
      graphics state, as PDFKit can mutate them above us (<rdar://problem/14951759>).
      
      * platform/mac/SoftLinking.h:
      I couldn't find any clients of SOFT_LINK_FRAMEWORK_IN_CORESERVICES_UMBRELLA,
      so I made it the more generic SOFT_LINK_FRAMEWORK_IN_UMBRELLA, taking the name
      of the umbrella framework and the subframework, so I could use it to soft link
      Quartz.framework's PDFKit.framework.
      
      * fast/images/pdf-as-image-with-annotations-expected.html: Added.
      * fast/images/pdf-as-image-with-annotations.html: Added.
      * fast/images/resources/annotation.pdf: Added.
      Add a test that ensures that PDF-in-<img> draws simple annotations.
      
      * platform/mac/fast/images/pdf-as-image-landscape-expected.png:
      * platform/mac/fast/images/pdf-as-image-landscape-expected.txt:
      Extremely minor rebaselines probably due to PDFKit handling rotation in the new implementation.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155461 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4fca9bce
    • timothy_horton@apple.com's avatar
      [mac] <progress> has rendering artifacts along the bottom · 17363f61
      timothy_horton@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=120865
      <rdar://problem/11571240>
      
      Reviewed by Simon Fraser.
      
      Allow RenderTheme to force the height of a <progress> bar.
      
      Test: platform/mac/fast/forms/indeterminate-progress-inline-height.html
      
      * rendering/RenderProgress.cpp:
      (WebCore::RenderProgress::computeLogicalHeight):
      Borrowed from RenderMeter, allow the theme to override the size of the progress bar.
      
      * rendering/RenderProgress.h:
      Drive-by add OVERRIDE to a few things.
      
      * rendering/RenderTheme.cpp:
      (WebCore::RenderTheme::progressBarRectForBounds):
      * rendering/RenderTheme.h:
      Add a default implementation of progressBarRectForBounds that just passes the bounds through.
      
      * rendering/RenderThemeMac.h:
      * rendering/RenderThemeMac.mm:
      (WebCore::RenderThemeMac::progressBarRectForBounds):
      Override progressBarRectForBounds; the implementation is factored out of paintProgressBar.
      
      (WebCore::RenderThemeMac::paintProgressBar):
      Make use of the factored-out progressBarRectForBounds().
      
      Drive-by apply the device scale factor to the progress bar's image buffer,
      so that it is rendered at 2x on appropriate hardware. Also, multiply the
      progress animation phase by the device scale factor, as the phase value seems
      to be proportional to the actual pixel offset of the animation; without this,
      the animation would appear to progress half as slowly in HiDPI.
      
      Add a Mac-specific test that an unstyled indeterminate progress bar
      overrides its specified height with its fixed system height.
      
      * platform/mac/fast/forms/indeterminate-progress-inline-height-expected.txt: Added.
      * platform/mac/fast/forms/indeterminate-progress-inline-height.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155460 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      17363f61
    • svillar@igalia.com's avatar
      [WK2][GTK] Frequent crashes when showing context menus in Debug builds · 963a3e9b
      svillar@igalia.com authored
      https://bugs.webkit.org/show_bug.cgi?id=121099
      
      Reviewed by Carlos Garcia Campos.
      
      Disconnect signal handlers when destroying the context menu proxy
      object. This avoids use-after-free crashes when opening several
      context menus in a row.
      
      * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
      (WebKit::WebContextMenuProxyGtk::append):
      (WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk):
      * UIProcess/gtk/WebContextMenuProxyGtk.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      963a3e9b
    • cfleizach@apple.com's avatar
      AX: Expose DOM ID and ClassList to AX APIs for automation and AT element hashes · 3032b24a
      cfleizach@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=120552
      
      Reviewed by Darin Adler.
      
      Source/WebCore: 
      
      Add Mac support for exposing the DOM ID and DOM class list so that accessibility
      clients can leverage that information.
      
      Test: platform/mac/accessibility/id-class-attributes.html
      
      * accessibility/AccessibilityObject.cpp:
      (WebCore::AccessibilityObject::domIdentifier):
      (WebCore::AccessibilityObject::domClassList):
      * accessibility/AccessibilityObject.h:
      * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
      (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
      (convertStringsToNSArray):
      (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
      
      Tools: 
      
      * DumpRenderTree/AccessibilityUIElement.cpp:
      (getClassListCallback):
      (AccessibilityUIElement::getJSClass):
      * DumpRenderTree/AccessibilityUIElement.h:
      * DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
      (AccessibilityUIElement::classList):
      * DumpRenderTree/blackberry/AccessibilityUIElementBlackBerry.cpp:
      (AccessibilityUIElement::classList):
      * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
      (AccessibilityUIElement::classList):
      * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
      (AccessibilityUIElement::classList):
      * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
      (WTR::AccessibilityUIElement::classList):
      * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
      * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
      * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
      (WTR::AccessibilityUIElement::classList):
      * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
      (WTR::AccessibilityUIElement::classList):
      
      LayoutTests: 
      
      Tests that output all attributes need to be updated, since the DOM ID and DOM
      class list are new on all elements.
      
      * accessibility/transformed-element-expected.txt:
      * platform/mac/accessibility/aria-columnrowheaders-expected.txt:
      * platform/mac/accessibility/bounds-for-range-expected.txt:
      * platform/mac/accessibility/document-attributes-expected.txt:
      * platform/mac/accessibility/document-links-expected.txt:
      * platform/mac/accessibility/id-class-attributes-expected.txt: Added.
      * platform/mac/accessibility/id-class-attributes.html: Added.
      * platform/mac/accessibility/image-link-expected.txt:
      * platform/mac/accessibility/image-map2-expected.txt:
      * platform/mac/accessibility/internal-link-anchors-expected.txt:
      * platform/mac/accessibility/internal-link-anchors2-expected.txt:
      * platform/mac/accessibility/lists-expected.txt:
      * platform/mac/accessibility/plugin-expected.txt:
      * platform/mac/accessibility/radio-button-group-members-expected.txt:
      * platform/mac/accessibility/table-attributes-expected.txt:
      * platform/mac/accessibility/table-cell-spans-expected.txt:
      * platform/mac/accessibility/table-cells-expected.txt:
      * platform/mac/accessibility/table-detection-expected.txt:
      * platform/mac/accessibility/table-one-cell-expected.txt:
      * platform/mac/accessibility/table-sections-expected.txt:
      * platform/mac/accessibility/table-with-aria-role-expected.txt:
      * platform/mac/accessibility/table-with-rules-expected.txt:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155458 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3032b24a
    • fpizlo@apple.com's avatar
      Don't GC while in the OSR-triggered jettison code · 9822549d
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=121106
      
      Reviewed by Mark Hahnenberg.
      
      * dfg/DFGOperations.cpp:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155457 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9822549d
    • commit-queue@webkit.org's avatar
      [GTK] accessibility/loading-iframe-sends-notification.html is failing · aa8aa2a5
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=98370
      
      Patch by Denis Nomiyama <d.nomiyama@samsung.com> on 2013-09-10
      Reviewed by Chris Fleizach.
      
      Source/WebCore:
      
      Enabled AXLayoutComplete on the GTK platform.
      
      No new tests are required because this feature will use an existing
      accessibility layout test that is currently failing on the GTK+ platform
      (e.g. loading-iframe-sends-notification.html).
      
      * accessibility/atk/AXObjectCacheAtk.cpp:
      (WebCore::AXObjectCache::postPlatformNotification): Send layout-complete
      signal in case of AXLayoutComplete.
      * dom/Document.cpp:
      (WebCore::Document::implicitClose): Enabled AXLayoutComplete on the GTK
      platform.
      * page/FrameView.cpp:
      (WebCore::FrameView::layout): Enabled AXLayoutComplete on the GTK
      platform.
      
      Tools:
      
      Added AXLayoutComplete for the GTK platform.
      
      * DumpRenderTree/atk/AccessibilityCallbacksAtk.cpp:
      (axObjectEventListener): Added notification AXLayoutComplete for
      layout-complete signal.
      
      LayoutTests:
      
      Changed the expectation of the loading iframe notification test in
      accessibility, which was failing before this fix on the GTK+
      platform.
      
      * platform/gtk/TestExpectations: Changed the expectation of the loading
      iframe notification test in accessibility.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155456 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      aa8aa2a5
    • fpizlo@apple.com's avatar
      jsc commandline's run() function should take extra arguments · bb00ed52
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=121098
      
      Reviewed by Michael Saboff.
      
      * jsc.cpp:
      (functionRun):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155455 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bb00ed52
    • bfulgham@apple.com's avatar
      Source/WebCore: [Windows] Change from using OwnPtr<GDI Stuff> to new GDIObject template. · 283b393b
      bfulgham@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=120778
      
      Reviewed by Anders Carlsson.
      
      Change code to use a GDI-specific smart pointer, rather than OwnPtr. This
      is a first step to simplifying OwnPtr. It also gets rid of some Windows-
      specific code in WTF.
      
      * WebCore.vcxproj/WebCore.vcxproj: Add the new header file.
      * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
      * page/win/FrameCGWin.cpp:
      (WebCore::imageFromRect): Switch to GDIObject.
      * page/win/FrameCairoWin.cpp:
      (WebCore::imageFromRect): Switch to GDIObject.
      * page/win/FrameWin.cpp:
      (WebCore::imageFromSelection): Switch to GDIObject.
      (WebCore::Frame::dragImageForSelection): Ditto.
      (WebCore::Frame::nodeImage): Ditto.
      * page/win/FrameWin.h:
      * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
      (WebCore::getDirtyRects): Switch from OwnPtr to GDIObject.
      * platform/graphics/win/FontCacheWin.cpp:
      (WebCore::createGDIFont): Switch to GDIObject.
      (WebCore::FontCache::createFontPlatformData): Ditto.
      * platform/graphics/win/FontCustomPlatformData.cpp:
      (WebCore::FontCustomPlatformData::fontPlatformData): Switch to GDIObject.
      * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
      (WebCore::FontCustomPlatformData::fontPlatformData): Switch to GDIObject.
      * platform/graphics/win/GraphicsContextCGWin.cpp:
      (WebCore::GraphicsContext::releaseWindowsContext): Switch to GDIObject.
      * platform/graphics/win/GraphicsContextCairoWin.cpp:
      (WebCore::GraphicsContext::releaseWindowsContext): Switch to GDIObject.
      * platform/graphics/win/GraphicsContextWin.cpp:
      (WebCore::GraphicsContext::getWindowsContext): Switch to GDIObject.
      * platform/graphics/win/SimpleFontDataWin.cpp:
      (WebCore::SimpleFontData::platformCreateScaledFontData): Switch to GDIObject.
      * platform/win/CursorWin.cpp:
      (WebCore::createSharedCursor): Switch to GDIObject.
      * platform/win/DragImageCGWin.cpp:
      (WebCore::scaleDragImage): Switch to GDIObject.
      (WebCore::createDragImageFromImage):
      * platform/win/DragImageCairoWin.cpp: 
      (WebCore::scaleDragImage): Switch to GDIObject.
      (WebCore::createDragImageFromImage): Ditto.
      * platform/win/DragImageWin.cpp:
      (WebCore::createDragImageForLink): Switch to GDIObject.
      * platform/win/PasteboardWin.cpp:
      (WebCore::Pasteboard::writeImage): Switch to GDIObject.
      * platform/win/ScrollbarThemeWin.cpp:
      (WebCore::ScrollbarThemeWin::paintTrackPiece): Switch to GDIObject.
      * plugins/win/PluginViewWin.cpp:
      (WebCore::PluginView::updatePluginWidget): Switch to GDIObject.
      (WebCore::PluginView::snapshot): Ditto.
      * rendering/RenderThemeWin.cpp:
      (WebCore::drawControl): Switch to GDIObject.
      
      Source/WebKit/win: [Windows] Change from using OwnPtr<GDI Stuff> to new GDIObject template.
      https://bugs.webkit.org/show_bug.cgi?id=120778
      
      Reviewed by Anders Carlsson.
      
      * FullscreenVideoController.cpp:
      (FullscreenVideoController::createHUDWindow): Switch to GDIObject.
      (FullscreenVideoController::draw): Ditto.
      * FullscreenVideoController.h:
      * WebCoreSupport/EmbeddedWidget.cpp:
      (EmbeddedWidget::frameRectsChanged): Switch to GDIObject.
      * WebNodeHighlight.cpp:
      (WebNodeHighlight::update): Switch to GDIObject.
      * WebView.cpp:
      (WebView::scrollBackingStore): Switch to GDIObject.
      (WebView::updateBackingStore): Ditto.
      (WebView::performLayeredWindowUpdate): Ditto.
      (WebView::paint): Ditto.
      (WebView::paintIntoBackingStore): Ditto.
      (WebView::paintIntoWindow): Ditto.
      (WebView::generateSelectionImage): Ditto.
      
      Source/WTF: [Windows] Change from using OwnPtr<GDI Stuff> to new GDIObject template.
      https://bugs.webkit.org/show_bug.cgi?id=120778
      
      Reviewed by Anders Carlsson.
      
      * WTF.vcxproj/WTF.vcxproj: Add new GDIObject header file.
      * WTF.vcxproj/WTF.vcxproj.filters: Ditto.
      * WTF.vcxproj/copy-files.cmd: Copy new header file.
      * wtf/OwnPtrCommon.h: Remove some GDI specializations.
      * wtf/win/GDIObject.h: Added.
      (WTF::GDIObject::GDIObject):
      (WTF::GDIObject::~GDIObject):
      (WTF::GDIObject::get):
      (WTF::GDIObject::operator!):
      (WTF::GDIObject::operator UnspecifiedBoolType):
      (WTF::GDIObject::operator=):
      (WTF::GDIObject::swap):
      (WTF::::clear):
      (WTF::::leak):
      (WTF::::GDIObject):
      (WTF::=):
      (WTF::adoptGDIObject):
      (WTF::swap):
      (WTF::T):
      (WTF::HDC):
      * wtf/win/OwnPtrWin.cpp:
      (WTF::deleteOwnedPtr): Remove some GDI specializations.
      
      Tools: [Windows] Change from using OwnPtr<GDI Stuff> to new GDIObject.
      https://bugs.webkit.org/show_bug.cgi?id=120778
      
      Reviewed by Anders Carlsson.
      
      * DumpRenderTree/win/PixelDumpSupportWin.cpp:
      (createBitmapContextFromWebView): Use GDIObject.
      * Scripts/webkitpy/style/checkers/cpp.py:
      (check_for_leaky_patterns): Update for GDIObject instead of adoptPtr and OwnPtr.
      * Scripts/webkitpy/style/checkers/cpp_unittest.py:
      (LeakyPatternTest.test_create_dc): Update for GDIObject instead of adoptPtr/OwnPtr.
      (LeakyPatternTest.test_create_compatible_dc): Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155454 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      283b393b
    • allan.jensen@digia.com's avatar
      REGRESSION (r147454): Youtube annotation links to new window broken · 8379c0b4
      allan.jensen@digia.com authored
      https://bugs.webkit.org/show_bug.cgi?id=114242
      
      Reviewed by Anders Carlsson.
      
      Set the UserGestureIndicator to allow popups the same way the issue was solved for WebKit2.
      
      * plugins/PluginView.cpp:
      (WebCore::PluginView::performRequest):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155447 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8379c0b4
    • kov@webkit.org's avatar
      Updated Spanish translation for WebKitGtk+ · 52474415
      kov@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=121032
      
      Patch by Daniel Mustieles <daniel.mustieles@gmail.com> on 2013-09-10
      Reviewed by Gustavo Noronha.
      
      * es.po: updated.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155441 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      52474415
    • kov@webkit.org's avatar
      [l10n] [pt_BR] Updated Brazilian Portuguese translation of WebKitGTK+ · 144df36d
      kov@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=120642
      
      Patch by Enrico Nicoletto <liverig@gmail.com> on 2013-09-10
      Reviewed by Gustavo Noronha.
      
      * pt_BR.po: updated.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155439 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      144df36d
    • berto@igalia.com's avatar
      [GTK] The code generator produces a warning if a parameter can be NULL · fef54e48
      berto@igalia.com authored
      https://bugs.webkit.org/show_bug.cgi?id=121093
      
      Reviewed by Christophe Dumez.
      
      Return an empty string instead of an undefined value if a
      particular parameter doesn't need to be checked.
      
      * bindings/scripts/CodeGeneratorGObject.pm:
      (GetGReturnMacro):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155435 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fef54e48
    • commit-queue@webkit.org's avatar
      MediaStream API: Enhance MediaStreamDescriptor add/remove component · b9c94a6b
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=120874
      
      Merge blink https://chromium.googlesource.com/chromium/blink/+/67fcacf13ce922a762d7a1c6fb9e1b8e51e662ea
      
      Patch by Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> on 2013-09-10
      Reviewed by Eric Carlson.
      
      No new tests needed.
      
      * Modules/mediastream/MediaStream.cpp:
      (WebCore::MediaStream::addTrack):
      (WebCore::MediaStream::removeTrack):
      (WebCore::MediaStream::addRemoteTrack):
      (WebCore::MediaStream::removeRemoteTrack):
      * platform/mediastream/MediaStreamDescriptor.h:
      (WebCore::MediaStreamDescriptor::addRemoteTrack):
      (WebCore::MediaStreamDescriptor::removeRemoteTrack):
      (WebCore::MediaStreamDescriptor::addComponent):
      (WebCore::MediaStreamDescriptor::removeComponent):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155434 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b9c94a6b
    • allan.jensen@digia.com's avatar
      [Qt] make use of qtHaveModule() · eff400f7
      allan.jensen@digia.com authored
      https://bugs.webkit.org/show_bug.cgi?id=121090
      
      Reviewed by Jocelyn Turcotte.
      
      Use qtHaveModule instead of our own haveQtModule.
      
      Source/WebKit2:
      
      * WebProcess.pro:
      
      Tools:
      
      * QtTestBrowser/QtTestBrowser.pro:
      * qmake/mkspecs/features/configure.prf:
      * qmake/mkspecs/features/features.prf:
      * qmake/mkspecs/features/functions.prf:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155433 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      eff400f7
    • carlosgc@webkit.org's avatar
      [GTK] /webkit2/WebKitWebView/default-menu fails when... · dca460c4
      carlosgc@webkit.org authored
      [GTK] /webkit2/WebKitWebView/default-menu fails when GtkSettings:gtk-show-input-method-menu is disabled
      https://bugs.webkit.org/show_bug.cgi?id=121088
      
      Reviewed by Xan Lopez.
      
      * UIProcess/API/gtk/tests/TestContextMenu.cpp: Always check
      Unicode submenu is present in default context menu for editable
      content.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155430 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      dca460c4
    • akling@apple.com's avatar
      toFooElement() should use static_cast, not reinterpret_cast. · e8e317ba
      akling@apple.com authored
      <https://webkit.org/b/121087>
      
      Reviewed by Antti Koivisto.
      
      reinterpret_cast is not safe for downcasting with multiple inheritance.
      Add a ELEMENT_TYPE_CASTS(classname) macro that goes after class definitions.
      It expands into the following methods:
      
          - FooElement* toFooElement(Node*)
          - const FooElement* toFooElement(const Node*)
          - FooElement& toFooElement(Node&)
          - const FooElement& toFooElement(const Node&)
      
      As a bonus, it also adds these to catch unnecessary casting:
      
          - void toFooElement(const Node*)
          - void toFooElement(const Node&)
      
      There might be a more clever way of doing this, but this gets us to a
      correct place so we can think in peace.
      
      * bridge/qt/qt_pixmapruntime.cpp:
      (JSC::Bindings::assignToHTMLImageElement):
      (JSC::Bindings::QtPixmapRuntime::toQt):
      * dom/Element.h:
      (WebCore::isElement):
      * dom/make_names.pl:
      (printTypeHelpers):
      * html/HTMLAnchorElement.h:
      * html/HTMLAreaElement.h:
      * html/HTMLAudioElement.h:
      * html/HTMLBaseElement.h:
      * html/HTMLCanvasElement.h:
      * html/HTMLElement.h:
      (WebCore::isHTMLElement):
      * html/HTMLFieldSetElement.h:
      * html/HTMLFormElement.h:
      * html/HTMLFrameSetElement.h:
      * html/HTMLImageElement.h:
      * html/HTMLInputElement.h:
      * html/HTMLLabelElement.h:
      * html/HTMLLegendElement.h:
      * html/HTMLMapElement.h:
      * html/HTMLMeterElement.h:
      * html/HTMLOptGroupElement.h:
      * html/HTMLOptionElement.h:
      * html/HTMLParamElement.h:
      * html/HTMLProgressElement.h:
      * html/HTMLScriptElement.h:
      * html/HTMLSourceElement.h:
      * html/HTMLStyleElement.h:
      * html/HTMLTableElement.h:
      * html/HTMLTableRowElement.h:
      * html/HTMLTextAreaElement.h:
      * html/HTMLTitleElement.h:
      * html/HTMLTrackElement.h:
      * svg/SVGAltGlyphDefElement.h:
      * svg/SVGAltGlyphElement.h:
      * svg/SVGAltGlyphItemElement.h:
      * svg/SVGAnimateMotionElement.h:
      * svg/SVGAnimateTransformElement.h:
      * svg/SVGCircleElement.h:
      * svg/SVGClipPathElement.h:
      * svg/SVGCursorElement.h:
      * svg/SVGEllipseElement.h:
      * svg/SVGFEDistantLightElement.h:
      * svg/SVGFEFuncAElement.h:
      * svg/SVGFEFuncBElement.h:
      * svg/SVGFEFuncGElement.h:
      * svg/SVGFEFuncRElement.h:
      * svg/SVGFEMergeNodeElement.h:
      * svg/SVGFEPointLightElement.h:
      * svg/SVGFESpotLightElement.h:
      * svg/SVGFilterElement.h:
      * svg/SVGFontElement.h:
      * svg/SVGFontFaceElement.h:
      * svg/SVGFontFaceNameElement.h:
      * svg/SVGFontFaceSrcElement.h:
      * svg/SVGFontFaceUriElement.h:
      * svg/SVGForeignObjectElement.h:
      * svg/SVGGlyphElement.h:
      * svg/SVGGlyphRefElement.h:
      * svg/SVGHKernElement.h:
      * svg/SVGImageElement.h:
      * svg/SVGLineElement.h:
      * svg/SVGLinearGradientElement.h:
      * svg/SVGMPathElement.h:
      * svg/SVGMarkerElement.h:
      * svg/SVGMaskElement.h:
      * svg/SVGMissingGlyphElement.h:
      * svg/SVGPathElement.h:
      * svg/SVGPatternElement.h:
      * svg/SVGRadialGradientElement.h:
      * svg/SVGRectElement.h:
      * svg/SVGSVGElement.h:
      * svg/SVGScriptElement.h:
      * svg/SVGStyleElement.h:
      * svg/SVGTextElement.h:
      * svg/SVGTextPathElement.h:
      * svg/SVGTitleElement.h:
      * svg/SVGUseElement.h:
      * svg/SVGVKernElement.h:
      * svg/SVGViewElement.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155429 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e8e317ba
    • mario@webkit.org's avatar
      [GTK] Test /webkit/atk/getTextInParagraphAndBodyModerate fails · f47e59bc
      mario@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=105538
      
      Reviewed by Chris Fleizach.
      
      Source/WebCore:
      
      Expose '\n' for linebreaks when they were explicitly set by the
      author of the web content with a <br> tag.
      
      Tests: accessibility/paragraph-with-linebreaks.html
      
      * accessibility/AccessibilityNodeObject.cpp:
      (WebCore::shouldAddSpaceBeforeAppendingNextElement): Helper
      function to decide when to append spaces when building the text
      under an element, considering line breaks.
      (WebCore::AccessibilityNodeObject::textUnderElement): Use the
      shouldAddSpaceBeforeAppendingNextElement() function here.
      * accessibility/AccessibilityRenderObject.cpp:
      (WebCore::AccessibilityRenderObject::textUnderElement): Return the
      renderer's text for accessibility objects exposing <br> elements.
      * html/parser/HTMLParserIdioms.h:
      (WebCore::isHTMLSpaceButNotLineBreak): New helper function, useful
      to be passed to other functions like simplifyWhiteSpace().
      
      Tools:
      
      Unskip passing test getTextInParagraphAndBodyModerate.
      
      * Scripts/run-gtk-tests:
      (TestRunner): Unskip pasing test.
      
      LayoutTests:
      
      Added new Layout test and platform specific expectations.
      
      * platform/efl/accessibility/paragraph-with-linebreaks-expected.txt: Added.
      * platform/gtk/accessibility/paragraph-with-linebreaks-expected.txt: Added.
      * accessibility/paragraph-with-linebreaks.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f47e59bc
    • a.bah@samsung.com's avatar
      When deleting editable content, typing style should be reset when moving into another node. · 305f6858
      a.bah@samsung.com authored
      https://bugs.webkit.org/show_bug.cgi?id=120726
      
      Reviewed by Ryosuke Niwa.
      
      Source/WebCore:
      
      When moving from one text node to the other, while deleting characters,
      the deleted text node's style was being applied to any new characters
      added into the existing text node.
      
      Typing Style in the frame selection maintains the editing style for the
      deleted text node, so that if new characters are inserted at the position
      of the deleted text node, it's style can be applied to them.
      
      However, when moving into another text node, we should reset or clear the
      typing style maintained by the frame selection. This ensures that any new
      content inserted within the existing node does not take on any uncleared
      style of the deleted node.
      
      Test: editing/deleting/maintain-style-after-delete.html
      
      * editing/DeleteSelectionCommand.cpp:
      (WebCore::DeleteSelectionCommand::saveTypingStyleState):
      Calling clearTypingStyle() on frame selection whenever deletion occurs
      within the same text node. Thus any existing typing styleh held by the
      frame selection shall be cleared.
      
      LayoutTests:
      
      * editing/deleting/maintain-style-after-delete-expected.txt: Added.
      * editing/deleting/maintain-style-after-delete.html: Added.
      Testcase added for verifying that style of the text node being deleted
      is maintained.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155425 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      305f6858
    • darin@apple.com's avatar
      Some refinements in FrameView::layout · 630f808c
      darin@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=121076
      
      Reviewed by Andreas Kling.
      
      * page/FrameView.cpp:
      (WebCore::FrameView::layout): Use a reference for the document in
      this function since code assumes it's non-null anyway. Change code to
      only call styleResolverIfExists once. Rewrite comments about blocks
      and the scopes they create for better clarity. Make m_nestedLayoutCount
      easier to read. Use HTMLElement* for the pointer to the body element.
      Moved the call to calculateScrollbarModesForLayout in so we don't
      waste time doing it for subtree layouts. Get rid of the unhelpful
      currentHMode and currentVMode local variables. Get rid of an extra
      block scope we did not need.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155424 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      630f808c
    • commit-queue@webkit.org's avatar
      Adding "explicit" keyword in DOM related classes constructor · 8296217f
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=121031
      
      Patch by Santosh Mahto <santosh.ma@samsung.com> on 2013-09-09
      Reviewed by Ryosuke Niwa.
      
      Added the explicit keyword in constructors.
      
      * dom/ActiveDOMObject.h:
      * dom/ContainerNode.h:
      * dom/DocumentStyleSheetCollection.h:
      * dom/ElementAncestorIterator.h:
      * dom/ElementData.h:
      * dom/ElementRareData.h:
      * dom/EventListenerMap.h:
      * dom/QualifiedName.h:
      (WebCore::QualifiedName::QualifiedName):
      * dom/TreeScope.h:
      * dom/ViewportArguments.h:
      (WebCore::ViewportArguments::ViewportArguments):
      * dom/VisitedLinkState.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155422 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8296217f
    • akling@apple.com's avatar
      Remove unreviewed gunk I just accidentally committed :| · 8f0c0acb
      akling@apple.com authored
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155421 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8f0c0acb
    • msaboff@apple.com's avatar
      There should be one "invalid" virtual register constant · df938367
      msaboff@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=121057
      
      Reviewed by Filip Pizlo.
      
      Unify all references to an invalid virtual register to be the enum InvalidVirtualRegister.
      Changed the value of InvalidVirtualRegister to be maximum integer value.
      
      * bytecode/CodeBlock.h:
      (JSC::CodeBlock::setArgumentsRegister):
      (JSC::CodeBlock::usesArguments):
      * bytecode/LazyOperandValueProfile.h:
      (JSC::LazyOperandValueProfileKey::LazyOperandValueProfileKey):
      (JSC::LazyOperandValueProfileKey::operator!):
      (JSC::LazyOperandValueProfileKey::isHashTableDeletedValue):
      (JSC::LazyOperandValueProfile::LazyOperandValueProfile):
      * bytecode/UnlinkedCodeBlock.cpp:
      (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
      * bytecode/UnlinkedCodeBlock.h:
      (JSC::UnlinkedCodeBlock::usesArguments):
      (JSC::UnlinkedCodeBlock::usesGlobalObject):
      * bytecode/VirtualRegister.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155420 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      df938367
    • akling@apple.com's avatar
      HTMLTextAreaElement no longer needs custom style resolve callbacks. · e35c9ea9
      akling@apple.com authored
      <https://webkit.org/b/121073>
      
      Reviewed by Ryosuke Niwa.
      
      After r155408 HTMLTextAreaElement doesn't override didAttachRenderer() anymore,
      so we don't need to fire callbacks on textarea elements during style resolve.
      
      * html/HTMLTextAreaElement.cpp:
      (WebCore::HTMLTextAreaElement::HTMLTextAreaElement):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155419 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e35c9ea9
    • msaboff@apple.com's avatar
      Change virtual register function arguments from unsigned to int · 7535bbdc
      msaboff@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=121055
      
      Reviewed by Filip Pizlo.
      
      This is a largely mechanical change.  This changes function paramaters and local variables used to
      represent bytecode operands from being unsigned to be int.
      
      * bytecode/CodeOrigin.h:
      * dfg/DFGByteCodeParser.cpp:
      * jit/JIT.h:
      * jit/JITArithmetic.cpp:
      * jit/JITArithmetic32_64.cpp:
      * jit/JITInlines.h:
      * jit/JITOpcodes.cpp:
      * jit/JITOpcodes32_64.cpp:
      * jit/JITPropertyAccess.cpp:
      * jit/JITPropertyAccess32_64.cpp:
      * jit/JITStubCall.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155418 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7535bbdc
  2. 09 Sep, 2013 11 commits
    • akling@apple.com's avatar
      ScriptController should have a Frame& internally. · 4d5bc95f
      akling@apple.com authored
      <https://webkit.org/b/121071>
      
      Reviewed by Anders Carlsson.
      
      Change ScriptController::m_frame to a reference since it's tied to
      the lifetime of the owning Frame.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155417 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4d5bc95f
    • akling@apple.com's avatar
      ScriptRunner should have a Document& internally. · 7457a984
      akling@apple.com authored
      <https://webkit.org/b/121072>
      
      Reviewed by Anders Carlsson.
      
      Change ScriptRunner::m_document to a reference since it's tied to
      the lifetime of the Document.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155416 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7457a984
    • msaboff@apple.com's avatar
      Add local to/from operand helpers similar to argument to/from operand2 · 1a5f13c8
      msaboff@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=121056
      
      Reviewed by Geoffrey Garen.
      
      Added localToOperand(), operandToLocal() and operandIsLocal() to Operands.h, very similar to
      argumentToOperand(), et al.  Used the new helpers everywhere where an index into a data
      structure is intended instead of the actual virtual register offset.  When the stack is
      changed to grow down, local register offsets can be negative.  Also added the helper
      DFG::SpeculativeJIT::generationInfoFromVirtualRegister() for the common case accessing 
      m_generationInfo[operandToLocal(val)].
      
      * bytecode/CodeBlock.cpp:
      * bytecode/CodeBlock.h:
      * bytecode/Operands.h:
      (JSC::localToOperand):
      (JSC::operandIsLocal):
      (JSC::operandToLocal):
      * bytecompiler/BytecodeGenerator.h:
      * dfg/DFGAbstractInterpreterInlines.h:
      * dfg/DFGByteCodeParser.cpp:
      * dfg/DFGCFGSimplificationPhase.cpp:
      * dfg/DFGCPSRethreadingPhase.cpp:
      * dfg/DFGOSREntry.cpp:
      * dfg/DFGOSRExitCompiler32_64.cpp:
      * dfg/DFGOSRExitCompiler64.cpp:
      * dfg/DFGScoreBoard.h:
      * dfg/DFGSpeculativeJIT.cpp:
      * dfg/DFGSpeculativeJIT.h:
      (JSC::DFG::SpeculativeJIT::generationInfoFromVirtualRegister):
      * dfg/DFGSpeculativeJIT32_64.cpp:
      * dfg/DFGSpeculativeJIT64.cpp:
      * dfg/DFGValidate.cpp:
      * dfg/DFGVariableEventStream.cpp:
      * dfg/DFGVirtualRegisterAllocationPhase.cpp:
      * jit/JITInlines.h:
      * jit/JITOpcodes.cpp:
      * jit/JITOpcodes32_64.cpp:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1a5f13c8
    • akling@apple.com's avatar
      Ref-ify more stack guards. · a34e5223
      akling@apple.com authored
      <https://webkit.org/b/121070>
      
      Rubber-stamped by Anders Carlsson.
      
      RefPtr<Foo> protect(this) => Ref<Foo> protect(*this).
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155414 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a34e5223
    • fpizlo@apple.com's avatar
      Unreviewed, disable GC logging. · ebccac0b
      fpizlo@apple.com authored
      * heap/Heap.cpp:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155413 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ebccac0b
    • akling@apple.com's avatar
      Generate more SVG type checks and conversions. · 3d1b2238
      akling@apple.com authored
      <https://webkit.org/b/121066>
      
      Reviewed by Anders Carlsson.
      
      Switch another slew of SVG elements to auto-generated isFooElement()
      and toFooElement() helpers.
      
      Removed now-unnecessary casts and assertions as appropriate.
      Converted some simple loops to childrenOfType iteration instead of
      traversing child Nodes.
      
      PS. This patch also adds const versions of toFooElement().
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155412 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3d1b2238
    • dino@apple.com's avatar
      [WebGL] Allow multithreaded OpenGL contexts · 1642b092
      dino@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=121062
      
      Reviewed by Simon Fraser.
      
      Expose a new preference "multithreadedWebGLEnabled".
      
      Source/WebCore:
      
      Also examine the value of that preference and, on Mac,
      tell the CGLContext that it should go to multithreaded mode.
      
      * html/canvas/WebGLRenderingContext.cpp:
      (WebCore::WebGLRenderingContext::create): Look at the value of the new setting, and
      toggle a flag on the context attributes.
      * page/Settings.in: New Setting "multithreadedWebGLEnabled".
      * platform/graphics/GraphicsContext3D.h:
      (WebCore::GraphicsContext3D::Attributes::Attributes): Add a "multithreaded" flag.
      * platform/graphics/mac/GraphicsContext3DMac.mm:
      (WebCore::GraphicsContext3D::GraphicsContext3D): If the context attributes
      suggest we should, tell the OpenGL context to go into multithreaded mode.
      
      Source/WebKit/mac:
      
      * WebView/WebPreferenceKeysPrivate.h:
      * WebView/WebPreferences.mm:
      (+[WebPreferences initialize]):
      (-[WebPreferences multithreadedWebGLEnabled]):
      (-[WebPreferences setMultithreadedWebGLEnabled:]):
      * WebView/WebPreferencesPrivate.h:
      * WebView/WebView.mm:
      (-[WebView _preferencesChanged:]):
      
      Source/WebKit2:
      
      * Shared/WebPreferencesStore.h:
      * UIProcess/API/C/WKPreferences.cpp:
      (WKPreferencesSetMultithreadedWebGLEnabled):
      (WKPreferencesGetMultithreadedWebGLEnabled):
      * UIProcess/API/C/WKPreferencesPrivate.h:
      * WebProcess/WebPage/WebPage.cpp:
      (WebKit::WebPage::updatePreferences):
      * mac/WebKit2.order:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155409 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1642b092
    • rniwa@webkit.org's avatar
      Remove HTMLTextFormControl::fixPlaceholderRenderer · 8e64dda9
      rniwa@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=121058
      
      Reviewed by Kent Tamura.
      
      Source/WebCore: 
      
      HTMLTextFormControl::fixPlaceholderRenderer was added in r118733 to swap the order in which placeholder appears.
      Namely, when a text form control element is focused, placeholder should be rendered behind the text for the caret
      to render on top of, not behind, the placeholder text.  However, we can achieve the same effect by changing
      the order of elements in the shadow DOM instead of manually manipuating the render tree as the assertion failure
      mentioned in the change log is a bogus one.
      
      Cleaned up the code by removing HTMLTextFormControl::fixPlaceholderRenderer and changed the order in which inner
      text element and placeholder element appear. Also fixed the assertion in Position's constructor.
      
      * dom/Position.cpp:
      (WebCore::Position::Position): The original assertion was bogus. What we don't want have is for a Position to be
      before or after a shadow root. It's fine for it be anchroed against the shadow root as long as it's inside.
      
      * html/HTMLTextAreaElement.cpp:
      (WebCore::HTMLTextAreaElement::updatePlaceholderText): Insert the placeholder before the inner text element.
      * html/HTMLTextAreaElement.h:
      * html/HTMLTextFormControlElement.cpp:
      * html/HTMLTextFormControlElement.h:
      * html/TextFieldInputType.cpp:
      (WebCore::TextFieldInputType::updatePlaceholderText): Ditto.
      * html/TextFieldInputType.h:
      
      LayoutTests: 
      
      Rebaseline tests now that the placeholder appears before the inner text element.
      
      * fast/forms/placeholder-position-expected.txt:
      * platform/mac/fast/forms/input-placeholder-visibility-1-expected.txt:
      * platform/mac/fast/forms/input-placeholder-visibility-3-expected.txt:
      * platform/mac/fast/forms/textarea-placeholder-pseudo-style-expected.txt:
      * platform/mac/fast/forms/textarea-placeholder-visibility-1-expected.txt:
      * platform/mac/fast/forms/textarea-placeholder-visibility-2-expected.txt:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155408 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8e64dda9
    • andersca@apple.com's avatar
      Introduce WTF::createOwned · 238bcc6a
      andersca@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=121059
      
      Reviewed by Andreas Kling.
      
      WTF::createOwned is a function template that does adoptPtr + new in a single function call,
      with all the arguments being perfectly forwarded thanks to C++11.
      
      Being forward-looking, createOwned returns an OwnPtr rather than a PassOwnPtr since the plan is
      to get rid of PassOwnPtr and just use std::move instead.
      
      * wtf/FilePrintStream.cpp:
      * wtf/FilePrintStream.h:
      * wtf/HashTable.h:
      * wtf/ListHashSet.h:
      * wtf/OwnPtr.h:
      (WTF::OwnPtr::OwnPtr):
      (WTF::createOwned):
      (WTF::createThread):
      (WTF::establishIdentifierForPthreadHandle):
      (WTF::createThreadInternal):
      (WTF::Collator::userDefault):
      (WTF::Collator::userDefault):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155407 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      238bcc6a
    • mhahnenberg@apple.com's avatar
      CopiedSpace::startedCopying should not call MarkedSpace::capacity · 4d13d555
      mhahnenberg@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=121045
      
      Reviewed by Geoffrey Garen.
      
      MarkedSpace::capacity() iterates every block in MarkedSpace. Instead we should just 
      keep track of our total capacity in MarkedSpace as we add and remove MarkedBlocks.
      
      * heap/MarkedSpace.cpp:
      (JSC::MarkedSpace::freeBlock):
      * heap/MarkedSpace.h:
      (JSC::MarkedSpace::didAddBlock):
      (JSC::MarkedSpace::capacity):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155406 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4d13d555
    • andersca@apple.com's avatar
      Remove wtf/TypeTraits.h · f9398a23
      andersca@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=121047
      
      Reviewed by Darin Adler.
      
      * GNUmakefile.list.am:
      * WTF.pro:
      * WTF.vcxproj/WTF.vcxproj:
      * WTF.vcxproj/WTF.vcxproj.filters:
      * WTF.xcodeproj/project.pbxproj:
      * wtf/CMakeLists.txt:
      * wtf/TypeTraits.cpp: Removed.
      * wtf/TypeTraits.h: Removed.
      * wtf/VectorTraits.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155402 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f9398a23