ChangeLog 934 KB
Newer Older
lars's avatar
lars committed
1
2
3
4
5
6
2007-03-16  Lars Knoll <lars@trolltech.com>

        don't use #import in .cpp files.

        * editing/qt/EditorQt.cpp:

lars's avatar
lars committed
7
8
9
10
11
12
13
14
15
16
17
18
19
2007-03-16  Lars Knoll <lars@trolltech.com>

        Fix the Qt build once again.

        * platform/qt/PasteboardQt.cpp:
        (WebCore::Pasteboard::Pasteboard):
        (WebCore::Pasteboard::writeSelection):
        (WebCore::Pasteboard::plainText):
        (WebCore::Pasteboard::documentFragment):
        (WebCore::Pasteboard::writeURL):
        (WebCore::Pasteboard::writeImage):
        (WebCore::Pasteboard::clear):

20
21
22
23
24
25
26
27
2007-03-15  Shrikant Gangoda  <shrikant.gangoda@celunite.com>

        Gdk build fix.

        * loader/gdk/FrameLoaderClientGdk.cpp:
        (WebCore::FrameLoaderClientGdk::blockedError):
        * loader/gdk/FrameLoaderClientGdk.h:

bdakin's avatar
bdakin committed
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
2007-03-15  Beth Dakin  <bdakin@apple.com>

        Reviewed by Geoff.

        Fix for http://bugs.webkit.org/show_bug.cgi?id=13088 REGRESSION
        (r19761-19779): Copy image no longer includes image address 
        (rdar://5067927)

        writeURL() does not need an isImage parameter. Now that it accepts 
        the types as a parameter, we can just declare the appropriate image 
        types within writeImage and send them to writeURL(). Also, 
        declaring the types twice is what broke this.

        * platform/Pasteboard.h:
        * platform/mac/PasteboardMac.mm:
        (WebCore::Pasteboard::writeURL):
        (WebCore::Pasteboard::writeImage):

adele's avatar
adele committed
46
47
48
49
50
51
52
53
54
2007-03-15  Adele Peterson  <adele@apple.com>

        Reviewed by Kevin Decker.

        Fix for <rdar://problem/4926179> Text in menulist control should never update if menu is open

        * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
          Only setTextFromOption if the menu isn't visible.

beidson's avatar
beidson committed
55
56
57
58
59
60
61
62
63
64
65
2007-03-15  Brady Eidson  <beidson@apple.com>

        Reviewed by Oliver

        A few platform specific tweaks

        * platform/cf/RetainPtr.h:
        (WebCore::RetainPtr::releaseRef): Fixed releaseRef to work with CF
        
        * platform/network/ResourceHandle.h: Added a "releaseRef" style call

mjs's avatar
mjs committed
66
67
68
69
70
71
2007-03-15  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Geoff and Steve.

        * config.h: Remove unneeded hack.

justing's avatar
justing committed
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
2007-03-15  Justin Garcia  <justin.garcia@apple.com>

        Reviewed by john
        
        <rdar://problem/5062376> 
        REGRESSION: In Mail and Gmail, can't change alignment to text after it has been applied
        
        Bring back the remove step in applyBlockStyle.  It's 
        necessary because addBlockStyleIfNeeded assumes that 
        the properties it adds aren't already on the block that 
        it adds them to.

        * editing/ApplyStyleCommand.cpp:
        (WebCore::ApplyStyleCommand::applyBlockStyle): 
        Bring back the remove step (added a testcase).
        Don't do the add step if m_removeOnly is true (no testcase
        because there aren't any clients using removeOnly functionality
        to remove styles yet, only styled elemets).
        Moved the code for creating new blocks up one level
        to this function so that we can pass blocks to removeCSSStyle.
        When converting VisiblePositions to indices and vice versa,
        use the highest node in the shadow tree if we're in one as
        the scope (working on a testcase).
        (WebCore::ApplyStyleCommand::addBlockStyle): Moved code to
        applyBlockStyle.
        * editing/ApplyStyleCommand.h: 

beidson's avatar
beidson committed
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
2007-03-15  Brady Eidson  <beidson@apple.com>

        Reviewed by Maciej

        <rdar://problem/4429701>
        Implements a port blocking black list that matches Firefox's

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::blockedError): Call through to the client for blockedError 
        * loader/FrameLoader.h:

        * loader/FrameLoaderClient.h: Get the "port blocked" error for the current platform

        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::wasBlocked): ResourceHandleClient method to pass on the didFail(error)
        (WebCore::ResourceLoader::blockedError): Following the pattern of "CancelledError()", get the 
          error to fail with for the didFail() call
        * loader/ResourceLoader.h:

        * platform/graphics/svg/SVGImageEmptyClients.h:
        (WebCore::SVGEmptyFrameLoaderClient::blockedError): Added stub

        * platform/network/ResourceHandle.cpp:
        (WebCore::ResourceHandle::create): If the port is blocked, create the handle but schedule it for
          deferred failure on a timer
        (WebCore::ResourceHandle::scheduleBlockedFailure): Do the timer scheduling
        (WebCore::ResourceHandle::fireBlockedFailure): Fire the timer here
        (WebCore::ResourceHandle::portAllowed): Implements checking of Mozilla's
        * platform/network/ResourceHandle.h:
        * platform/network/ResourceHandleClient.h:
        (WebCore::ResourceHandleClient::wasBlocked): Virtual for clients to get the "blocked" message

bdakin's avatar
bdakin committed
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
2007-03-15  Beth Dakin  <bdakin@apple.com>

        Reviewed by Hyatt.

        Fix for <rdar://problem/5065396> REGRESSION: leaks in 
        RenderBlock::layoutInlineChildren seen on buildbot

        This leak appeared after http://trac.webkit.org/projects/webkit/
        changeset/20188. This change shifted line boxes around in 
        removeChild(). But since removeChild() calls 
        setNeedsLayoutAndMinMaxRecalc(), all of the line boxes will be 
        removed once we actually lay out anyway. So this patch fixes the 
        leak by deleting the line boxes instead of shifting them around. 

        * editing/IndentOutdentCommand.cpp:
        (WebCore::IndentOutdentCommand::outdentParagraph): Call into 
        updateLayout(). This fixes an assertion I got in editing/
        execCommand/4976800.html This is very similar to the line box fix I 
        made recently (http://trac.webkit.org/projects/webkit/changeset/
        20177). We need to update layout before relying on VisiblePositions 
        after removing a node.
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::deleteLinesForBlock): New helper function 
        since this functionality is needed in three places now.
        (WebCore::RenderBlock::makeChildrenNonInline): Call into new 
        deleteLinesForBlock().
        (WebCore::RenderBlock::removeChild): Same.
        * rendering/RenderBlock.h:

thatcher's avatar
thatcher committed
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
2007-03-15  Timothy Hatcher  <timothy@apple.com>

        Reviewed by John.

        * Factored out most of our common build settings into .xcconfig files. Anything that was common in
          each build configuration was factored out into the shared .xcconfig file.
        * Adds a Version.xcconfig file to define the current framework version, to be used in other places.
        * Use the new $(BUNDLE_VERSION) (defined in Version.xcconfig) in the preprocessed Info.plist.
        * Use the versions defined in Version.xcconfig to set $(DYLIB_CURRENT_VERSION).

        * Configurations/Base.xcconfig: Added.
        * Configurations/DebugRelease.xcconfig: Added.
        * Configurations/Version.xcconfig: Added.
        * Configurations/WebCore.xcconfig: Added.
        * Info.plist:
        * WebCore.xcodeproj/project.pbxproj:

kjk's avatar
kjk committed
177
178
179
180
181
182
183
184
185
186
187
2007-03-15  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>

        Not reviewed - gdk build fixes.

        * platform/gdk/EditorClientGdk.cpp:
        (WebCore::EditorClientGdk::handleKeypress):
        * platform/graphics/cairo/ImageSourceCairo.cpp:
        (WebCore::ImageSource::setData):
        * platform/graphics/gdk/ImageGdk.cpp:
        (WebCore::Image::loadPlatformResource):

justing's avatar
justing committed
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
2007-03-14  Justin Garcia  <justin.garcia@apple.com>

        Reviewed by john
        
        ~2x speed up of 5k rich text paste:
        http://shakespeare.mit.edu/hamlet/full.html        

        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::doApply): Remove the top 
        level style span if its unnecessary before inserting
        into the document, its faster than doing it after.
        * editing/ReplaceSelectionCommand.h: Exposed 
        ReplacementFragment::removeNodePreservingChildren so that
        the style span can be removed using non-undoable removes,
        like the rest of the removes done on the ReplacementFragment.
        * editing/markup.cpp:
        (WebCore::createMarkup): Make the style span the top level
        element, otherwise it's useless.  This also facilitates the
        optimization mentioned above.
        When including markup for a fully selected root, include markup
        for all the nodes beneath that fully selected root, to preserve 
        the structure and appearance of the copied markup.  Did this
        by merging with the code for adding markup for descendants of
        special commonAncestorBlocks.

bdakin's avatar
bdakin committed
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
2007-03-15  Beth Dakin  <bdakin@apple.com>

        Rubber-stamped by Adele.

        Rolling out http://trac.webkit.org/projects/webkit/changeset/20148 
        (which is a fix for http://bugs.webkit.org/show_bug.cgi?id=12595 
        and rdar://4722863) because it causes a horrible memory-trasher. 

        * bindings/js/JSHTMLFormElementCustom.cpp:
        (WebCore::JSHTMLFormElement::canGetItemsForName):
        (WebCore::JSHTMLFormElement::nameGetter):
        * bindings/js/kjs_dom.cpp:
        (KJS::):
        (KJS::DOMNamedNodesCollection::DOMNamedNodesCollection):
        (KJS::DOMNamedNodesCollection::lengthGetter):
        (KJS::DOMNamedNodesCollection::indexGetter):
        (KJS::DOMNamedNodesCollection::getOwnPropertySlot):
        * bindings/js/kjs_dom.h:
        (KJS::DOMNamedNodesCollection::classInfo):
        * bindings/js/kjs_html.cpp:
        (KJS::JSHTMLCollection::getNamedItems):
        * dom/ChildNodeList.cpp:
        (WebCore::ChildNodeList::ChildNodeList):
        (WebCore::ChildNodeList::length):
        (WebCore::ChildNodeList::item):
        (WebCore::ChildNodeList::nodeMatches):
        * dom/ChildNodeList.h:
        * dom/NameNodeList.cpp:
        (WebCore::NameNodeList::NameNodeList):
        (WebCore::NameNodeList::item):
        (WebCore::NameNodeList::nodeMatches):
        * dom/NameNodeList.h:
        (WebCore::NameNodeList::rootNodeAttributeChanged):
        * dom/Node.cpp:
        (WebCore::TagNodeList::TagNodeList):
        (WebCore::TagNodeList::nodeMatches):
        (WebCore::Node::registerNodeList):
        (WebCore::Node::unregisterNodeList):
        * dom/Node.h:
        * dom/NodeList.cpp:
        (WebCore::NodeList::NodeList):
        (WebCore::NodeList::~NodeList):
        (WebCore::NodeList::recursiveLength):
        (WebCore::NodeList::itemForwardsFromCurrent):
        (WebCore::NodeList::itemBackwardsFromCurrent):
        (WebCore::NodeList::recursiveItem):
        (WebCore::NodeList::itemWithName):
        (WebCore::NodeList::rootNodeChildrenChanged):
        * dom/NodeList.h:
        (WebCore::NodeList::rootNodeAttributeChanged):
        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::HTMLFormElement):
        (WebCore::HTMLFormElement::~HTMLFormElement):
        (WebCore::HTMLFormElement::formData):
        (WebCore::HTMLFormElement::parseMappedAttribute):
        (WebCore::HTMLFormElement::removeFormElement):
        * html/HTMLFormElement.h:
        * html/HTMLGenericFormElement.cpp:
        (WebCore::HTMLGenericFormElement::parseMappedAttribute):
        (WebCore::HTMLGenericFormElement::insertedIntoTree):
        * html/HTMLGenericFormElement.h:
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::parseMappedAttribute):

277
278
279
280
281
282
283
2007-03-15  Geoffrey Garen  <ggaren@apple.com>

        Added an assert to help catch a bug. Hopefully someone will hit it!
        
        * bindings/js/kjs_proxy.cpp:
        (WebCore::KJSProxy::~KJSProxy):

284
285
286
287
288
289
290
291
292
293
294
295
296
2007-03-14  Oliver Hunt  <oliver@apple.com>

        Reviewed by Adele.

        Fix for rdar://problem/5061737.
        
        This was a regression from the original Objective-C -> C++ conversion
        for the drag logic.  We don't need to call Range::startNode as we just
        need the document that contains the range.   

        * page/DragController.cpp:
        (WebCore::documentFragmentFromDragData):

weinig's avatar
weinig committed
297
298
299
300
301
302
303
304
305
306
307
308
2007-03-14  Mitz Pettel  <mitz@webkit.org>

        Reviewed by Hyatt.

        - http://bugs.webkit.org/show_bug.cgi?id=13071
          REGRESSION: Plain text files no longer wrap lines longer than the width of the browser window

        Test: fast/loader/text-document-wrapping.html

        * loader/TextDocument.cpp:
        (WebCore::TextTokenizer::write): Specified word-wrap:break-word for the <pre> element.

weinig's avatar
weinig committed
309
310
311
312
313
314
315
316
317
318
319
320
2007-03-14  Mitz Pettel  <mitz@webkit.org>

        Reviewed by Hyatt.

        - fix http://bugs.webkit.org/show_bug.cgi?id=13072
          REGRESSION (r15617): white-space: pre-wrap breaks off the last character of a wide word

        Test: fast/text/whitespace/pre-wrap-last-char.html

        * rendering/bidi.cpp:
        (WebCore::RenderBlock::findNextLineBreak): Undid the change from r15617.

321
322
323
324
325
326
327
328
329
330
2007-03-14  David Hyatt  <hyatt@apple.com>

        Add asserts to help catch double refs and double derefs of CachedResources.

        Reviewed by mjs

        * loader/CachedResource.cpp:
        (WebCore::CachedResource::ref):
        (WebCore::CachedResource::deref):

aliceli1's avatar
aliceli1 committed
331
332
333
334
335
336
337
338
339
2007-03-14  Alice Liu  <alice.liu@apple.com>

        Rubber-stamped by Hyatt.

        Adding null check to prevent the crash that happens on 2nd run of iBench HTML load test

        * loader/icon/IconDataCache.cpp:
        (WebCore::IconDataCache::writeToDatabase):

adele's avatar
adele committed
340
341
342
343
344
345
346
347
348
349
2007-03-14  Adele Peterson  <adele@apple.com>

        Reviewed by Adam.

        Fix for <rdar://problem/5062898> REGRESSION: autocomplete window in text fields doesn't come up

        When we moved the initialization of a bunch of variables in the HTMLFormElement constructor, m_autocomplete accidently got initialized to false.

        * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::HTMLFormElement):

350
351
352
353
354
355
356
357
358
359
2007-03-14  Steve Falkenburg  <sfalken@apple.com>

        Reviewed by Adam.

        Added missing null check in case this is called on a subframe
        that hasn't started loading.

        * page/Frame.cpp:
        (WebCore::Frame::setMarkedTextMatchesAreHighlighted): Check for a null document.

antti's avatar
antti committed
360
361
362
363
364
365
366
367
368
369
370
371
372
373
2007-03-14  Antti Koivisto  <antti@apple.com>

        Reviewed by Geoff.

        Fix http://bugs.webkit.org/show_bug.cgi?id=13060
        REGRESSION: Repro ASSERT failure in Cache::adjustSize running layout tests
        <rdar://5060208>
        
        Script evaluation may have dereffed the CachedScript object already, causing double deref and
        eventually m_liveResourcesSize underflow.

        * html/HTMLScriptElement.cpp:
        (WebCore::HTMLScriptElement::notifyFinished):

adele's avatar
adele committed
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
2007-03-14  Adele Peterson  <adele@apple.com>

        Reviewed by Darin.

        Added InsertTab, InsertBacktab, InsertLineBreak, and InsertNewline to the editing command table.
        Added Event parameter to execCommand, and to all of the enabled and exec functions.  Right now,
        the event is only used by the newly added commands.  But in the future, many (and possibly all) of
        these editing commands will need to consider the event so they are applied to the correct selection.

        * WebCore.exp:
        * editing/Editor.cpp:
        (WebCore::execCopy):
        (WebCore::execCut):
        (WebCore::execDelete):
        (WebCore::execBackwardDelete):
        (WebCore::execForwardDelete):
        (WebCore::execMoveBackward):
        (WebCore::execMoveBackwardAndModifySelection):
        (WebCore::execMoveUpByPageAndModifyCaret):
        (WebCore::execMoveDown):
        (WebCore::execMoveDownAndModifySelection):
        (WebCore::execMoveForward):
        (WebCore::execMoveForwardAndModifySelection):
        (WebCore::execMoveDownByPageAndModifyCaret):
        (WebCore::execMoveLeft):
        (WebCore::execMoveLeftAndModifySelection):
        (WebCore::execMoveRight):
        (WebCore::execMoveRightAndModifySelection):
        (WebCore::execMoveToBeginningOfDocument):
        (WebCore::execMoveToBeginningOfDocumentAndModifySelection):
        (WebCore::execMoveToBeginningOfSentence):
        (WebCore::execMoveToBeginningOfSentenceAndModifySelection):
        (WebCore::execMoveToBeginningOfLine):
        (WebCore::execMoveToBeginningOfLineAndModifySelection):
        (WebCore::execMoveToBeginningOfParagraph):
        (WebCore::execMoveToBeginningOfParagraphAndModifySelection):
        (WebCore::execMoveToEndOfDocument):
        (WebCore::execMoveToEndOfDocumentAndModifySelection):
        (WebCore::execMoveToEndOfSentence):
        (WebCore::execMoveToEndOfSentenceAndModifySelection):
        (WebCore::execMoveToEndOfLine):
        (WebCore::execMoveToEndOfLineAndModifySelection):
        (WebCore::execMoveToEndOfParagraph):
        (WebCore::execMoveToEndOfParagraphAndModifySelection):
        (WebCore::execMoveParagraphBackwardAndModifySelection):
        (WebCore::execMoveParagraphForwardAndModifySelection):
        (WebCore::execMoveUp):
        (WebCore::execMoveUpAndModifySelection):
        (WebCore::execMoveWordBackward):
        (WebCore::execMoveWordBackwardAndModifySelection):
        (WebCore::execMoveWordForward):
        (WebCore::execMoveWordForwardAndModifySelection):
        (WebCore::execMoveWordLeft):
        (WebCore::execMoveWordLeftAndModifySelection):
        (WebCore::execMoveWordRight):
        (WebCore::execMoveWordRightAndModifySelection):
        (WebCore::execPaste):
        (WebCore::execSelectAll):
        (WebCore::execToggleBold):
        (WebCore::execToggleItalic):
        (WebCore::execRedo):
        (WebCore::execUndo):
        (WebCore::execInsertTab):
        (WebCore::execInsertBacktab):
        (WebCore::execInsertNewline):
        (WebCore::execInsertLineBreak):
        (WebCore::enabled):
        (WebCore::canPaste):
        (WebCore::hasEditableSelection):
        (WebCore::hasEditableRangeSelection):
        (WebCore::hasRangeSelection):
        (WebCore::hasRichlyEditableSelection):
        (WebCore::canRedo):
        (WebCore::canUndo):
        (WebCore::CommandEntry::):
        (WebCore::Editor::toggleBold):

        (WebCore::Editor::execCommand): Added optional event parameter.
        (WebCore::Editor::insertText): Added.  Calls handleTextInputEvent.
        (WebCore::Editor::insertTextWithoutSendingTextEvent): Renamed from insertText.
         Performs the actual insertion without dispatching any event.
        * editing/Editor.h:
        * page/EventHandler.cpp: (WebCore::EventHandler::defaultTextInputEventHandler):
          Call insertTextWithoutSendingTextEvent.

justing's avatar
justing committed
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
2007-03-14  Justin Garcia  <justin.garcia@apple.com>

        Reviewed by darin
        
        ~3x speedup pasting 5k lines of rich text:
        http://shakespeare.mit.edu/hamlet/full.html
        ~2x speedup pasting 10k lines of plain text
        
        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::computedStyle): Added for convenience.
        * css/CSSComputedStyleDeclaration.h:
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::removeRedundantStyles):
        The code that pushed down the top level style span had
        a bug in it that made it do unnecessary work.  Instead of
        fixing the bug I removed the code because it was used to 
        help see more redundancies in second level style spans, but 
        createMarkup now *only* creates a top level style span.
        Only remove redundant styles from style spans and only remove
        unstyled elements if they are style spans.  FF doesn't
        remove redundant styles from elements, or remove redundant 
        font tags on copy/paste.  We could offer this functionality 
        through a separate "cleanup" command.
        * editing/markup.cpp:
        (WebCore::createMarkup): Only add markup for ancestors of 
        lastClosed if we're including markup for acommonAncestorBlock 
        (we do this for commonAncestorBlocks like tables and lists),
        otherwise it's unnecessary/redundant.

andersca's avatar
andersca committed
488
489
490
491
492
493
494
495
496
497
2007-03-14  Anders Carlsson  <acarlsson@apple.com>

        Reviewed by Ada.

        Make sure to call ResourceLoader::didReceiveData to ensure that there's a shared buffer with the resource
        data, since SubresourceLoaderClients now make use of that buffer.
        
        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::didReceiveData):

498
499
500
501
502
503
504
505
506
2007-03-14  Administrator  <acarlsson@apple.com>

        Get the size from the shared buffer.
        
        * platform/graphics/cg/ImageSourceCG.cpp:
        (WebCore::ImageSource::setData):
        * platform/graphics/cg/PDFDocumentImage.cpp:
        (WebCore::PDFDocumentImage::dataChanged):

weinig's avatar
weinig committed
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
2007-03-14  Mitz Pettel  <mitz@webkit.org>

        Reviewed by Hyatt, thumbs up by Darin.

        - fix http://bugs.webkit.org/show_bug.cgi?id=12782
          Reproducible crash in BidiContext::deref

        Test: fast/dynamic/anonymous-block-orphaned-lines.html

        * rendering/InlineBox.cpp:
        (WebCore::InlineBox::root): Added an assertion that we return a root inline box.
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::removeChild): Added code to adopt the line boxes of
        anonymous blocks being destroyed instead of leaving them orphaned, which
        is what caused this crash. The boxes will be deleted on the next layout, but
        this ensures consistency in the mean time.

lars's avatar
lars committed
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
2007-03-14  Lars Knoll <lars@trolltech.com>

        Reviewed by Antti.

        Fix the Qt build.
        Add a getter to SharedBuffer that returns a reference to the internal
        Vector to avoid an extra copy of the data.

        * platform/SharedBuffer.h:
        (WebCore::SharedBuffer::buffer):
        * platform/graphics/qt/ImageQt.cpp:
        (WebCore::Image::loadPlatformResource):
        * platform/graphics/qt/ImageSourceQt.cpp:
        (WebCore::detectImageFormat):
        (WebCore::createDecoder):
        (WebCore::ImageSource::setData):

antti's avatar
antti committed
541
542
543
544
545
546
547
548
549
550
551
552
553
2007-03-14  Antti Koivisto  <antti@apple.com>

        Reviewed by Mitz.
        
        Fix <rdar://problem/5058774>
        REGRESSION: In Mail, caret appears oversized when typing in a To Do note
        
        Horizontal and vertical were switched. Was regression from
        http://trac.webkit.org/projects/webkit/changeset/20103

        * rendering/RootInlineBox.cpp:
        (WebCore::RootInlineBox::addHighlightOverflow):

554
555
556
557
558
559
560
561
562
563
564
2007-03-14  David Hyatt  <hyatt@apple.com>

        Tweak the data() functions of stylesheets and scripts to be internally consistent.

        * loader/CachedCSSStyleSheet.cpp:
        (WebCore::CachedCSSStyleSheet::data):
        * loader/CachedScript.cpp:
        (WebCore::CachedScript::data):
        * loader/CachedXSLStyleSheet.cpp:
        (WebCore::CachedXSLStyleSheet::data):

hyatt's avatar
hyatt committed
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
2007-03-14  David Hyatt  <hyatt@apple.com>

        Fix Radar 5050688.  

        For large animated GIFs, destroy and recreate the source for every animation frame.  This keeps
        the memory consumption down while giant images are animating.

        Reviewed by andersca

        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::BitmapImage):
        (WebCore::BitmapImage::destroyDecodedData):
        (WebCore::BitmapImage::dataChanged):
        (WebCore::BitmapImage::advanceAnimation):
        * platform/graphics/BitmapImage.h:

581
582
583
584
585
586
587
588
589
590
591
2007-03-14  David Hyatt  <hyatt@apple.com>

        Make sure to use CFDataCreateWithBytesNoCopy where we can.

        Reviewed by andersca

        * platform/graphics/cg/ImageSourceCG.cpp:
        (WebCore::ImageSource::setData):
        * platform/graphics/cg/PDFDocumentImage.cpp:
        (WebCore::PDFDocumentImage::dataChanged):

hyatt's avatar
hyatt committed
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
2007-03-13  David Hyatt  <hyatt@apple.com>

        Fix for bugzilla bug 13050 and also radar p1 5050645.

        This patch reworks resource loading to avoid having redundant buffers in the icon database and in cached
        images in the WebCore cache.  It also avoids overcopying in top-level image documents and in the icon
        database.

        There is now only one SharedBuffer for a resource and everybody observes that buffer now instead of ever
        making their own.  Even ImageIO uses the SharedBuffer while decoding.

        The page in 13050 dropped from 145mb down to 45mb of memory use with this change for a stunning savings
        of 100mb.

        Reviewed by olliej, mjs

        * WebCore.exp:
        * loader/CachedCSSStyleSheet.cpp:
        (WebCore::CachedCSSStyleSheet::data):
        * loader/CachedCSSStyleSheet.h:
        * loader/CachedImage.cpp:
        (WebCore::CachedImage::data):
        * loader/CachedImage.h:
        * loader/CachedResource.cpp:
        (WebCore::CachedResource::CachedResource):
        (WebCore::CachedResource::~CachedResource):
        * loader/CachedResource.h:
        (WebCore::CachedResource::data):
        * loader/CachedScript.cpp:
        (WebCore::CachedScript::data):
        * loader/CachedScript.h:
        * loader/CachedXSLStyleSheet.cpp:
        (WebCore::CachedXSLStyleSheet::data):
        * loader/CachedXSLStyleSheet.h:
        * loader/DocLoader.cpp:
        (WebCore::DocLoader::checkCacheObjectStatus):
        * loader/ImageDocument.cpp:
        (WebCore::ImageTokenizer::writeRawData):
        (WebCore::ImageTokenizer::finish):
        * loader/icon/IconDataCache.cpp:
        (WebCore::IconDataCache::setImageData):
        (WebCore::IconDataCache::writeToDatabase):
        * loader/icon/IconDataCache.h:
        * loader/icon/IconDatabase.cpp:
        (WebCore::IconDatabase::imageDataForIconURL):
        (WebCore::IconDatabase::iconForPageURL):
        (WebCore::IconDatabase::setIconDataForIconURL):
        (WebCore::IconDatabase::setHaveNoIconForIconURL):
        (WebCore::IconDatabase::imageDataForIconURLQuery):
        * loader/icon/IconDatabase.h:
        * loader/icon/IconLoader.cpp:
        (WebCore::IconLoader::startLoading):
        (WebCore::IconLoader::didReceiveResponse):
        (WebCore::IconLoader::didReceiveData):
        (WebCore::IconLoader::didFail):
        (WebCore::IconLoader::finishLoading):
        (WebCore::IconLoader::clearLoadingState):
        * loader/icon/IconLoader.h:
        * loader/icon/SQLStatement.cpp:
        (WebCore::SQLStatement::getColumnBlobAsVector):
        (WebCore::SQLStatement::isExpired):
        * loader/icon/SQLStatement.h:
        * loader/loader.cpp:
        (WebCore::Loader::didFinishLoading):
        (WebCore::Loader::didReceiveData):
        * page/mac/WebCoreFrameBridge.mm:
        (-[WebCoreFrameBridge getData:andResponse:forURL:]):
        (-[WebCoreFrameBridge getAllResourceDatas:andResponses:]):
        * platform/SharedBuffer.h:
        (WebCore::SharedBuffer::isEmpty):
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::destroyDecodedData):
        (WebCore::BitmapImage::dataChanged):
        * platform/graphics/BitmapImage.h:
        * platform/graphics/Image.cpp:
        (WebCore::Image::setData):
        * platform/graphics/Image.h:
        (WebCore::Image::dataChanged):
        (WebCore::Image::data):
        * platform/graphics/ImageSource.h:
        * platform/graphics/cg/ImageSourceCG.cpp:
        (WebCore::ImageSource::setData):
        * platform/graphics/cg/PDFDocumentImage.cpp:
        (WebCore::PDFDocumentImage::dataChanged):
        * platform/graphics/cg/PDFDocumentImage.h:
        * platform/graphics/mac/ImageMac.mm:
        (WebCore::Image::loadPlatformResource):
        * platform/graphics/svg/SVGImage.cpp:
        (WebCore::SVGImage::setData):
        * platform/mac/PasteboardMac.mm:
        (WebCore::fileWrapperForImage):

justing's avatar
justing committed
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
2007-03-13  Justin Garcia  <justin.garcia@apple.com>

        Reviewed by darin
        
        <rdar://problem/5046875> 
        Gmail Editor: Applying alignment to selected text in message also applies alignment to signature

        * editing/ApplyStyleCommand.cpp:
        (WebCore::ApplyStyleCommand::doApply): Don't call applyBlockStyle unless
        there is a block style to apply.
        (WebCore::ApplyStyleCommand::applyBlockStyle): Don't do the remove step.
        It was unnecessary and removed properties from blocks that could contain 
        content outside the range being operated on (added a testcase).
        (WebCore::ApplyStyleCommand::addBlockStyleIfNeeded): Used an early return
        instead of if-nesting.
        * editing/ApplyStyleCommand.h:
        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
        Return the new block, if one was created.  Use moveParagraphs to move
        paragraphs into the new block, instead of moving nodes.  The old code moved
        too much (added a testcase).
        * editing/CompositeEditCommand.h:

707
708
709
710
711
712
713
714
715
716
717
718
2007-03-13  Oliver Hunt  <oliver@apple.com>

        Reviewed by Brady.

        To fix <rdar://problem/5044366> we now pass a NSString
        representation of the URL extracted with _web_originalDataAsString
        instead of relying on [NSURL absoluteString] in the bridge

        * page/mac/WebCoreFrameBridge.h:
        * page/mac/WebCoreFrameBridge.mm:
        (-[WebCoreFrameBridge getData:andResponse:forURL:]):

beidson's avatar
beidson committed
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
2007-03-13  Brady Eidson  <beidson@apple.com>

        Reviewed by Anders

        <rdar://problem/5048818> - REGRESSION: Incompletely loaded resources being saved to the object cache

        Due to a subtle change in loader behavior back in 10904, we would stop all loaders before calling 
        didFail() on them in the Cache loader.  As a result, we basically cleared all of the Subresource Loaders 
        out of the Cache loader before more properly failing them as errored out.  The result?  Partially loaded
        resources being cached.
        
        Since Loader::didFail() both calls error() on the object *and* removes the loader, the solution is to call 
        didFail() for all cancelled loaders instead of *only* removing them from the set of active loaders.
        
        In addition, pages that didn't completely load were being saved to the back/forward cache.  To fix that,
        I added a null check on the DocumentLoader's error to see if the page ended in an error, or did indeed 
        completely load.

        Note that the layout test for this - if possible - will require other enhancements including possibly adding
        support for window.stop().  That task is documented in <rdar://problem/5061826>

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::provisionalLoadStarted): Fixed a few bugs relating to my original BFCache rewrite to
          more perfectly restore the original behavior - including only caching HTML documents via the 
          m_client->canCachePage() call
        (WebCore::FrameLoader::canCachePage): Don't make the call to m_client->canCachePage() as that serves a different
          purpose
          - Check the mainDocumentError to see if the load ended in error as a further criteria in determining the 
          cachability of a page

        * loader/loader.cpp:
        (WebCore::Loader::cancelRequests): Call didFail(cancelledError()) instead of just removing the loaders from the 
          loaders-in-progress set.  This adds the effect of properly cleaning up the cached object.

bdakin's avatar
bdakin committed
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
2007-03-13  Beth Dakin  <bdakin@apple.com>

        Rendering part reviewed by Hyatt. Editing part consulted with and 
        rubber stamped by Justin and Harrison.

        Fix for <rdar://problem/5025925> A hang occurs in Safari when 
        attempting to print page at http://www.pcadvisor.co.uk

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::makeChildrenNonInline): 
        RenderBlock::makeChildrenNonInline() takes a block's inline 
        children and turns them into block children. If the children had 
        line boxes, those boxes were being leaked. In the layout test I 
        added with the change (and at pcadvisor.co.uk during printing) 
        children were being made non-inline, and then they were being made 
        inline again. This meant that some of the children ended up 
        pointing to totally stale line boxes that are normally just leaked. 
        This caused an infinite loop in RenderFlow::destroy(). This patch 
        simply deletes everyone's line boxes in 
        RenderBlock::makeChildrenNonInline()

        * editing/InsertParagraphSeparatorCommand.cpp:
        (WebCore::InsertParagraphSeparatorCommand::doApply): The other part 
        of this fix is that I added a call to updateLayout in 
        InsertParagraphSeparatorCommand::doApply(). One layout test 
        (editing/spelling/spelling.html) was changed by my patch to 
        RenderBlock. doApply() inserts a node into the render tree. In at 
        least one case in spelling.html, that caused some line boxes to be 
        deleted. Back in doApply() this meant that the RenderTree was out-
        of-date, and we mistakenly thought we were at the end of the 
        paragraph. This caused us to insert a RenderBR() at the end of the 
        tree instead of an empty RenderText(). No one seems to know exactly 
        why we insert either, or if the change is necessarily a problem. It 
        is clear, though, that the RenderTree in doApply() is out-of-date 
        after inserting the node and deleting some line boxes, so it seems 
        prudent to call into updateLayout().

aroben's avatar
aroben committed
790
791
792
793
794
795
2007-03-13  Adam Roben  <aroben@apple.com>

        Reviewed by Anders.

        * platform/FontData.h: Added m_isSystemFont parameter to match NSFont.

bdakin's avatar
bdakin committed
796
797
798
799
2007-03-13  Beth Dakin  <bdakin@apple.com>

        Reviewed by Maciej.

bdakin's avatar
bdakin committed
800
        Export DocumentLoader::setFrame(). Part of fix for <rdar://
bdakin's avatar
bdakin committed
801
802
803
804
805
        problem/4277074> 8F32: Help Viewer crashed on clicking link - 
        KHTMLView::viewportMouseReleaseEvent (12647)

        * WebCore.exp:

darin's avatar
darin committed
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
2007-03-13  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fix http://bugs.webkit.org/show_bug.cgi?id=12794
          <rdar://problem/5028154> REGRESSION: TripTik planner at aaa.com never
          finishes loading due to unclosed canvas tag (12794)

        Change <canvas> elements so that their contents are parsed normally,
        but not rendered. This change fixes the bug, because normal parsing
        rules close the <canvas> element in that case. The special parser
        stuff was just getting in the way.

        Also do some basic cleanup to the HTML parser. This was motivated by
        an earlier version of this patch that made even more changes to the
        parser, but the cleanup is still worth landing.

        Test: fast/canvas/canvas-hides-fallback.html
        Test: fast/canvas/script-inside-canvas-fallback.html
        Test: fast/canvas/unclosed-canvas-1.html
        Test: fast/canvas/unclosed-canvas-2.html
        Test: fast/canvas/unclosed-canvas-3.html
        Test: fast/canvas/unclosed-canvas-4.html

        * html/HTMLCanvasElement.h: Added a data member to keep track of whether the
        renderer is a RenderHTMLCanvas or not.
        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::createRenderer): If JavaScript is enabled, create
        a RenderHTMLCanvas. If it's not, let the default code create the default type
        of renderer, which will result in fallback content being visible. The
        RenderHTMLCanvas class already hides all of its children. Set the m_rendererIsCanvas
        boolean accordingly. Since the actual storage for the canvas is allocated lazily
        when you actually get a drawing context, we don't need to do anything special
        to prevent it when JavaScript is disabled; the relevant functions won't be called.
        (WebCore::HTMLCanvasElement::reset): Protect the code that manipulates the
        RenderHTMLCanvas with a check of m_rendererIsCanvas. This is the only code inside
        the DOM element that relies on the renderer type.

        * html/HTMLParser.h: Removed unneeded includes. Marked HTMLParser as
        Noncopyable. Changed the Document parameter to the constructor to instead
darin's avatar
darin committed
846
        be HTMLDocument. Renamed discard_until to m_skipModeTag for clarity.
darin's avatar
darin committed
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
        Removed unused noSpaces function and unneeded public doc() function.
        Moved data members all down to the end so you can see them together in order.
        Renamed map to m_currentMapElement and isindex to m_isindexElement.
        Removed unused end and headLoaded data members.  Renamed m_fragment to
        m_isParsingFragment to make it clearer that it's a boolean, not a fragment.

        * html/HTMLParser.cpp:
        (WebCore::HTMLParser::HTMLParser): Changed to use member construction
        syntax instead of calling reset(). This is especially helpful in the
        fragment case, where calling reset() later on is illegal, so not using
        it in the constructor lets us assert.
        (WebCore::HTMLParser::~HTMLParser): Did an explicit deref instead of
        calling setCurrent for its side effect.
        (WebCore::HTMLParser::reset): Updated for member name changes and removal
        and to use document instead of doc().
        (WebCore::HTMLParser::setCurrent): Use document instead of doc().
        (WebCore::HTMLParser::setSkipMode): Added. No longer inline. Now sets the
        m_inCanvasBeforeFirstOpenTag data member to false.
        (WebCore::HTMLParser::parseToken): Tightened up the skip mode logic at the
        top of the function, and added a FIXME about the strange case there where
        we don't skip yet stay in skip mode. Updated for renaming and doc().
        (WebCore::HTMLParser::insertNode): Updated for renaming and doc().
        (WebCore::HTMLParser::handleError): Ditto.
        (WebCore::HTMLParser::framesetCreateErrorCheck): Ditto.
        (WebCore::HTMLParser::isindexCreateErrorCheck): Changed to use RefPtr.
        (WebCore::HTMLParser::noscriptCreateErrorCheck): Updated for renaming and doc().
        (WebCore::HTMLParser::mapCreateErrorCheck): Ditto.
        (WebCore::HTMLParser::getNode): Removed the special case for canvas here.
        Canvas fallback is now handled in the DOM, not the parser. Updated for
        renaming and doc().
        (WebCore::HTMLParser::allowNestedRedundantTag): Changed a #define into a C++
        constant.
        (WebCore::HTMLParser::processCloseTag): Updated for renaming and doc().
        (WebCore::HTMLParser::isInline): Ditto.
        (WebCore::HTMLParser::tagIsOnStack): Added. Used by new canvas logic.
        (WebCore::HTMLParser::popBlock): Updated for renaming and doc(). Also renamed
        the local variable Elem to elem.
        (WebCore::HTMLParser::createHead): Ditto.
        (WebCore::HTMLParser::handleIsindex): Changed to use RefPtr.
        (WebCore::HTMLParser::startBody): Updated for renaming and doc().
        (WebCore::HTMLParser::finished): Ditto.

889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
2007-03-13  David Hyatt  <hyatt@apple.com>

        Two more cleanup fixes to the cache.  Don't call destroyDecodedData in the BitmapImage destructor, since
        clearing the image source and calling setData on it again causes it to do an extra copy of the encoded
        data.  Since we're about to be destroyed this is just wasteful.

        When the cache prunes, don't allow it to destroy the decoded data of an image that is still actively loading,
        since we've established that ImageIO can actually crash if you yank the rug out from under it like that.

        Reviewed by ggaren

        * loader/Cache.cpp:
        (WebCore::Cache::prune):
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::~BitmapImage):

andersca's avatar
andersca committed
905
906
907
908
909
910
911
2007-03-13  Anders Carlsson  <acarlsson@apple.com>

        Try fixing the Qt build.
        
        * editing/Editor.h:
        (WebCore::Editor::setStartNewKillRingSequence):

harrison's avatar
harrison committed
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
2007-03-13  David Harrison  <harrison@apple.com>

        Reviewed by Justin.

        <rdar://problem/5031181> cntl-k at end of paragraph adds nothing to the kill ring
        <rdar://problem/5031189> REGRESSION: cntl-y yanks only the most recently killed content

        For rdar://5031181, properly extend the selection before the killring handling, and
        make sure plainText of that selection returns a linefeed.
        
        For rdar://5031189, restore Editor::deleteRange() code that continued current killring,
        even though the range deletion implicitly stopped it via changing the selection.
        
        A byproduct of this change is the elimination of RUNDFINDER vs CONTENT TextIterator. The
        only difference between the two was whether to emit a newline when the range started
        with a blockflow element. No callers actually need that any more.

        Tests added:
        * editing/pasteboard/emacs-ctrl-k-y-001-expected.checksum: Added.
        * editing/pasteboard/emacs-ctrl-k-y-001-expected.png: Added.
        * editing/pasteboard/emacs-ctrl-k-y-001-expected.txt: Added.
        * editing/pasteboard/emacs-ctrl-k-y-001.html: Added.

        * editing/Editor.cpp:
        (WebCore::Editor::deleteRange):
        Clear the "start new kill ring sequence" setting, because it was set to true
        when the selection was updated by deleting the range.
        
        (WebCore::Editor::deleteWithDirection):
        If extending the selection to the end of paragraph resulted in a caret selection,
        extend by character, to handle the case when the selection started as a caret at
        the end of paragraph.
        
        * editing/TextIterator.cpp:
        (WebCore::TextIterator::TextIterator):
        Initialize new member variables for tracking handling of the beginning of the range.
        
        (WebCore::TextIterator::advance):
        Call representNodeOffsetZero on the m_endContainer.
        Move visibility checks into handleTextNode and handleReplacedElement.
        
        (WebCore::TextIterator::handleTextNode):
        (WebCore::TextIterator::handleTextBox):
        Call emitText.
        
        (WebCore::TextIterator::handleReplacedElement):
        Moved visibility check into here.
        
        (WebCore::shouldEmitNewlinesBeforeAndAfterNode):
        
        (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
        (WebCore::TextIterator::representNodeOffsetZero):
        New. Emits proper sequence when encountering offset 0 of a node, including the
        m_endContainer. Started with code from handleNonTextNode.
        
        (WebCore::TextIterator::handleNonTextNode):
        Call representNodeOffsetZero.
        
        (WebCore::TextIterator::exitNode):
        Similar to shouldRepresentNodeOffsetZero, do not emit the newline if the node
        was collapsed, and before any other emitted content.
        
        (WebCore::TextIterator::emitCharacter):
        
        (WebCore::TextIterator::emitText):
        New. Consolidates code used by handleText and handleTextBox.
        
        (WebCore::CharacterIterator::CharacterIterator):
        Removed RUNFINDER.

        (WebCore::WordAwareIterator::WordAwareIterator):
        Removed RUNFINDER.
        
        (WebCore::WordAwareIterator::advance):
        Formatting.

        (WebCore::TextIterator::rangeLength):
        Formatting.
        
        * editing/TextIterator.h:
        Added member variables for tracking handling of the beginning of the range.
        Eliminated concept of RUNDFINDER vs CONTENT TextIterator.
        
        * editing/visible_units.cpp:
        (WebCore::nextBoundary):
        Eliminated concept of RUNDFINDER vs CONTENT TextIterator.

999
1000
2007-03-13  David Hyatt  <hyatt@apple.com>