summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qcocoamenu_mac.mm
blob: a7e0b7960f6c0af4a7c47ee08cdff1945a089303 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights.  These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/

#include "qmacdefines_mac.h"
#include "qapplication.h"
#ifdef QT_MAC_USE_COCOA
#import <private/qcocoamenu_mac_p.h>
#import <private/qcocoamenuloader_mac_p.h>
#include <private/qt_cocoa_helpers_mac_p.h>
#include <private/qapplication_p.h>

#include <QtGui/QMenu>

QT_FORWARD_DECLARE_CLASS(QAction)
QT_FORWARD_DECLARE_CLASS(QWidget)
QT_FORWARD_DECLARE_CLASS(QApplication)
QT_FORWARD_DECLARE_CLASS(QCoreApplication)
QT_FORWARD_DECLARE_CLASS(QApplicationPrivate)
QT_FORWARD_DECLARE_CLASS(QKeyEvent)
QT_FORWARD_DECLARE_CLASS(QEvent)

QT_BEGIN_NAMESPACE
extern bool qt_sendSpontaneousEvent(QObject*, QEvent*); //qapplication.cpp
QT_END_NAMESPACE

QT_USE_NAMESPACE

@implementation QT_MANGLE_NAMESPACE(QCocoaMenu)

- (id)initWithQMenu:(QMenu*)menu
{
    self = [super init];
    if (self) {
        qmenu = menu;
        [self setAutoenablesItems:NO];
        [self setDelegate:self];
    }
    return self;
}

- (void)menu:(NSMenu*)menu willHighlightItem:(NSMenuItem*)item;
{
    Q_UNUSED(menu);

    if (!item) {
        // ### According to the docs everything will be highlighted. Not sure what we should do in
        // Qt, so just return.
        return;
    }

    if (QAction *action = reinterpret_cast<QAction *>([item tag]))
        action->activate(QAction::Hover);
}

- (void)menuWillOpen:(NSMenu*)menu;
{
    while (QWidget *popup
                = QApplication::activePopupWidget())
        popup->close();
    QMenu *qtmenu = static_cast<QT_MANGLE_NAMESPACE(QCocoaMenu) *>(menu)->qmenu;
    qt_mac_emit_menuSignals(qtmenu, true);
    qt_mac_menu_collapseSeparators(menu, qtmenu->separatorsCollapsible());
}

- (void)menuWillClose:(NSMenu*)menu;
{
    qt_mac_emit_menuSignals(((QT_MANGLE_NAMESPACE(QCocoaMenu) *)menu)->qmenu, false);
}

- (BOOL)hasShortcut:(NSMenu *)menu forKey:(NSString *)key forModifiers:(NSUInteger)modifier
  whichItem:(NSMenuItem**)outItem
{
    for (NSMenuItem *item in [menu itemArray]) {
        if (![item isEnabled] || [item isHidden] || [item isSeparatorItem])
            continue;
        if ([item hasSubmenu]) {
            if ([self hasShortcut:[item submenu]
                           forKey:key
                     forModifiers:modifier whichItem:outItem]) {
                if (outItem)
                    *outItem = item;
                return YES;
            }
        }
        NSString *menuKey = [item keyEquivalent];
        if (menuKey && NSOrderedSame == [menuKey compare:key]
            && (modifier == [item keyEquivalentModifierMask])) {
            if (outItem)
                *outItem = item;
            return YES;
        }
    }
    if (outItem)
        *outItem = 0;
    return NO;
}

- (BOOL)menuHasKeyEquivalent:(NSMenu *)menu forEvent:(NSEvent *)event target:(id *)target action:(SEL *)action
{
    // Check if the menu actually has a keysequence defined for this key event.
    // If it does, then we will first send the key sequence to the QWidget that has focus
    // since (in Qt's eyes) it needs to a chance at the key event first. If the widget
    // accepts the key event, we then return YES, but set the target and action to be nil,
    // which means that the action should not be triggered, and instead dispatch the event ourselves.
    // In every other case we return NO, which means that Cocoa can do as it pleases
    // (i.e., fire the menu action).
    NSMenuItem *whichItem;
    if ([self hasShortcut:menu
                   forKey:[event characters]
             forModifiers:([event modifierFlags] & NSDeviceIndependentModifierFlagsMask)
                 whichItem:&whichItem]) {
        QWidget *widget = 0;
        QAction *qaction = 0;
        if (whichItem && [whichItem tag]) {
            qaction = reinterpret_cast<QAction *>([whichItem tag]);
        }
        if (qApp->activePopupWidget())
            widget = (qApp->activePopupWidget()->focusWidget() ?
                      qApp->activePopupWidget()->focusWidget() : qApp->activePopupWidget());
        else if (QApplicationPrivate::focus_widget)
            widget = QApplicationPrivate::focus_widget;
        if (qaction && widget) {
            int key = qaction->shortcut();
            QKeyEvent accel_ev(QEvent::ShortcutOverride, (key & (~Qt::KeyboardModifierMask)),
                               Qt::KeyboardModifiers(key & Qt::KeyboardModifierMask));
            accel_ev.ignore();
            qt_sendSpontaneousEvent(widget, &accel_ev);
            if (accel_ev.isAccepted()) {
                if (qt_dispatchKeyEvent(event, widget)) {
                    *target = nil;
                    *action = nil;
                    return YES;
                }
            }
        }
    }
    return NO;
}

@end

QT_BEGIN_NAMESPACE
extern int qt_mac_menus_open_count; // qmenu_mac.mm

void qt_mac_emit_menuSignals(QMenu *menu, bool show)
{
    if (!menu)
        return;
    int delta;
    if (show) {
        emit menu->aboutToShow();
        delta = 1;
    } else {
        emit menu->aboutToHide();
        delta = -1;
    }
    qt_mac_menus_open_count += delta;
}
QT_END_NAMESPACE

#endif
./WebCore/rendering/RenderThemeChromiumWin.cpp | 2 +- .../WebCore/rendering/RenderThemeChromiumWin.h | 7 +- .../webkit/WebCore/rendering/RenderThemeMac.h | 1 + .../webkit/WebCore/rendering/RenderThemeSafari.cpp | 27 + .../webkit/WebCore/rendering/RenderThemeSafari.h | 2 + .../webkit/WebCore/storage/LocalStorage.cpp | 116 - src/3rdparty/webkit/WebCore/storage/LocalStorage.h | 66 - .../webkit/WebCore/storage/LocalStorageArea.cpp | 378 ---- .../webkit/WebCore/storage/LocalStorageArea.h | 98 - .../webkit/WebCore/storage/LocalStorageTask.cpp | 5 +- .../webkit/WebCore/storage/LocalStorageTask.h | 11 +- .../webkit/WebCore/storage/LocalStorageThread.cpp | 7 +- .../webkit/WebCore/storage/LocalStorageThread.h | 7 +- .../webkit/WebCore/storage/SessionStorage.cpp | 80 - .../webkit/WebCore/storage/SessionStorage.h | 67 - .../webkit/WebCore/storage/SessionStorageArea.cpp | 94 - .../webkit/WebCore/storage/SessionStorageArea.h | 61 - .../webkit/WebCore/storage/StorageArea.cpp | 125 +- src/3rdparty/webkit/WebCore/storage/StorageArea.h | 38 +- .../webkit/WebCore/storage/StorageAreaSync.cpp | 339 +++ .../webkit/WebCore/storage/StorageAreaSync.h | 100 + .../webkit/WebCore/storage/StorageNamespace.cpp | 129 ++ .../webkit/WebCore/storage/StorageNamespace.h | 74 + .../webkit/WebCore/storage/StorageSyncManager.cpp | 6 +- .../webkit/WebCore/storage/StorageSyncManager.h | 7 +- .../webkit/WebCore/svg/SVGAnimatedProperty.h | 2 +- .../webkit/WebCore/svg/SVGImageElement.cpp | 11 +- .../webkit/WebCore/svg/graphics/SVGImage.cpp | 2 +- .../webkit/WebCore/wml/WMLAnchorElement.cpp | 1 + src/3rdparty/webkit/WebCore/wml/WMLCardElement.cpp | 5 + src/3rdparty/webkit/WebCore/wml/WMLCardElement.h | 1 + src/3rdparty/webkit/WebCore/wml/WMLDoElement.cpp | 7 +- src/3rdparty/webkit/WebCore/wml/WMLDoElement.h | 3 +- src/3rdparty/webkit/WebCore/wml/WMLElement.cpp | 4 +- src/3rdparty/webkit/WebCore/wml/WMLElement.h | 4 +- .../webkit/WebCore/wml/WMLFieldSetElement.cpp | 13 +- .../webkit/WebCore/wml/WMLFieldSetElement.h | 2 - .../webkit/WebCore/wml/WMLOptGroupElement.cpp | 12 +- .../webkit/WebCore/wml/WMLOptGroupElement.h | 3 +- .../webkit/WebCore/wml/WMLPostfieldElement.cpp | 25 +- .../webkit/WebCore/wml/WMLPostfieldElement.h | 9 +- .../webkit/WebCore/wml/WMLSetvarElement.cpp | 19 +- src/3rdparty/webkit/WebCore/wml/WMLSetvarElement.h | 8 +- .../webkit/WebCore/wml/WMLTimerElement.cpp | 17 +- src/3rdparty/webkit/WebCore/wml/WMLTimerElement.h | 3 +- src/3rdparty/webkit/WebCore/xml/XPathFunctions.cpp | 8 +- src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp | 139 +- src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h | 24 + src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h | 27 +- src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 45 +- src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h | 3 +- src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h | 3 +- src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp | 15 +- src/3rdparty/webkit/WebKit/qt/ChangeLog | 147 ++ .../qt/WebCoreSupport/ContextMenuClientQt.cpp | 6 + .../WebKit/qt/WebCoreSupport/ContextMenuClientQt.h | 1 + .../webkit/WebKit/qt/docs/qtwebkit.qdocconf | 3 +- .../WebKit/qt/tests/qwebhistory/data/page1.html | 1 + .../WebKit/qt/tests/qwebhistory/data/page2.html | 1 + .../WebKit/qt/tests/qwebhistory/data/page3.html | 1 + .../WebKit/qt/tests/qwebhistory/data/page4.html | 1 + .../WebKit/qt/tests/qwebhistory/data/page5.html | 1 + .../WebKit/qt/tests/qwebhistory/data/page6.html | 1 + .../WebKit/qt/tests/qwebhistory/qwebhistory.pro | 7 + .../qt/tests/qwebhistory/tst_qwebhistory.cpp | 326 +++ .../qt/tests/qwebhistory/tst_qwebhistory.qrc | 11 + src/3rdparty/webkit/WebKit/qt/tests/tests.pro | 2 +- 237 files changed, 6898 insertions(+), 2103 deletions(-) create mode 100644 src/3rdparty/webkit/WebCore/ForwardingHeaders/wtf/FastAllocBase.h create mode 100644 src/3rdparty/webkit/WebCore/bindings/js/JSDataGridColumnListCustom.cpp create mode 100644 src/3rdparty/webkit/WebCore/generated/JSDataGridColumn.cpp create mode 100644 src/3rdparty/webkit/WebCore/generated/JSDataGridColumn.h create mode 100644 src/3rdparty/webkit/WebCore/generated/JSDataGridColumnList.cpp create mode 100644 src/3rdparty/webkit/WebCore/generated/JSDataGridColumnList.h create mode 100644 src/3rdparty/webkit/WebCore/history/qt/HistoryItemQt.cpp create mode 100644 src/3rdparty/webkit/WebCore/html/DataGridColumn.cpp create mode 100644 src/3rdparty/webkit/WebCore/html/DataGridColumn.h create mode 100644 src/3rdparty/webkit/WebCore/html/DataGridColumn.idl create mode 100644 src/3rdparty/webkit/WebCore/html/DataGridColumnList.cpp create mode 100644 src/3rdparty/webkit/WebCore/html/DataGridColumnList.h create mode 100644 src/3rdparty/webkit/WebCore/html/DataGridColumnList.idl delete mode 100644 src/3rdparty/webkit/WebCore/storage/LocalStorage.cpp delete mode 100644 src/3rdparty/webkit/WebCore/storage/LocalStorage.h delete mode 100644 src/3rdparty/webkit/WebCore/storage/LocalStorageArea.cpp delete mode 100644 src/3rdparty/webkit/WebCore/storage/LocalStorageArea.h delete mode 100644 src/3rdparty/webkit/WebCore/storage/SessionStorage.cpp delete mode 100644 src/3rdparty/webkit/WebCore/storage/SessionStorage.h delete mode 100644 src/3rdparty/webkit/WebCore/storage/SessionStorageArea.cpp delete mode 100644 src/3rdparty/webkit/WebCore/storage/SessionStorageArea.h create mode 100644 src/3rdparty/webkit/WebCore/storage/StorageAreaSync.cpp create mode 100644 src/3rdparty/webkit/WebCore/storage/StorageAreaSync.h create mode 100644 src/3rdparty/webkit/WebCore/storage/StorageNamespace.cpp create mode 100644 src/3rdparty/webkit/WebCore/storage/StorageNamespace.h create mode 100644 src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page1.html create mode 100644 src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page2.html create mode 100644 src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page3.html create mode 100644 src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page4.html create mode 100644 src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page5.html create mode 100644 src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/data/page6.html create mode 100644 src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro create mode 100644 src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp create mode 100644 src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.qrc diff --git a/src/3rdparty/webkit/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/JavaScriptCore/ChangeLog index 55518f5..c8bba0f 100644 --- a/src/3rdparty/webkit/JavaScriptCore/ChangeLog +++ b/src/3rdparty/webkit/JavaScriptCore/ChangeLog @@ -1,3 +1,149 @@ +2009-06-26 Oliver Hunt + + Reviewed by Dan Bernstein. + + REGRESSION(r45039): Crashes inside JSEvent::put on PowerPC (26746) + + + Fix for r45039 incorrectly uncached a get_by_id by converting it to put_by_id. Clearly this + is less than correct. This patch corrects that error. + + * interpreter/Interpreter.cpp: + (JSC::Interpreter::tryCacheGetByID): + +2009-06-26 Eric Seidel + + No review, only rolling out r45259. + + Roll out r45259 after crash appeared on the bots: + plugins/undefined-property-crash.html + ASSERTION FAILED: s <= HeapConstants::cellSize + (leopard-intel-debug-tests/build/JavaScriptCore/runtime/Collector.cpp:278 + void* JSC::Heap::heapAllocate(size_t) [with JSC::HeapType heapType = PrimaryHeap]) + + * runtime/DateInstance.cpp: + * runtime/Identifier.cpp: + * runtime/Lookup.h: + * runtime/RegExpConstructor.cpp: + * runtime/RegExpObject.h: + * runtime/ScopeChain.h: + * runtime/UString.h: + +2009-06-26 Jedrzej Nowacki + + Reviewed by Simon Hausmann. + + Add support for QDataStream operators to Vector. + + * wtf/Vector.h: + (WTF::operator<<): + (WTF::operator>>): + +2009-06-24 Sam Weinig + + Reviewed by Gavin Barraclough. + + Make the opcode sampler work once again. + + * jit/JIT.h: + (JSC::JIT::compileGetByIdProto): + (JSC::JIT::compileGetByIdSelfList): + (JSC::JIT::compileGetByIdProtoList): + (JSC::JIT::compileGetByIdChainList): + (JSC::JIT::compileGetByIdChain): + (JSC::JIT::compilePutByIdTransition): + (JSC::JIT::compileCTIMachineTrampolines): + (JSC::JIT::compilePatchGetArrayLength): + * jit/JITStubCall.h: + (JSC::JITStubCall::call): + +2009-06-24 Zoltan Horvath + + Reviewed by Maciej Stachowiak. + + Extend FastAllocBase.h with 'using WTF::FastAllocBase' to avoid + unnecessary WTF:: usings. + Remove existing unnecessary WTF:: usings. + + * interpreter/Interpreter.h: + * profiler/CallIdentifier.h: + * runtime/ScopeChain.h: + * wtf/FastAllocBase.h: + +2009-06-24 David Levin + + Fix all builds. + + * bytecode/CodeBlock.h: + * bytecompiler/BytecodeGenerator.h: + * interpreter/Register.h: + +2009-06-24 Zoltan Horvath + + Reviewed by Maciej Stachowiak. + + https://bugs.webkit.org/show_bug.cgi?id=26677 + + Inherits CodeBlock class from FastAllocBase because it + has been instantiated by 'new' in JavaScriptCore/bytecode/CodeBlock.h:217. + + * bytecode/CodeBlock.h: + +2009-06-24 Zoltan Horvath + + Reviewed by Maciej Stachowiak. + + https://bugs.webkit.org/show_bug.cgi?id=26676 + + Inherits BytecodeGenerator class from FastAllocBase because it has been + instantiated by 'new' in JavaScriptCore/parser/Nodes.cpp:1892. + + * bytecompiler/BytecodeGenerator.h: + +2009-06-24 Zoltan Horvath + + Reviewed by Maciej Stachowiak. + + https://bugs.webkit.org/show_bug.cgi?id=26675 + + Inherits Register class from FastAllocBase because it has been + instantiated by 'new' in JavaScriptCore/runtime/JSVariableObject.h:149. + + * interpreter/Register.h: + +2009-06-24 Zoltan Horvath + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=26674 + + Inherits HashMap class from FastAllocBase because it has been + instantiated by 'new' in JavaScriptCore/runtime/Structure.cpp:458. + + * wtf/HashMap.h: + +2009-06-24 Oliver Hunt + + Reviewed by Darin Adler. + + REGRESSION (Safari 4 Public Beta - TOT): google.com/adplanner shows blank page instead of site details in "basic research' + + The problem was caused by the page returned with a function using a + var declaration list containing around ~3000 variables. The solution + to this is to flatten the comma expression representation and make + codegen comma expressions and initializer lists iterative rather than + recursive. + + * parser/Grammar.y: + * parser/NodeConstructors.h: + (JSC::CommaNode::CommaNode): + * parser/Nodes.cpp: + (JSC::CommaNode::emitBytecode): + * parser/Nodes.h: + (JSC::ExpressionNode::isCommaNode): + (JSC::CommaNode::isCommaNode): + (JSC::CommaNode::append): + 2009-06-24 Zoltan Horvath Reviewed by Maciej Stachowiak. diff --git a/src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.h b/src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.h index 94901f9..afd32f0 100644 --- a/src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.h +++ b/src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.h @@ -38,6 +38,7 @@ #include "Nodes.h" #include "RegExp.h" #include "UString.h" +#include #include #include @@ -214,7 +215,7 @@ namespace JSC { } #endif - class CodeBlock { + class CodeBlock : public WTF::FastAllocBase { friend class JIT; public: CodeBlock(ScopeNode* ownerNode); diff --git a/src/3rdparty/webkit/JavaScriptCore/bytecompiler/BytecodeGenerator.h b/src/3rdparty/webkit/JavaScriptCore/bytecompiler/BytecodeGenerator.h index 21de281..d29a24d 100644 --- a/src/3rdparty/webkit/JavaScriptCore/bytecompiler/BytecodeGenerator.h +++ b/src/3rdparty/webkit/JavaScriptCore/bytecompiler/BytecodeGenerator.h @@ -40,6 +40,7 @@ #include "SymbolTable.h" #include "Debugger.h" #include "Nodes.h" +#include #include #include #include @@ -60,7 +61,7 @@ namespace JSC { FinallyContext finallyContext; }; - class BytecodeGenerator { + class BytecodeGenerator : public WTF::FastAllocBase { public: typedef DeclarationStacks::VarStack VarStack; typedef DeclarationStacks::FunctionStack FunctionStack; diff --git a/src/3rdparty/webkit/JavaScriptCore/generated/Grammar.cpp b/src/3rdparty/webkit/JavaScriptCore/generated/Grammar.cpp index 0f7625a..8e80eca 100644 --- a/src/3rdparty/webkit/JavaScriptCore/generated/Grammar.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/generated/Grammar.cpp @@ -289,7 +289,7 @@ static ExpressionNode* makeSubNode(void*, ExpressionNode*, ExpressionNode*, bool static ExpressionNode* makeLeftShiftNode(void*, ExpressionNode*, ExpressionNode*, bool rightHasAssignments); static ExpressionNode* makeRightShiftNode(void*, ExpressionNode*, ExpressionNode*, bool rightHasAssignments); static StatementNode* makeVarStatementNode(void*, ExpressionNode*); -static ExpressionNode* combineVarInitializers(void*, ExpressionNode* list, AssignResolveNode* init); +static ExpressionNode* combineCommaNodes(void*, ExpressionNode* list, ExpressionNode* init); #if COMPILER(MSVC) @@ -3811,17 +3811,17 @@ yyreduce: case 196: #line 781 "../parser/Grammar.y" - { (yyval.expressionNode) = createNodeInfo(new (GLOBAL_DATA) CommaNode(GLOBAL_DATA, (yyvsp[(1) - (3)].expressionNode).m_node, (yyvsp[(3) - (3)].expressionNode).m_node), (yyvsp[(1) - (3)].expressionNode).m_features | (yyvsp[(3) - (3)].expressionNode).m_features, (yyvsp[(1) - (3)].expressionNode).m_numConstants + (yyvsp[(3) - (3)].expressionNode).m_numConstants); ;} + { (yyval.expressionNode) = createNodeInfo(combineCommaNodes(GLOBAL_DATA, (yyvsp[(1) - (3)].expressionNode).m_node, (yyvsp[(3) - (3)].expressionNode).m_node), (yyvsp[(1) - (3)].expressionNode).m_features | (yyvsp[(3) - (3)].expressionNode).m_features, (yyvsp[(1) - (3)].expressionNode).m_numConstants + (yyvsp[(3) - (3)].expressionNode).m_numConstants); ;} break; case 198: #line 786 "../parser/Grammar.y" - { (yyval.expressionNode) = createNodeInfo(new (GLOBAL_DATA) CommaNode(GLOBAL_DATA, (yyvsp[(1) - (3)].expressionNode).m_node, (yyvsp[(3) - (3)].expressionNode).m_node), (yyvsp[(1) - (3)].expressionNode).m_features | (yyvsp[(3) - (3)].expressionNode).m_features, (yyvsp[(1) - (3)].expressionNode).m_numConstants + (yyvsp[(3) - (3)].expressionNode).m_numConstants); ;} + { (yyval.expressionNode) = createNodeInfo(combineCommaNodes(GLOBAL_DATA, (yyvsp[(1) - (3)].expressionNode).m_node, (yyvsp[(3) - (3)].expressionNode).m_node), (yyvsp[(1) - (3)].expressionNode).m_features | (yyvsp[(3) - (3)].expressionNode).m_features, (yyvsp[(1) - (3)].expressionNode).m_numConstants + (yyvsp[(3) - (3)].expressionNode).m_numConstants); ;} break; case 200: #line 791 "../parser/Grammar.y" - { (yyval.expressionNode) = createNodeInfo(new (GLOBAL_DATA) CommaNode(GLOBAL_DATA, (yyvsp[(1) - (3)].expressionNode).m_node, (yyvsp[(3) - (3)].expressionNode).m_node), (yyvsp[(1) - (3)].expressionNode).m_features | (yyvsp[(3) - (3)].expressionNode).m_features, (yyvsp[(1) - (3)].expressionNode).m_numConstants + (yyvsp[(3) - (3)].expressionNode).m_numConstants); ;} + { (yyval.expressionNode) = createNodeInfo(combineCommaNodes(GLOBAL_DATA, (yyvsp[(1) - (3)].expressionNode).m_node, (yyvsp[(3) - (3)].expressionNode).m_node), (yyvsp[(1) - (3)].expressionNode).m_features | (yyvsp[(3) - (3)].expressionNode).m_features, (yyvsp[(1) - (3)].expressionNode).m_numConstants + (yyvsp[(3) - (3)].expressionNode).m_numConstants); ;} break; case 218: @@ -3888,7 +3888,7 @@ yyreduce: #line 855 "../parser/Grammar.y" { AssignResolveNode* node = new (GLOBAL_DATA) AssignResolveNode(GLOBAL_DATA, *(yyvsp[(3) - (4)].ident), (yyvsp[(4) - (4)].expressionNode).m_node, (yyvsp[(4) - (4)].expressionNode).m_features & AssignFeature); SET_EXCEPTION_LOCATION(node, (yylsp[(3) - (4)]).first_column, (yylsp[(4) - (4)]).first_column + 1, (yylsp[(4) - (4)]).last_column); - (yyval.varDeclList).m_node = combineVarInitializers(GLOBAL_DATA, (yyvsp[(1) - (4)].varDeclList).m_node, node); + (yyval.varDeclList).m_node = combineCommaNodes(GLOBAL_DATA, (yyvsp[(1) - (4)].varDeclList).m_node, node); (yyval.varDeclList).m_varDeclarations = (yyvsp[(1) - (4)].varDeclList).m_varDeclarations; appendToVarDeclarationList(GLOBAL_DATA, (yyval.varDeclList).m_varDeclarations, *(yyvsp[(3) - (4)].ident), DeclarationStacks::HasInitializer); (yyval.varDeclList).m_funcDeclarations = 0; @@ -3936,7 +3936,7 @@ yyreduce: #line 892 "../parser/Grammar.y" { AssignResolveNode* node = new (GLOBAL_DATA) AssignResolveNode(GLOBAL_DATA, *(yyvsp[(3) - (4)].ident), (yyvsp[(4) - (4)].expressionNode).m_node, (yyvsp[(4) - (4)].expressionNode).m_features & AssignFeature); SET_EXCEPTION_LOCATION(node, (yylsp[(3) - (4)]).first_column, (yylsp[(4) - (4)]).first_column + 1, (yylsp[(4) - (4)]).last_column); - (yyval.varDeclList).m_node = combineVarInitializers(GLOBAL_DATA, (yyvsp[(1) - (4)].varDeclList).m_node, node); + (yyval.varDeclList).m_node = combineCommaNodes(GLOBAL_DATA, (yyvsp[(1) - (4)].varDeclList).m_node, node); (yyval.varDeclList).m_varDeclarations = (yyvsp[(1) - (4)].varDeclList).m_varDeclarations; appendToVarDeclarationList(GLOBAL_DATA, (yyval.varDeclList).m_varDeclarations, *(yyvsp[(3) - (4)].ident), DeclarationStacks::HasInitializer); (yyval.varDeclList).m_funcDeclarations = 0; @@ -5092,10 +5092,14 @@ static bool allowAutomaticSemicolon(Lexer& lexer, int yychar) return yychar == CLOSEBRACE || yychar == 0 || lexer.prevTerminator(); } -static ExpressionNode* combineVarInitializers(void* globalPtr, ExpressionNode* list, AssignResolveNode* init) +static ExpressionNode* combineCommaNodes(void* globalPtr, ExpressionNode* list, ExpressionNode* init) { if (!list) return init; + if (list->isCommaNode()) { + static_cast(list)->append(init); + return list; + } return new (GLOBAL_DATA) CommaNode(GLOBAL_DATA, list, init); } diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp index fa7ec0b..7b1e547 100644 --- a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp @@ -1085,7 +1085,7 @@ NEVER_INLINE void Interpreter::tryCacheGetByID(CallFrame* callFrame, CodeBlock* StructureChain* protoChain = structure->prototypeChain(callFrame); if (!protoChain->isCacheable()) { - vPC[0] = getOpcode(op_put_by_id_generic); + vPC[0] = getOpcode(op_get_by_id_generic); return; } diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.h b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.h index 7cab254..702c89c 100644 --- a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.h +++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.h @@ -66,7 +66,7 @@ namespace JSC { enum { MaxMainThreadReentryDepth = 256, MaxSecondaryThreadReentryDepth = 32 }; - class Interpreter : public WTF::FastAllocBase { + class Interpreter : public FastAllocBase { friend class JIT; friend class CachedCall; public: diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/Register.h b/src/3rdparty/webkit/JavaScriptCore/interpreter/Register.h index cceac74..31f0c8b 100644 --- a/src/3rdparty/webkit/JavaScriptCore/interpreter/Register.h +++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/Register.h @@ -31,6 +31,7 @@ #include "JSValue.h" #include +#include #include namespace JSC { @@ -47,7 +48,7 @@ namespace JSC { typedef ExecState CallFrame; - class Register { + class Register : public WTF::FastAllocBase { public: Register(); Register(JSValue); diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JIT.h b/src/3rdparty/webkit/JavaScriptCore/jit/JIT.h index bc006fc..db3f38a 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JIT.h +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JIT.h @@ -342,61 +342,40 @@ namespace JSC { static void compileGetByIdProto(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, size_t cachedOffset, ReturnAddressPtr returnAddress) { JIT jit(globalData, codeBlock); -#if ENABLE(OPCODE_SAMPLING) - jit->m_bytecodeIndex = jit->m_codeBlock->getCallReturnOffset(returnAddress.value()); -#endif jit.privateCompileGetByIdProto(stubInfo, structure, prototypeStructure, cachedOffset, returnAddress, callFrame); } static void compileGetByIdSelfList(JSGlobalData* globalData, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* polymorphicStructures, int currentIndex, Structure* structure, size_t cachedOffset) { JIT jit(globalData, codeBlock); -#if ENABLE(OPCODE_SAMPLING) - jit->m_bytecodeIndex = jit->m_codeBlock->getCallReturnOffset(returnAddress.value()); -#endif jit.privateCompileGetByIdSelfList(stubInfo, polymorphicStructures, currentIndex, structure, cachedOffset); } static void compileGetByIdProtoList(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructureList, int currentIndex, Structure* structure, Structure* prototypeStructure, size_t cachedOffset) { JIT jit(globalData, codeBlock); -#if ENABLE(OPCODE_SAMPLING) - jit->m_bytecodeIndex = jit->m_codeBlock->getCallReturnOffset(returnAddress.value()); -#endif jit.privateCompileGetByIdProtoList(stubInfo, prototypeStructureList, currentIndex, structure, prototypeStructure, cachedOffset, callFrame); } static void compileGetByIdChainList(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructureList, int currentIndex, Structure* structure, StructureChain* chain, size_t count, size_t cachedOffset) { JIT jit(globalData, codeBlock); -#if ENABLE(OPCODE_SAMPLING) - jit->m_bytecodeIndex = jit->m_codeBlock->getCallReturnOffset(returnAddress.value()); -#endif jit.privateCompileGetByIdChainList(stubInfo, prototypeStructureList, currentIndex, structure, chain, count, cachedOffset, callFrame); } static void compileGetByIdChain(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, Structure* structure, StructureChain* chain, size_t count, size_t cachedOffset, ReturnAddressPtr returnAddress) { JIT jit(globalData, codeBlock); -#if ENABLE(OPCODE_SAMPLING) - jit->m_bytecodeIndex = jit->m_codeBlock->getCallReturnOffset(returnAddress.value()); -#endif jit.privateCompileGetByIdChain(stubInfo, structure, chain, count, cachedOffset, returnAddress, callFrame); } static void compilePutByIdTransition(JSGlobalData* globalData, CodeBlock* codeBlock, StructureStubInfo* stubInfo, Structure* oldStructure, Structure* newStructure, size_t cachedOffset, StructureChain* chain, ReturnAddressPtr returnAddress) { JIT jit(globalData, codeBlock); -#if ENABLE(OPCODE_SAMPLING) - jit->m_bytecodeIndex = jit->m_codeBlock->getCallReturnOffset(returnAddress.value()); -#endif jit.privateCompilePutByIdTransition(stubInfo, oldStructure, newStructure, cachedOffset, chain, returnAddress); } static void compileCTIMachineTrampolines(JSGlobalData* globalData, RefPtr* executablePool, CodePtr* ctiArrayLengthTrampoline, CodePtr* ctiStringLengthTrampoline, CodePtr* ctiVirtualCallPreLink, CodePtr* ctiVirtualCallLink, CodePtr* ctiVirtualCall, CodePtr* ctiNativeCallThunk) { JIT jit(globalData); -#if ENABLE(OPCODE_SAMPLING) - jit->m_bytecodeIndex = jit->m_codeBlock->getCallReturnOffset(returnAddress.value()); -#endif jit.privateCompileCTIMachineTrampolines(executablePool, globalData, ctiArrayLengthTrampoline, ctiStringLengthTrampoline, ctiVirtualCallPreLink, ctiVirtualCallLink, ctiVirtualCall, ctiNativeCallThunk); } @@ -407,9 +386,6 @@ namespace JSC { static void compilePatchGetArrayLength(JSGlobalData* globalData, CodeBlock* codeBlock, ReturnAddressPtr returnAddress) { JIT jit(globalData, codeBlock); -#if ENABLE(OPCODE_SAMPLING) - jit->m_bytecodeIndex = jit->m_codeBlock->getCallReturnOffset(returnAddress.value()); -#endif return jit.privateCompilePatchGetArrayLength(returnAddress); } diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubCall.h b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubCall.h index 2dc69c1..bc07178 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubCall.h +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubCall.h @@ -108,8 +108,8 @@ namespace JSC { JIT::Call call() { #if ENABLE(OPCODE_SAMPLING) - ASSERT(m_jit->m_bytecodeIndex != (unsigned)-1); - m_jit->sampleInstruction(m_jit->m_codeBlock->instructions().begin() + m_jit->m_bytecodeIndex, true); + if (m_jit->m_bytecodeIndex != (unsigned)-1) + m_jit->sampleInstruction(m_jit->m_codeBlock->instructions().begin() + m_jit->m_bytecodeIndex, true); #endif m_jit->restoreArgumentReference(); @@ -117,7 +117,8 @@ namespace JSC { m_jit->m_calls.append(CallRecord(call, m_jit->m_bytecodeIndex, m_stub)); #if ENABLE(OPCODE_SAMPLING) - m_jit->sampleInstruction(m_jit->m_codeBlock->instructions().begin() + m_jit->m_bytecodeIndex, false); + if (m_jit->m_bytecodeIndex != (unsigned)-1) + m_jit->sampleInstruction(m_jit->m_codeBlock->instructions().begin() + m_jit->m_bytecodeIndex, false); #endif m_jit->killLastResultRegister(); diff --git a/src/3rdparty/webkit/JavaScriptCore/parser/Grammar.y b/src/3rdparty/webkit/JavaScriptCore/parser/Grammar.y index 52dddde..c5ca425 100644 --- a/src/3rdparty/webkit/JavaScriptCore/parser/Grammar.y +++ b/src/3rdparty/webkit/JavaScriptCore/parser/Grammar.y @@ -80,7 +80,7 @@ static ExpressionNode* makeSubNode(void*, ExpressionNode*, ExpressionNode*, bool static ExpressionNode* makeLeftShiftNode(void*, ExpressionNode*, ExpressionNode*, bool rightHasAssignments); static ExpressionNode* makeRightShiftNode(void*, ExpressionNode*, ExpressionNode*, bool rightHasAssignments); static StatementNode* makeVarStatementNode(void*, ExpressionNode*); -static ExpressionNode* combineVarInitializers(void*, ExpressionNode* list, AssignResolveNode* init); +static ExpressionNode* combineCommaNodes(void*, ExpressionNode* list, ExpressionNode* init); #if COMPILER(MSVC) @@ -778,17 +778,17 @@ AssignmentOperator: Expr: AssignmentExpr - | Expr ',' AssignmentExpr { $$ = createNodeInfo(new (GLOBAL_DATA) CommaNode(GLOBAL_DATA, $1.m_node, $3.m_node), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } + | Expr ',' AssignmentExpr { $$ = createNodeInfo(combineCommaNodes(GLOBAL_DATA, $1.m_node, $3.m_node), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } ; ExprNoIn: AssignmentExprNoIn - | ExprNoIn ',' AssignmentExprNoIn { $$ = createNodeInfo(new (GLOBAL_DATA) CommaNode(GLOBAL_DATA, $1.m_node, $3.m_node), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } + | ExprNoIn ',' AssignmentExprNoIn { $$ = createNodeInfo(combineCommaNodes(GLOBAL_DATA, $1.m_node, $3.m_node), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } ; ExprNoBF: AssignmentExprNoBF - | ExprNoBF ',' AssignmentExpr { $$ = createNodeInfo(new (GLOBAL_DATA) CommaNode(GLOBAL_DATA, $1.m_node, $3.m_node), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } + | ExprNoBF ',' AssignmentExpr { $$ = createNodeInfo(combineCommaNodes(GLOBAL_DATA, $1.m_node, $3.m_node), $1.m_features | $3.m_features, $1.m_numConstants + $3.m_numConstants); } ; Statement: @@ -854,7 +854,7 @@ VariableDeclarationList: | VariableDeclarationList ',' IDENT Initializer { AssignResolveNode* node = new (GLOBAL_DATA) AssignResolveNode(GLOBAL_DATA, *$3, $4.m_node, $4.m_features & AssignFeature); SET_EXCEPTION_LOCATION(node, @3.first_column, @4.first_column + 1, @4.last_column); - $$.m_node = combineVarInitializers(GLOBAL_DATA, $1.m_node, node); + $$.m_node = combineCommaNodes(GLOBAL_DATA, $1.m_node, node); $$.m_varDeclarations = $1.m_varDeclarations; appendToVarDeclarationList(GLOBAL_DATA, $$.m_varDeclarations, *$3, DeclarationStacks::HasInitializer); $$.m_funcDeclarations = 0; @@ -891,7 +891,7 @@ VariableDeclarationListNoIn: | VariableDeclarationListNoIn ',' IDENT InitializerNoIn { AssignResolveNode* node = new (GLOBAL_DATA) AssignResolveNode(GLOBAL_DATA, *$3, $4.m_node, $4.m_features & AssignFeature); SET_EXCEPTION_LOCATION(node, @3.first_column, @4.first_column + 1, @4.last_column); - $$.m_node = combineVarInitializers(GLOBAL_DATA, $1.m_node, node); + $$.m_node = combineCommaNodes(GLOBAL_DATA, $1.m_node, node); $$.m_varDeclarations = $1.m_varDeclarations; appendToVarDeclarationList(GLOBAL_DATA, $$.m_varDeclarations, *$3, DeclarationStacks::HasInitializer); $$.m_funcDeclarations = 0; @@ -2071,10 +2071,14 @@ static bool allowAutomaticSemicolon(Lexer& lexer, int yychar) return yychar == CLOSEBRACE || yychar == 0 || lexer.prevTerminator(); } -static ExpressionNode* combineVarInitializers(void* globalPtr, ExpressionNode* list, AssignResolveNode* init) +static ExpressionNode* combineCommaNodes(void* globalPtr, ExpressionNode* list, ExpressionNode* init) { if (!list) return init; + if (list->isCommaNode()) { + static_cast(list)->append(init); + return list; + } return new (GLOBAL_DATA) CommaNode(GLOBAL_DATA, list, init); } diff --git a/src/3rdparty/webkit/JavaScriptCore/parser/NodeConstructors.h b/src/3rdparty/webkit/JavaScriptCore/parser/NodeConstructors.h index ea1579b..d17da69 100644 --- a/src/3rdparty/webkit/JavaScriptCore/parser/NodeConstructors.h +++ b/src/3rdparty/webkit/JavaScriptCore/parser/NodeConstructors.h @@ -659,9 +659,9 @@ namespace JSC { inline CommaNode::CommaNode(JSGlobalData* globalData, ExpressionNode* expr1, ExpressionNode* expr2) : ExpressionNode(globalData) - , m_expr1(expr1) - , m_expr2(expr2) { + m_expressions.append(expr1); + m_expressions.append(expr2); } inline ConstStatementNode::ConstStatementNode(JSGlobalData* globalData, ConstDeclNode* next) diff --git a/src/3rdparty/webkit/JavaScriptCore/parser/Nodes.cpp b/src/3rdparty/webkit/JavaScriptCore/parser/Nodes.cpp index 3cfd125..ba6e1e0 100644 --- a/src/3rdparty/webkit/JavaScriptCore/parser/Nodes.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/parser/Nodes.cpp @@ -1186,8 +1186,10 @@ RegisterID* ReadModifyBracketNode::emitBytecode(BytecodeGenerator& generator, Re RegisterID* CommaNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst) { - generator.emitNode(generator.ignoredResult(), m_expr1); - return generator.emitNode(dst, m_expr2); + ASSERT(m_expressions.size() > 1); + for (size_t i = 0; i < m_expressions.size() - 1; i++) + generator.emitNode(generator.ignoredResult(), m_expressions[i]); + return generator.emitNode(dst, m_expressions.last()); } // ------------------------------ ConstDeclNode ------------------------------------ diff --git a/src/3rdparty/webkit/JavaScriptCore/parser/Nodes.h b/src/3rdparty/webkit/JavaScriptCore/parser/Nodes.h index 7cdc19d..a9f88b7 100644 --- a/src/3rdparty/webkit/JavaScriptCore/parser/Nodes.h +++ b/src/3rdparty/webkit/JavaScriptCore/parser/Nodes.h @@ -169,7 +169,8 @@ namespace JSC { virtual bool isResolveNode() const { return false; } virtual bool isBracketAccessorNode() const { return false; } virtual bool isDotAccessorNode() const { return false; } - virtual bool isFuncExprNode() const { return false; } + virtual bool isFuncExprNode() const { return false; } + virtual bool isCommaNode() const { return false; } virtual bool isSimpleArray() const { return false; } virtual bool isAdd() const { return false; } @@ -1087,16 +1088,20 @@ namespace JSC { Operator m_operator; ExpressionNode* m_right; }; + + typedef Vector ExpressionVector; class CommaNode : public ExpressionNode { public: CommaNode(JSGlobalData*, ExpressionNode* expr1, ExpressionNode* expr2); + void append(ExpressionNode* expr) { m_expressions.append(expr); } + private: + virtual bool isCommaNode() const { return true; } virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0); - ExpressionNode* m_expr1; - ExpressionNode* m_expr2; + ExpressionVector m_expressions; }; class ConstDeclNode : public ExpressionNode { diff --git a/src/3rdparty/webkit/JavaScriptCore/profiler/CallIdentifier.h b/src/3rdparty/webkit/JavaScriptCore/profiler/CallIdentifier.h index fdd7bbc..ba48c55 100644 --- a/src/3rdparty/webkit/JavaScriptCore/profiler/CallIdentifier.h +++ b/src/3rdparty/webkit/JavaScriptCore/profiler/CallIdentifier.h @@ -32,7 +32,7 @@ namespace JSC { - struct CallIdentifier : public WTF::FastAllocBase { + struct CallIdentifier : public FastAllocBase { UString m_name; UString m_url; unsigned m_lineNumber; diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/ScopeChain.h b/src/3rdparty/webkit/JavaScriptCore/runtime/ScopeChain.h index 3b10d32..17aff24 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/ScopeChain.h +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/ScopeChain.h @@ -30,7 +30,7 @@ namespace JSC { class JSObject; class ScopeChainIterator; - class ScopeChainNode : public WTF::FastAllocBase { + class ScopeChainNode : public FastAllocBase { public: ScopeChainNode(ScopeChainNode* next, JSObject* object, JSGlobalData* globalData, JSObject* globalThis) : next(next) diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/FastAllocBase.h b/src/3rdparty/webkit/JavaScriptCore/wtf/FastAllocBase.h index 71e6bfa..1c81856 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/FastAllocBase.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/FastAllocBase.h @@ -397,4 +397,7 @@ namespace WTF { } // namespace WTF +// Using WTF::FastAllocBase to avoid using FastAllocBase's explicit qualification by WTF::. +using WTF::FastAllocBase; + #endif // FastAllocBase_h diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/HashMap.h b/src/3rdparty/webkit/JavaScriptCore/wtf/HashMap.h index c5b75ff..3de5ee6 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/HashMap.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/HashMap.h @@ -29,7 +29,7 @@ namespace WTF { template::Hash, typename KeyTraitsArg = HashTraits, typename MappedTraitsArg = HashTraits > - class HashMap { + class HashMap : public FastAllocBase { private: typedef KeyTraitsArg KeyTraits; typedef MappedTraitsArg MappedTraits; diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h b/src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h index 050feb1..c378fd0 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h @@ -28,6 +28,10 @@ #include #include +#if PLATFORM(QT) +#include +#endif + namespace WTF { using std::min; @@ -563,6 +567,32 @@ namespace WTF { Buffer m_buffer; }; +#if PLATFORM(QT) + template + QDataStream& operator<<(QDataStream& stream, const Vector& data) + { + stream << qint64(data.size()); + foreach (const T& i, data) + stream << i; + return stream; + } + + template + QDataStream& operator>>(QDataStream& stream, Vector& data) + { + data.clear(); + qint64 count; + T item; + stream >> count; + data.reserveCapacity(count); + for (qint64 i = 0; i < count; ++i) { + stream >> item; + data.append(item); + } + return stream; + } +#endif + template Vector::Vector(const Vector& other) : m_size(other.size()) diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 5e73fee..730c023 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -4,8 +4,8 @@ This is a snapshot of the Qt port of WebKit from The commit imported was from the - qtwebkit-4.6-snapshot-24062009 branch/tag + qtwebkit-4.6-snapshot-29062009 branch/tag and has the sha1 checksum - 6d5a2a0472a6af0b7f781da018e76bb8522d57a5 + 22aadba1b4356ad7d8e9446b95baccb6b2c037b0 diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index 25427bc..8991528 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,2374 @@ +2009-06-26 John Sullivan + + Added Speech submenu to context menu on Mac when there's a non-editable selection + (it was already present when there's an editable selection). + Also added support for disabling "Stop Speaking" when there is no speaking to stop. + + Reviewed by Tim Hatcher. + + * loader/EmptyClients.h: + (WebCore::EmptyContextMenuClient::isSpeaking): + implemented this new virtual function to return false + + * page/ContextMenuClient.h: + declared this new pure virtual function + + * platform/ContextMenu.cpp: + (WebCore::ContextMenu::populate): + insert Speech item (after a separator) on Mac when there's selected non-editable text + (WebCore::ContextMenu::checkOrEnableIfNeeded): + enable Stop Speaking item only if the context menu client returns true for isSpeaking() + +2009-06-28 Dan Bernstein + + Reviewed by Simon Fraser. + + - fix https://bugs.webkit.org/show_bug.cgi?id=26783 + REGRESSION (r45296): Subfolders not displayed + in MobileMe iDisk Web App + + Test: added a case to fast/dom/Element/scrollWidth.html + + Ensure that scroll{Width, Height} is greater or equal to + client{Width, Height}. + + * rendering/RenderBox.cpp: + (WebCore::RenderBox::scrollWidth): + (WebCore::RenderBox::scrollHeight): + +2009-06-27 Simon Fraser + + Reviewed by Eric Seidel. + + https://bugs.webkit.org/show_bug.cgi?id=26780 + + Do not make compositing layers for non-self-painting RenderLayers, + since these exist only to push a clip onto the clipping stack. If such + a layer gets compositied for some other reason, it should not paint. + + Also ensure that we update composited layer positions correctly + inside overflow:scroll layers. We can't assume that the contents + are child layers, so we have to go up to the compositing ancestor, + and tell it to update all its child layer positions as we do + after layout. + + Tests: compositing/layers-inside-overflow-scroll.html + compositing/self-painting-layers.html + + * rendering/RenderLayer.cpp: + (WebCore::RenderLayer::scrollToOffset): + * rendering/RenderLayerBacking.cpp: + (WebCore::RenderLayerBacking::paintIntoLayer): + * rendering/RenderLayerCompositor.cpp: + (WebCore::RenderLayerCompositor::calculateCompositedBounds): + (WebCore::RenderLayerCompositor::needsToBeComposited): + +2009-06-28 Luke Kenneth Casson Leighton + + Reviewed by Eric Seidel. + + PurgeableBuffer #defines leave out functions on gtk MacOSX 10.4 build + https://bugs.webkit.org/show_bug.cgi?id=23057 + + Define these functions for Gtk as well. + + * platform/PurgeableBuffer.h: + +2009-06-28 Nate Chapin + + Reviewed by Dimitri Glazkov. + + Update CodeGeneratorV8.pm to match the new api for V8Proxy. + + https://bugs.webkit.org/show_bug.cgi?id=26765 + + * bindings/scripts/CodeGeneratorV8.pm: Match the current version of V8Proxy. + +2009-06-28 Nicolas Sylvain + + Reviewed by Dimitri Glazkov. + + If loading a font fails because of the sandbox, we ask the browser process to + try to load it by calling ensureFontLoaded. If it still fails after + ensureFontLoaded, we hit a ASSERT_NOT_REACHED. + + This case happens once in a while during browser shutdown. The browser will + queue a message to the renderer to shutdown, and will then stop answering sync + messages from the renderer. If the renderer is still loading a page during this + time, it might try to call the browser process to ask to load a font. The + browser process will ignore the request, and the font will fail to load, even + after the second try. + + This is unfortunate, but there is no real risk here, since the renderer will be + going away as soon as it processes another message. + + This can't be layout tested as it depends on the sandbox. + + https://bugs.webkit.org/show_bug.cgi?id=26743 + + * platform/graphics/chromium/FontChromiumWin.cpp: + * platform/graphics/chromium/FontPlatformDataChromiumWin.cpp: + * platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp: + * platform/graphics/chromium/SimpleFontDataChromiumWin.cpp: + +2009-06-28 John Abd-El-Malek + + Reviewed by Eric Seidel. + + https://bugs.webkit.org/show_bug.cgi?id=15457 + + Test: plugins/netscape-plugin-map-data-to-src.html + + Fix problems with Real or WMP plugins not displaying because "data" was set + on the OBJECT tag instead of "src". This is based on what Firefox does, see + http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsObjectFrame.cpp#3045 + + * rendering/RenderPartObject.cpp: + (WebCore::mapDataParamToSrc): + (WebCore::RenderPartObject::updateWidget): + +2009-06-27 Laszlo Gombos + + Reviewed by Jan Alonzo. + + [Qt] Build fix after r45290 + https://bugs.webkit.org/show_bug.cgi?id=26769 + + * WebCore.pro: + +2009-06-27 Emilio Pozuelo Monfort + + Reviewed by Jan Alonzo. + + [GTK] Don't use deprecated GTK+ symbols. + https://bugs.webkit.org/show_bug.cgi?id=26583 + + * plugins/gtk/gtk2xtbin.c: + (gtk_xtbin_class_init): + (gtk_xtbin_new): + (gtk_xtbin_destroy): + +2009-06-27 Simon Fraser + + Reviewed by Dan Bernstein. + + https://bugs.webkit.org/show_bug.cgi?id=26780 + + Fix up previous change. When computeCompositingRequirements() determines + that the current layer is composited, it needs to inform its parent + by setting compositingState.m_subtreeIsCompositing() to true. That didn't + always happen after the previous patch. Clarified the logic here. + + * rendering/RenderLayerCompositor.cpp: + (WebCore::CompositingState::CompositingState): + (WebCore::RenderLayerCompositor::computeCompositingRequirements): + +2009-06-27 Simon Fraser + + Reviewed by Dan Bernstein. + + https://bugs.webkit.org/show_bug.cgi?id=26780 + + First part: fix the RenderLayer::hasCompositingDescendant() flag to be set + correctly. + + * rendering/RenderLayerCompositor.cpp: + (WebCore::RenderLayerCompositor::computeCompositingRequirements): + Do not unconditionally set compositingState.m_subtreeIsCompositing, because + that can clobber the value from an earlier sibling. Add some more comments. + + Remove a final use of Vector iterators. + + (WebCore::RenderLayerCompositor::recursiveRepaintLayerRect): + Move the normalFlowList() processing outside the test for isStackingContext(). + +2009-06-27 Dan Bernstein + + Reviewed by Simon Fraser and Antti Koivisto. + + - make paintFillLayerExtended() non-virtual and remove its clipY and + clipH parameters + + These parameters were computed and passed along to + paintFillLayerExtended in order to vertically constrain the rect fill to + the damage rect, because Qt cannot paint tall rectangles (see + ). Since the damage rect + is passed along in the PaintInfo, the extra parameters are redundant, + and the intersection can just take place in paintFillLayerExtended(). + + * rendering/InlineFlowBox.cpp: + (WebCore::InlineFlowBox::paintFillLayers): + (WebCore::InlineFlowBox::paintFillLayer): + (WebCore::InlineFlowBox::paintBoxDecorations): + (WebCore::InlineFlowBox::paintMask): + * rendering/InlineFlowBox.h: + * rendering/RenderBox.cpp: + (WebCore::RenderBox::paintRootBoxDecorations): + (WebCore::RenderBox::paintBoxDecorations): + (WebCore::RenderBox::paintMask): + (WebCore::RenderBox::paintMaskImages): + (WebCore::RenderBox::paintFillLayers): + (WebCore::RenderBox::paintFillLayer): + * rendering/RenderBox.h: + * rendering/RenderBoxModelObject.cpp: + (WebCore::RenderBoxModelObject::paintFillLayerExtended): + * rendering/RenderBoxModelObject.h: + * rendering/RenderFieldset.cpp: + (WebCore::RenderFieldset::paintBoxDecorations): + (WebCore::RenderFieldset::paintMask): + * rendering/RenderTable.cpp: + (WebCore::RenderTable::paintBoxDecorations): + (WebCore::RenderTable::paintMask): + * rendering/RenderTableCell.cpp: + (WebCore::RenderTableCell::paintBackgroundsBehindCell): + (WebCore::RenderTableCell::paintMask): + +2009-06-27 Ryosuke Niwa + + Reviewed by Eric Seidel. + + https://bugs.webkit.org/show_bug.cgi?id=26762 + + Clean up for IndentOutdentCommand::indentRegion, and solved most of problems related to the bug 21712. + https://bugs.webkit.org/show_bug.cgi?id=21712 + + Added few utility functions to htmlediting.h/cpp + + isVisibilyAdjacent checks whether the first position is visibly next to the second position. + i.e. there is no visible node between the first and second positions + + canMergeLists checks whether two lists can be merged. + It checks the type of list, the editing boundary, and adjacency of the lists. + + Tests: editing/execCommand/indent-nested-lists-1.html + editing/execCommand/indent-nested-lists-2.html + editing/execCommand/indent-nested-lists-3.html + editing/execCommand/indent-nested-lists-4.html + editing/execCommand/indent-nested-lists-5.html + editing/execCommand/indent-nested-lists-6.html + editing/execCommand/indent-nested-lists-7.html + editing/execCommand/outdent-nested-lists-1.html + editing/execCommand/outdent-nested-lists-2.html + editing/execCommand/outdent-nested-lists-3.html + editing/execCommand/outdent-nested-lists-4.html + + * editing/IndentOutdentCommand.cpp: + (WebCore::IndentOutdentCommand::prepareBlockquoteLevelForInsertion): + (WebCore::IndentOutdentCommand::tryIndentingAsListItem): + (WebCore::IndentOutdentCommand::indentIntoBlockquote): + (WebCore::IndentOutdentCommand::indentRegion): + * editing/IndentOutdentCommand.h: + * editing/htmlediting.cpp: + (WebCore::enclosingListChild): + (WebCore::canMergeLists): + (WebCore::isVisibilyAdjacent): + * editing/htmlediting.h: + +2009-06-27 Pavel Feldman + + Reviewed by Timothy Hatcher. + + WebInspector: Fix completion when iterating options using Tab. + + https://bugs.webkit.org/show_bug.cgi?id=26722 + + * inspector/front-end/TextPrompt.js: + (WebInspector.TextPrompt.prototype._completionsReady): + +2009-06-27 Gustavo Noronha Silva + + Reviewed by Holger Freyther. + + https://bugs.webkit.org/show_bug.cgi?id=25889 + [GTK] scrollbar policy for main frame is not implementable + + Override visibleContentRect to handle GTK+'s case, in which + scrollbars or equivalent decoration are painted by the parent + widget. + + * platform/ScrollView.cpp: + * platform/gtk/ScrollViewGtk.cpp: + (WebCore::ScrollView::visibleContentRect): + +2009-06-27 Daniel Bates + + Reviewed by Adam Barth. + + https://bugs.webkit.org/show_bug.cgi?id=26708 + + Fix addresses false negatives with respect to scheme relative paths, iFrame JavaScript URLs, + and UTF-7 encoded payloads. + + Tests: http/tests/security/xssAuditor/http-equiv-utf-7-encoded.html + http/tests/security/xssAuditor/iframe-javascript-url.html + http/tests/security/xssAuditor/script-tag-utf-7-encoded.html + http/tests/security/xssAuditor/script-tag-with-source-relative-scheme.html + + * html/HTMLTokenizer.cpp: + (WebCore::HTMLTokenizer::scriptHandler): Moved XSSAuditor check to HTMLTokenizer::parseTag. + (WebCore::HTMLTokenizer::parseTag): + * loader/FrameLoader.cpp: + (WebCore::FrameLoader::loadSubframe): Modified to inform XSSAuditor of parent frame so + as to compare against iFrame javascript URL. + * page/XSSAuditor.cpp: Removed method XSSAuditor::isControlCharacter. Instead, exposed method + isControlCharacter in ResourceResponseBase.cpp. + (WebCore::XSSAuditor::XSSAuditor): + (WebCore::XSSAuditor::decodeURL): Modified to decode string using specified encoder. + (WebCore::XSSAuditor::findInRequest): Generalized to arbitrary frame so as to prevent execution + of iFrame javascript URL. + * page/XSSAuditor.h: Added field m_parentFrame. + * platform/network/ResourceResponseBase.cpp: + (WebCore::isControlCharacter): + * platform/network/ResourceResponseBase.h: + +2009-06-27 Oliver Hunt + + Reviewed by Maciej Stachowiak. + + Bug 26771: Canvas is incorrectly tainted when drawing from a video element that uses elements + + The drawImage(