2006-07-27 Eric Seidel <eric@eseidel.com>
[WebKit-https.git] / WebCore / ChangeLog
1 2006-07-27  Eric Seidel  <eric@eseidel.com>
2
3         Reviewed by ap.
4
5         Complex entities seem to fail on TOT
6         http://bugzilla.opendarwin.org/show_bug.cgi?id=6390
7         Use an alternative work-around to an XML Entity parsing bug.
8
9         * dom/XMLTokenizer.cpp:
10         (WebCore::XMLTokenizer::write):
11         (WebCore::hackAroundLibXMLEntityBug): added.
12         (WebCore::startElementNsHandler):
13         (WebCore::endElementNsHandler):
14         (WebCore::charactersHandler):
15         (WebCore::processingInstructionHandler):
16         (WebCore::cdataBlockHandler):
17         (WebCore::commentHandler):
18         (WebCore::getEntityHandler):
19
20 2006-07-27  Rob Buis  <buis@kde.org>
21
22         Reviewed by Darin.
23
24         http://bugzilla.opendarwin.org/show_bug.cgi?id=9938
25         Fix viewBox issues in Hixie's test
26
27         Do a more accurate and quicker job of parsing the viewBox
28         attribute. Handle properly on negative width/height and
29         invalid syntax in general.
30
31         * ksvg2/svg/SVGFitToViewBox.cpp:
32         (SVGFitToViewBox::parseViewBox):
33
34 2006-07-27  Eric Seidel  <eric@eseidel.com>
35
36         Reviewed by ap.
37
38         Enables getSVGDocument() support for HTMLObjectElement and HTMLEmbedElement
39         http://bugzilla.opendarwin.org/show_bug.cgi?id=9237
40         This patch does not try to autogenerate anything, but enables the SVG functionality.
41         Also fix HTMLObjectElement vspace and hspace to be numbers instead of strings to match IE & Firefox.
42
43         * bindings/js/kjs_dom.cpp:
44         (KJS::toJS):
45         * bindings/js/kjs_html.cpp:
46         (KJS::JSHTMLElement::objectGetter):
47         (KJS::HTMLElementFunction::callAsFunction):
48         (KJS::JSHTMLElement::objectSetter):
49         * bindings/js/kjs_html.h:
50         (KJS::JSHTMLElement::):
51         * dom/Document.h:
52         (WebCore::Document::isSVGDocument):
53         * html/HTMLEmbedElement.cpp:
54         (WebCore::HTMLEmbedElement::contentDocument):
55         (WebCore::HTMLEmbedElement::getSVGDocument):
56         * html/HTMLEmbedElement.h:
57         * html/HTMLObjectElement.cpp:
58         (WebCore::HTMLObjectElement::HTMLObjectElement):
59         (WebCore::HTMLObjectElement::getInstance):
60         (WebCore::HTMLObjectElement::parseMappedAttribute):
61         (WebCore::HTMLObjectElement::contentDocument):
62         (WebCore::HTMLObjectElement::rendererIsNeeded):
63         (WebCore::HTMLObjectElement::createRenderer):
64         (WebCore::HTMLObjectElement::setCode):
65         (WebCore::HTMLObjectElement::setArchive):
66         (WebCore::HTMLObjectElement::setBorder):
67         (WebCore::HTMLObjectElement::setCodeBase):
68         (WebCore::HTMLObjectElement::setCodeType):
69         (WebCore::HTMLObjectElement::setData):
70         (WebCore::HTMLObjectElement::hspace):
71         (WebCore::HTMLObjectElement::setHspace):
72         (WebCore::HTMLObjectElement::setStandby):
73         (WebCore::HTMLObjectElement::setType):
74         (WebCore::HTMLObjectElement::setUseMap):
75         (WebCore::HTMLObjectElement::vspace):
76         (WebCore::HTMLObjectElement::setVspace):
77         (WebCore::HTMLObjectElement::getSVGDocument):
78         * html/HTMLObjectElement.h:
79         * ksvg2/svg/SVGDocument.h:
80         (WebCore::SVGDocument::isSVGDocument):
81         * rendering/RenderWidget.h:
82         (WebCore::RenderWidget::frameView):
83
84 2006-07-26  Alexey Proskuryakov  <ap@nypop.com>
85
86         Reviewed by Darin.
87
88         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9901
89         XSLTProcessor cannot parse text nodes for INPUT ELEMENTS in an XSLT stylesheet
90
91         Test: fast/js/xhtml-serialize.html
92
93         * editing/markup.cpp:
94         (WebCore::endMarkup): If the element has child nodes, write a closing tag even if it 
95         is not permitted in HTML, to make it valid XML.
96
97 2006-07-26  Alice Liu  <alice.liu@apple.com>
98
99         Reviewed by John Sullivan (and Kevin and Timo).
100
101         landing this patch for John et al.  
102         Fixed <rdar://problem/4651380> REGRESSION (9A232->9A234): existing web clips don't render if you restart Dashboard
103
104         * page/FrameView.cpp:
105         (WebCore::FrameView::layout):
106         moved the call to didFirstLayout to above the check for needsLayout
107         because we need to call didFirstLayout for every webview, not just
108         ones we think need layout.  
109
110 2006-07-26  Justin Garcia  <justin.garcia@apple.com>
111
112         Reviewed by darin
113         
114         <rdar://problem/4652788>
115         REGRESSION: Can't change size or style of any text in message body
116
117         * dom/Node.cpp:
118         (WebCore::Node::isContentRichlyEditable): Mimic Node::isContentEditable.
119         * html/HTMLElement.cpp:
120         (WebCore::HTMLElement::isContentRichlyEditable): First check
121         the frame for editability, then userModify, like what
122         HTMLElement::isContentEditable() does.
123         * html/HTMLElement.h:
124
125 2006-07-26  Mitz Pettel  <opendarwin.org@mitzpettel.com>
126
127         Reviewed by ap.
128
129         - fix debug-only information() string for table cells
130
131         * rendering/RenderObject.cpp:
132         (WebCore::RenderObject::information):
133
134 2006-07-25  David Harrison  <harrison@apple.com>
135
136         Reviewed by timo and Darin.
137
138         <rdar://problem/4618584> "Paste and Match Style" is not working in Mail (add SPI)
139         
140         * WebCore.xcodeproj/project.pbxproj:
141         * bridge/mac/WebCoreFrameBridge.h:
142         * bridge/mac/WebCoreFrameBridge.mm:
143         (-[WebCoreFrameBridge replaceSelectionWithNode:selectReplacement:smartReplace:matchStyle:]):
144         Add matchStyle parameter for use by WebKit.
145
146 2006-07-25  Justin Garcia  <justin.garcia@apple.com>
147
148         Reviewed by adele
149         
150         <rdar://problem/4649560>
151         REGRESSION: Can't Select All when the body is contentEditable="true"
152
153         * editing/VisiblePosition.cpp:
154         (WebCore::VisiblePosition::canonicalPosition): Allow descent from a non-editable html
155         element into an editable body as a convenience.
156
157 2006-07-25  Justin Garcia  <justin.garcia@apple.com>
158
159         Reviewed by darin
160         
161         <rdar://problem/4468458> Incoming HTML message is editable <body contenteditable="true">
162
163         * dom/Document.cpp:
164         (WebCore::Document::inDesignMode): Removed some spaces.
165         * page/Frame.cpp:
166         (WebCore::Frame::applyEditingStyleToElement): Just add CSS properties needed for editing.
167         (WebCore::Frame::removeEditingStyleFromElement): Made this a no-op, we'll remove
168         it eventually.
169
170 2006-07-25  David Kilzer  <ddkilzer@kilzer.net>
171
172         Reviewed by Darin.
173
174         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9717
175           Replace IDL ConvertUndefinedToTrue parameter attribute with Optional attribute
176
177         No test added because there is no change in functionality.
178
179         * bindings/js/kjs_binding.cpp: Removed valueToBooleanTreatUndefinedAsTrue() method.
180         * bindings/js/kjs_binding.h: Ditto.
181         * bindings/scripts/CodeGeneratorJS.pm: Removed support for ConvertUndefinedToTrue parameter attribute.
182         * dom/Element.h: Set default value to true for scrollIntoView() and scrollIntoViewIfNeeded() arguments.
183         * dom/Element.idl: Replaced ConvertUndefinedToTrue attribute with Optional attribute.
184           Fixed name of scrollIntoViewIfNeeded() argument to match implementation.
185         * page/DOMWindow.idl: Replaced ConvertUndefinedToTrue attribute with Optional attribute.
186
187 2006-07-24  Dan Waylonis  <waylonis@google.com>
188
189         Reviewed and tweaked a bunch by Darin.
190
191         Test: plugins/bindings-test.html
192
193         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9902
194           jsNull and NSNull not properly converted between JS and ObjC
195
196         * bindings/objc/WebScriptObject.mm:
197         (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
198         Added case that converts jsNull to NSNull.
199
200 2006-07-24  Darin Adler  <darin@apple.com>
201
202         Reviewed by Adele and Justin.
203
204         - fix <rdar://problem/4613616> REGRESSION: some spaces typed in <textarea> are posted as non-breaking spaces (9630)
205           http://bugzilla.opendarwin.org/show_bug.cgi?id=9630
206         - also fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=9939
207           REGRESSION: Pasting text into native text area with newline at end does not preserve newline
208         - removed some uses of DeprecatedPtrList in the markup code
209
210         Test: fast/forms/textarea-type-spaces.html
211         Test: fast/forms/textarea-paste-newline.html
212
213         * bindings/objc/DOMHTML.mm: (-[DOMHTMLDocument createDocumentFragmentWithText:]):
214         Updated call to pass a range -- in this case it is the range of the entire document,
215         so this will not handle the whitespace properly.
216
217         * bridge/mac/WebCoreFrameBridge.h: Added range context parameter to the
218         documentFragmentWithText: method, so we can handle whitespace properly.
219         * bridge/mac/WebCoreFrameBridge.mm:
220         (-[WebCoreFrameBridge nodesFromList:]): Changed from DeprecatedPtrList to Vector.
221         (-[WebCoreFrameBridge markupStringFromNode:nodes:]): Ditto.
222         (-[WebCoreFrameBridge markupStringFromRange:nodes:]): Ditto.
223         (-[WebCoreFrameBridge documentFragmentWithText:inContext:]): Added range context
224         parameter -- pass it on to createFragmentFromText.
225         (-[WebCoreFrameBridge documentFragmentWithNodesAsParagraphs:]): Changed from
226         DeprecatedPtrList to Vector.
227         (-[WebCoreFrameBridge replaceSelectionWithText:selectReplacement:smartReplace:]):
228         Pass the range of the current selection as context when creating the fragment.
229
230         * dom/Position.cpp: (WebCore::Position::inRenderedText): Replace range check with
231         a call to the new containsCaretOffset function -- helps make the caret work right when
232         it is past the end of the last line in a textarea.
233
234         * editing/CompositeEditCommand.cpp:
235         (WebCore::CompositeEditCommand::rebalanceWhitespaceAt): Don't do anything if the
236         style does not call for collapsing whitespace.
237         (WebCore::CompositeEditCommand::rebalanceWhitespace): Call replaceWhitespaceAt
238         to share code, including the new logic mentioned above.
239
240         * editing/InsertLineBreakCommand.cpp: (WebCore::InsertLineBreakCommand::doApply):
241         Use a text node instead of a break element when inserting and the style is preserveNewline.
242
243         * editing/JSEditor.cpp: (WebCore::execRemoveFormat): Pass the selection range
244         to createFragmentFromText.
245
246         * editing/RebalanceWhitespaceCommand.cpp: (WebCore::RebalanceWhitespaceCommand::doApply):
247         Assert that we're in a style that collapses whitespace. It's the caller's responsibility
248         not to call otherwise.
249
250         * editing/ReplaceSelectionCommand.h: Removed unused destructor, type, isSingleTextNode,
251         isTreeFragment, m_type, and added a context parameter to inertFragmentForTestRendering.
252         Also changed the constructor to take a selection rather than a pointer to the root
253         editable element, replaced removeEndBRIfNeeded with shouldRemoveEndBR and removed an
254         unused parameter from shouldMergeEnd.
255         * editing/ReplaceSelectionCommand.cpp:
256         (WebCore::ReplacementFragment::ReplacementFragment): Removed code to set up m_type.
257         Compute root editable element from passed-in selection. Used the start of the selection
258         as a base node for style purposes for the test rendering. Removed the special case
259         "single text node" alternative to createFragmentFromText in the plain text case, since
260         createFragmentFromText now handles that correctly.
261         (WebCore::ReplacementFragment::insertFragmentForTestRendering): Copy the whitespace
262         property from the source location when creating a temporary element for test rendering.
263         (WebCore::ReplacementFragment::shouldMergeEnd): Removed unneeded boolean
264         parameter fragmentHadInterchangeNewlineAtEnd, which is always false.
265         (WebCore::ReplaceSelectionCommand::doApply): Update for ReplacementFragment changes,
266         change code to not remove end BR when it can be re-used instead, don't call the
267         paragraph separator insertion when the position is at the start of a paragraph already,
268         removed redundant computation of identical "next" value, removed unneeded boolean
269         parameter to shouldMergeEnd, add case for merging when all we need to do is to delete
270         a newline character, removed unneeded code to set insertionPos after all code that uses
271         it, and  use spaces instead of non-breaking spaces when doing smart paste if the
272         context is one where we do not collapse white space.
273         (WebCore::ReplaceSelectionCommand::shouldRemoveEndBR): Renamed and changed to return
274         a boolean instead of doing the removal.
275
276         * editing/markup.h: Use Vector instead of DeprecatedPtrList. Change the
277         createFragmentFromText function to take a range for context instead of a document.
278         * editing/markup.cpp:
279         (WebCore::markup): Use Vector instead of DeprecatedPtrList.
280         (WebCore::createMarkup): Ditto.
281         (WebCore::createParagraphContentsFromString): Remove unneeded document parameter
282         and changed a couple places to use isEmpty instead of comparing with "".
283         (WebCore::createFragmentFromText): Given the new context parameter, if the context
284         is one that preserves newlines, then use "\n" instead of <br> elements.
285         (WebCore::createFragmentFromNodes): Use Vector instead of DeprecatedPtrList.
286
287         * html/HTMLElement.cpp: (WebCore::HTMLElement::setInnerText): Do not use <br>
288         elements if the context of this node is one where we preserve newlines.
289
290         * rendering/InlineTextBox.h:
291         * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::containsCaretOffset):
292         Added. Implements the appropriate rule for determining if a caret position is
293         in this line or not. Returns true for both one line and the next in cases where
294         affinity must be considered to determine which line the caret is on.
295
296         * rendering/RenderText.h: Make atLineWrap no longer be a member function.
297         * rendering/RenderText.cpp:
298         (WebCore::atLineWrap): Remove special rule about preserveNewline and isLineBreak,
299         which will no longer apply due to the new containsCaretOffset function logic.
300         (WebCore::RenderText::caretRect): Use containsCaretOffset.
301         (WebCore::RenderText::inlineBox): Ditto.
302
303         * rendering/RenderTextControl.cpp:
304         (WebCore::RenderTextControl::updateFromElement): Make a placeholder <br> element
305         after calling setInnerText so that the last newline in the string has the effect
306         we expect outside the HTML world (an additional line).
307         (WebCore::RenderTextControl::setSelectionRange): Set granularity of the selection
308         too. The layout tests caught this problem, which needs a better solution long term.
309         (WebCore::RenderTextControl::text): Call textContent with the parameter false
310         so it will not include newlines for <br> elements. Now the only <br> element
311         that will ever be in the shadow DOM tree is the one to prevent collapsing, and
312         that one should not show up in the text value.
313
314         * rendering/bidi.cpp: (WebCore::RenderBlock::findNextLineBreak): Took a rule
315         that specifically called out the pre whitespace mode and made it work for all
316         the modes that preserve newlines. This makes sure we get a last line box for
317         text after the last "\n" even in cases where there is no <br> afterward.
318
319         * editing/DeleteSelectionCommand.cpp:
320         (WebCore::DeleteSelectionCommand::fixupWhitespace):
321         * editing/InsertParagraphSeparatorCommand.cpp:
322         (WebCore::InsertParagraphSeparatorCommand::doApply):
323         Added assertions to make sure we don't do anything when we're not collapsing
324         whitespace.
325
326         * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::setDefaultValue):
327         Changed to use Vector instead of DeprecatedPtrList.
328
329         * editing/HTMLInterchange.cpp: Removed obsolete comment.
330
331         * loader/Cache.h: Removed a stray include.
332
333 2006-07-24  Adele Peterson  <adele@apple.com>
334
335         Reviewed by Justin.
336
337         - Fix for <rdar://problem/4632132> Changing style of content with mixed editability fails
338
339         Test: * editing/style/apple-style-editable-mix.html
340
341         * dom/Node.cpp: (WebCore::Node::isContentRichlyEditable): Doesn't need to check the editable root.  It now just
342           checks the user modify property of its own renderer, since that is inherited.
343         * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::applyInlineStyle): If the end position is in a table,
344         Adjust the end node to the last descendant of the table, so we don't skip over any runs.
345
346 2006-07-24  Darin Adler  <darin@apple.com>
347
348         Reviewed by Hyatt.
349
350         - implement String::createCFString
351
352         * WebCore.xcodeproj/project.pbxproj: Added StringImplMac.mm and StringMac.mm.
353
354         * bindings/objc/DOMInternal.mm: Moved NSString conversion functions out of here.
355
356         * platform/mac/StringImplMac.mm: Added. Moved NSString conversion members here
357         and added the CFStringRef ones.
358         * platform/mac/StringMac.mm: Added. Ditto.
359
360 2006-07-24  David Hyatt  <hyatt@apple.com>
361
362         Two bug fixes.
363
364         (1) Make sure to mark positioned objects that depend on line position to
365         mark themselves as needing layout when their line box placeholder gets
366         repositioned.
367
368         * rendering/RenderBox.cpp:
369         (WebCore::RenderBox::position):
370        
371         (2) Improve highlighting to factor the inflation into overflow so that
372         invalidation and repainting will work properly.
373
374         * rendering/RootInlineBox.cpp:
375         (WebCore::RootInlineBox::addHighlightOverflow):
376         * rendering/RootInlineBox.h:
377         * rendering/bidi.cpp:
378         (WebCore::RenderBlock::layoutInlineChildren):
379
380 2006-07-24  Anders Carlsson  <acarlsson@apple.com>
381
382         Reviewed by Adele.
383
384         <rdar://problem/4641824> REGRESSION: Wikipedia widget fails to complete a search after pressing return key
385         
386         * html/HTMLInputElement.cpp:
387         (WebCore::HTMLInputElement::defaultEventHandler):
388         Don't eat enter events for search fields that have no enclosing form; they need to be passed to AppKit so
389         that onsearch can be invoked.
390         
391         * manual-tests/onsearch-enter.html: Added.
392
393 2006-07-24  Dave MacLachlan  <dmaclach@mac.com>
394
395         Reviewed by Darin and Alexey.
396         
397         Fix for: <http://bugzilla.opendarwin.org/show_bug.cgi?id=8425> 
398         and <http://bugzilla.opendarwin.org/show_bug.cgi?id=6947>
399
400         Test: svg/custom/non-opaque-filters.svg
401
402         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
403         (WebCore::KCanvasFilterQuartz::prepareFilter):
404         We create an autorelease pool so we can control the deallocation of the
405         CIContext that we're creating. The CIContext retains the CGContext that 
406         you pass it internally so when the CIContext is released, the 
407         CGContext is released as well.
408         This is all fine and dandy unless you wrap the creation of the CIFilter
409         with a pair of CGBegin/EndTransparencyLayer calls which swap the context
410         out from underneath you. So if you start with context A, 
411         CGBeginTransparencyLayer swaps it out and gives you B. You create a CIFilter
412         with it and add a reference to B. CGEndTransparencyLayer swaps out B and
413         gives you back A. Autorelease pool comes and cleans up the Filter, and calls
414         release on A, but A never got the refcount in the first place. B did. BOOM!
415         So we create a pool, then do a retain, then release the pool so that we 
416         don't have to worry about the pool releasing it at a later time.
417         See <rdar://problem/4647735> for reduction of CGEndTransparencyLayer case
418
419 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
420
421         Reviewed by Hyatt.
422
423         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9669
424           Incomplete repaint when changing an inline's border
425
426         Test: fast/repaint/line-overflow.html
427
428         * rendering/RenderBlock.h:
429         * rendering/bidi.cpp:
430         (WebCore::RenderBlock::layoutInlineChildren): Added repaintTop and repaintBottom
431         variables to track the vertical edges of the area that changed, accounting for
432         lines that were deleted, inserted or moved. Removed unnecessary updating of
433         m_overflowHeight.
434         (WebCore::RenderBlock::determineStartPosition): Removed unnecessary updating of
435         m_overflowHeight.
436         (WebCore::RenderBlock::determineEndPosition):
437         (WebCore::RenderBlock::matchedEndLine): Added repaintTop and repaintBottom
438         arguments, which this method updates to account for deleted lines.
439         (WebCore::RenderBlock::checkLinesForOverflow): Removed outdated FIXME.
440
441 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
442
443         Reviewed by Darin.
444
445         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10075
446           REGRESSION: Reversed pop-up text in visually-ordered Hebrew pages
447
448         Test: fast/forms/select-visual-hebrew.html
449
450         * css/html4.css: Set "-webkit-rtl-ordering: logical" on select elements.
451
452 2006-07-24  Alexey Proskuryakov  <ap@nypop.com>
453
454         Reviewed by Darin.
455
456         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10009
457         REGRESSION: Schubert-IT PDF Plug-in not working for full page (works in frames)
458
459         * page/Frame.cpp:
460         (WebCore::Frame::begin): Give PDF plugins a chance to handle frame content, before ImageDocument
461         claims it.
462
463 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
464
465         Reviewed by Darin.
466
467         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10083
468           REGRESSION (r15584): editing/selection/select-from-textfield-outwards failing
469
470         * rendering/RenderBlock.cpp:
471         (WebCore::RenderBlock::positionForCoordinates): Added back change from the fix
472         for bug 9312: For coordinates outside a replaced object, return the position
473         just before (after) the element if the coordinates are above or to the left (below
474         or to the right).
475
476 2006-07-23  Mark Rowe  <opendarwin.org@bdash.net.nz>
477
478         Reviewed by maciej.
479
480         Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
481         http://bugzilla.opendarwin.org/show_bug.cgi?id=9686
482
483         WebCore portion of the fix.
484
485         * bridge/mac/WebCoreScriptDebugger.h:
486         (-[WebScriptDebugger exceptionRaised:sourceId:line::]): Add delegate method.
487         * bridge/mac/WebCoreScriptDebugger.mm:
488         (WebCoreScriptDebuggerImp::exception): Call delegate method when an exception is raised.
489
490 2006-07-23  Alice Liu  <alice.liu@apple.com>
491
492         Reviewed by Adele.
493         Actually Adele figured out how to fix the layout test failures.  Landing this patch for her.  Layout test failures exposed but not caused by  r15584 (my patch earlier today).
494
495         * editing/visible_units.cpp:
496         (WebCore::previousLinePosition):
497         When setting selection endpoints, don't traverse down into nodes where editing would ignore its contents. Use the parent node instead.  
498         (WebCore::nextLinePosition):
499         same as above
500
501 2006-07-23  David Harrison  <harrison@apple.com>
502
503         Reviewed by timo.
504
505         <rdar://problem/4646759> Mail crash editing To Do - WebCore::InsertTextCommand::prepareForTextInsertion
506         
507         * Test: editing/deleting/delete-mixed-editable-content-001.html
508
509         * editing/visible_units.cpp:
510         (WebCore::startOfParagraph):
511         Respect editable boundary the same way endOfParagraph does.
512
513 2006-07-23  Beth Dakin  <bdakin@apple.com>
514
515         Reviewed by Maciej. (Patch by me, Maciej, and Harrison.)
516
517         Fix for <rdar://problem/4529398> WebCore crashes when pasting rich 
518         text - WebCore::InlineBox::root()
519
520         The initial rendering crash was due to a render object having a 
521         stale reference to an inline box that had already been deleted and 
522         then recreated in the exact same location in memory. (Crazy, I 
523         know.) The situation seemed pretty specific to list markers 
524         according to Hyatt according to Maciej, so that is what I patched 
525         specifically. Fixing this crash unearthed a separate editing crash 
526         where we were trying to insert a block into itself. I worked on 
527         that with Maciej and Harrison, and Harrison came up with a fix.
528
529         * editing/CompositeEditCommand.cpp:
530         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): This is the fix for the editing crash. If paragraphStart is an atomic 
531         node, insert the new block into the parent instead.
532         * rendering/InlineBox.cpp:
533         (WebCore::InlineBox::isChildOfParent): This function is for 
534         posterity. It will help keep the linebox tree in check.
535         * rendering/InlineBox.h:
536         * rendering/InlineFlowBox.cpp:
537         (WebCore::InlineFlowBox::addToLine): Added assert.
538         (WebCore::InlineFlowBox::deleteLine): Added assert.
539         * rendering/ListMarkerBox.cpp:
540         (WebCore::ListMarkerBox::destroy): If this has a parent, call 
541         removeChild on this.
542         (WebCore::ListMarkerBox::operator delete):
543         * rendering/ListMarkerBox.h:
544
545 2006-07-23  Alice Liu  <alice.liu@apple.com>
546
547         Reviewed by Darin.
548
549         fixed <rdar://problem/4617841> REGRESSION (NativeTextField): You can move keyboard focus to a field without getting insertion point
550
551         * rendering/RenderBlock.cpp:
552         (WebCore::RenderBlock::positionForCoordinates):
553         removed some unnecessary vertical position checks and added a fudge factor to be more forgiving for clicks near lines.
554         * rendering/RenderTextControl.cpp:
555         (WebCore::RenderTextControl::nodeAtPoint):
556         added implementation
557         * rendering/RenderTextControl.h:
558         added function protocol
559
560 2006-07-23  Adele Peterson  <adele@apple.com>
561
562         Reviewed by Darin.
563
564         Updating fix from last checkin.
565
566         * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutVerticalBox):
567         Only tell the view about this flexbox if there isn't another flexbox already cached.
568
569 2006-07-23  Adele Peterson  <adele@apple.com>
570
571         Reviewed by Maciej.
572
573         - Fix for <rdar://problem/4644614> REGRESSION: Typing, pasting or dragging in new text areas causes unnecessary scrolling
574
575         * rendering/RenderBlock.cpp: (WebCore::RenderBlock::layoutBlock): Don't updateScrollInfoAfterLayout if an ancestor flexible box is just on
576         its first layout.
577         * rendering/RenderFlexibleBox.cpp:
578         (WebCore::RenderFlexibleBox::layoutBlock): ditto.
579         (WebCore::RenderFlexibleBox::layoutVerticalBox): Let the view know if this flex box is doing its first pass at layout.
580
581         * rendering/RenderView.cpp: (WebCore::RenderView::RenderView): Caches a flexible box that's doing its first layout.
582         * rendering/RenderView.h:
583         (WebCore::RenderView::setFlexBoxInFirstLayout):
584         (WebCore::RenderView::flexBoxInFirstLayout):
585
586 2006-07-22  Alexey Proskuryakov  <ap@nypop.com>
587
588         Reviewed by Darin.
589
590         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10038
591         REGRESSION: Length of navigator.mimeTypes collection returns number of installed plugins, not number 
592         of registered mime types
593
594         * bindings/js/kjs_navigator.cpp:
595         (KJS::MimeTypes::getValueProperty): Return the length of the mime types vector, not the plugins one.
596         (KJS::MimeTypes::getOwnPropertySlot): Fixed another typo, which prevented MimeTypes::getValueProperty()
597         from even being called.
598
599 2006-07-21  Maciej Stachowiak  <mjs@apple.com>
600
601         Reviewed by Adele and Tim Omernick.
602
603         <rdar://problem/4641004> 9A224: Safari crashes in WebCore::RenderMenuList::showPopup when changing a input select field to input text field
604
605         Couldn't figure out how to make layout test, here's a manual test:
606         * manual-tests/remove-select-onchange.html: Added.
607         
608         * rendering/RenderMenuList.cpp:
609         (WebCore::RenderMenuList::showPopup): Don't add the RenderPopupMenu to the render
610         tree so it doesn't get destroyed if we do.
611         
612         The remaining changes are to let the RenderPopupMenu know its menu list w/o having
613         to be in the render tree:
614         
615         * rendering/RenderPopupMenu.cpp:
616         (WebCore::RenderPopupMenu::RenderPopupMenu):
617         * rendering/RenderPopupMenu.h:
618         (WebCore::RenderPopupMenu::menuList):
619         * rendering/RenderPopupMenuMac.h:
620         * rendering/RenderPopupMenuMac.mm:
621         (WebCore::RenderPopupMenuMac::RenderPopupMenuMac):
622         * rendering/RenderPopupMenuWin.h:
623         (WebCore::RenderPopupMenuWin::RenderPopupMenuWin):
624         * rendering/RenderTheme.h:
625         * rendering/RenderThemeMac.h:
626         * rendering/RenderThemeMac.mm:
627         (WebCore::RenderThemeMac::createPopupMenu):
628         * rendering/RenderThemeWin.cpp:
629         (WebCore::RenderThemeWin::createPopupMenu):
630         * rendering/RenderThemeWin.h:
631
632 2006-07-21  Adele Peterson  <adele@apple.com>
633
634         Reviewed by Darin.
635
636         Fix for: <rdar://problem/4643238> REGRESSION: Can't set insertion point at the end of a line of text
637
638         Test: fast/forms/textarea-scrolled-endline-caret.html
639
640         * rendering/RenderBlock.cpp: (WebCore::RenderBlock::positionForCoordinates):
641         When looking for the closest line box, take the scroll offset into account.
642
643 2006-07-21  Tim Omernick  <timo@apple.com>
644
645         Reviewed by Geoff & Maciej.
646
647         <rdar://problem/4632505> REGRESSION: Crash at WebCore::Widget::getView() const + 6
648
649         Geoff is working on a layout test for this.
650
651         * bridge/mac/FrameMac.mm:
652         (WebCore::FrameMac::focusWindow):
653         (WebCore::FrameMac::unfocusWindow):
654         Check for a NULL view.  The view can be NULL if the frame has not yet loaded any data.  This fixes the crash, but the behavior is still
655         wrong -- we should focus the frame once it gets a view.  I've filed <rdar://problem/4645685> to track that.  It's not as urgent as this
656         crasher.
657         
658 2006-07-21  Maciej Stachowiak  <mjs@apple.com>
659
660         Reviewed by Darin.
661
662         <rdar://problem/4523976> REGRESSION (NativeTextField): Crash occurs when choosing "Undo Typing" after typing and setting the value
663
664         * rendering/RenderTextControl.cpp:
665         (WebCore::RenderTextControl::updateFromElement): Clear the undo
666         chain when the text control contents have been set
667         programmatically.
668         * bridge/mac/FrameMac.mm:
669         (WebCore::FrameMac::clearUndoRedoOperations): Before clearing undo
670         stack, close all open undo groups and then open an equal number,
671         since otherwise NSUndoManager ends up in an inconsistent state
672         leading to uncaught ObjC exceptions.
673
674 2006-07-21  Beth Dakin  <bdakin@apple.com>
675         
676         Reviewed by Darin.
677
678         Just moving this assertion down a couple of lines. It was hitting 
679         every time you try to print a page because we put it too early in 
680         the function.
681
682         * bridge/mac/WebCoreFrameBridge.mm:
683         (-[WebCoreFrameBridge drawRect:]):
684
685 2006-07-21  Justin Garcia  <justin.garcia@apple.com>
686
687         Reviewed by levi
688         
689         <rdar://problem/4548238>
690         REGRESSION: Can't remove the first OL/UL list item in a Mail's compose window
691
692         * editing/CompositeEditCommand.cpp:
693         (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): 
694         Moved from InsertParagraphSeparator.  Does its own typing style restoration.
695         * editing/CompositeEditCommand.h:
696         * editing/InsertParagraphSeparatorCommand.cpp:
697         (WebCore::InsertParagraphSeparatorCommand::doApply): Call breakOutOfEmptyListItem.
698         * editing/TypingCommand.cpp:
699         (WebCore::TypingCommand::deleteKeyPressed): Call breakOutOfEmptyListItem if
700         the endingSelection is at the start of an editable region.
701         * editing/htmlediting.cpp:
702         (WebCore::embeddedSublist): Moved from InsertParagraphSeparator.
703         (WebCore::appendedSublist): Ditto.
704         (WebCore::enclosingEmptyListItem): Ditto.
705         * editing/htmlediting.h:
706
707 === Safari-521.20 ===
708
709 2006-07-21  Tim Omernick  <timo@apple.com>
710
711         Reviewed by Beth Dakin & John Sullivan.
712
713         <rdar://problem/4633717> 9A218: Reproducible crash in -[NSScroller mouseDown:]
714
715         Beth is in the middle of making a layout test for this; she will land it soon.
716
717         * platform/mac/ScrollBarMac.mm:
718         (ScrollBar::~ScrollBar):
719         Call Widget::removeFromSuperview() rather than -removeFromSuperview directly on the scroll bar view.
720         Widget::removeFromSuperview() obeys the "mustStayInWindow" flag, which is set while tracking the mouse
721         in view-based widgets to prevent their destruction while the tracking is in progress.
722         I searched around WebCore and this is the only Widget subclass that directly removes its view rather
723         than using removeFromSuperview().
724
725 2006-07-21  Mitz Pettel  <opendarwin.org@mitzpettel.com>
726
727         Reviewed by Darin.
728
729         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9312
730           REGRESSION: Selection bug in new text fields when selecting past the first letter
731
732         Test: editing/selection/select-from-textfield-outwards.html
733
734         * editing/Selection.cpp:
735         (WebCore::Selection::adjustForEditableContent): Added code to handle the case
736         where the selection starts (resp. ends) in the last (resp. first) visual position
737         inside an editable root.
738         * editing/htmlediting.cpp:
739         (WebCore::comparePositions): Fixed the case of comparing a position inside a shadow
740         tree with a position in the shadow ancestor.
741         * rendering/RenderBlock.cpp:
742         (WebCore::RenderBlock::positionForCoordinates): For coordinates outside a replaced
743         object, return the position just before (after) the element if the coordinates are above or
744         to the left (below or to the right).
745         * rendering/RenderObject.cpp:
746         (WebCore::RenderObject::caretMaxOffset): Changed to return 1 for replaced objects.
747         * rendering/RenderText.cpp:
748         (WebCore::RenderText::positionForCoordinates): Changed to return the last position
749         in the lowest text box if the y coordinate is below all text boxes.
750
751 2006-07-21  Geoffrey Garen  <ggaren@apple.com>
752
753         Reviewed by Darin.
754         
755         - Fixed <rdar://problem/4507265> REGRESSION: overlays don't work on 
756         HousingMaps.com (Google Maps-based site)
757         
758         - Made style.filter undetectable, like document.all.
759         
760         Unfortunately, the SVG spec-makers invented a CSS attribute named 'filter',
761         which conflicts with IE's custom CSS attribute by the same name. Web programs 
762         like the Google maps API test for style.filter, and assume it's the IE 
763         style.filter if they find it, so we need to make style.filter undetectable 
764         to avoid breaking them.
765         
766         An alternative solution would be to hotwire a delorean, go back in time,
767         and beg the web standards makers to make standards that work on the web.
768
769         * bindings/js/kjs_css.cpp:
770         (KJS::DOMCSSStyleDeclaration::cssPropertyGetter):
771
772 2006-07-20  Justin Garcia  <justin.garcia@apple.com>
773
774         Reviewed by john
775         
776         <rdar://problem/4641033>
777         REGRESSION: Pasting from web pages into Mail (or Blot) often loses most of the content
778         
779         * editing/markup.cpp:
780         (WebCore::createMarkup): We surround the currently accumulated markup with markup 
781         for ancestors of the startNode when the pre-order traversal leaves the trees rooted 
782         at those ancestors.  We assumed that any ancestors of the current node not in the 
783         ancestorsToClose list were those kind of ancestors.  But we don't add renderer-less 
784         containers to the ancestorsToClose list.  So, we were incorrectly surrounding the 
785         currently accumulated markup with markup for render-less containers.  Most of the
786         content at apple.com was being put inside an <optgroup> inside a <select> element.  
787         Then on Paste createContextualFragment would drop it.
788
789 2006-07-21  Anders Carlsson  <acarlsson@apple.com>
790
791         Reviewed by Geoff.
792
793         * dom/Document.h:
794         (WebCore::Document::):
795         * dom/EventTargetNode.cpp:
796         (WebCore::EventTargetNode::addEventListener):
797         * page/FrameView.cpp:
798         (WebCore::FrameView::layout):
799         * rendering/RenderLayer.cpp:
800         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
801         Only dispatch overflowchanged events if overflowchanged event listeners have been registered on the document.
802
803 2006-07-20  Anders Carlsson  <acarlsson@apple.com>
804
805         Reviewed by Geoff.
806
807         <rdar://problem/4637807> REGRESSION: "Features & Options" page at volvocars.us fails
808
809         * xml/XSLTProcessor.cpp:
810         (WebCore::xsltParamArrayFromParameterMap):
811         Turns out parameters never worked. String parameters need to be escaped so we create a transform context,
812         add the parameters to it quoted and then use xsltApplyStylesheetUser which lets us pass the transform context to it.
813         This also works around a bug in libxslt where a hash table isn't allocated.
814
815 2006-07-20  Alice Liu  <alice.liu@apple.com>
816
817         Reviewed by Tim Omernick.
818
819         Fixed <rdar://problem/4621649> repro crash: Upload link causes crash on pages.google.com in Frame::nodeForWidget
820         added manual test because there is no way to change the value of an <input type=file> via the DOM.  It's not supported because it's a security risk. 
821
822         * manual-tests/remove-input-file-onchange.html: Added.
823         * platform/mac/FileButtonMac.mm:
824         (-[WebFileChooserButton chooseFilename:]):
825         swapped the calls to changeFilename and bridgeForWidget because changeFilename will destroy the widget that is accessed in bridgeForWidget 
826
827 2006-07-20  Alice Liu  <alice.liu@apple.com>
828
829         Reviewed by Adele.
830
831         Fixed <rdar://problem/4532113> REGRESSION (NativeTextField): Crash occurs after modifying field then reloading page -[FormDelegate frameLayoutHasChanged:]
832         added a manual test because of the need to use AutoFill.
833
834         * dom/Node.h:
835         (WebCore::Node::aboutToUnload):
836         added virtual function prototype
837         * html/HTMLInputElement.cpp:
838         (WebCore::HTMLInputElement::aboutToUnload):
839         added implementation that sends textFieldDidEndEditing notification
840         * html/HTMLInputElement.h:
841         added virtual function prototype
842         * manual-tests/input-type-file-autocomplete-frame-1.html: Added.
843         * manual-tests/input-type-file-autocomplete-frame-2.html: Added.
844         * manual-tests/input-type-file-autocomplete-refresh.html: Added.
845         * page/Frame.cpp:
846         (WebCore::Frame::stopLoading):
847         before unloading, call aboutToUnload on the current focused node
848
849 2006-07-20  Brady Eidson  <beidson@apple.com>
850
851         Reviewed by Maciej
852
853         fixed <rdar://problem/4611303> REGRESSION: repro crash in WebCore::EventTargetNode::dispatchWindowEvent at aeropostale.com
854         There was an attempt to deref an EventListener that got cleaned up in GC.  Changing Document's EventListener list from 
855         vanilla ptrs to refptrs to prevent GC, following EventTargetNode's proven example.
856
857         * dom/Document.cpp:
858         (WebCore::Document::Document):
859         (WebCore::Document::clear):
860         (WebCore::Document::handleWindowEvent):
861         (WebCore::Document::getHTMLWindowEventListener):
862         (WebCore::Document::removeHTMLWindowEventListener):
863         (WebCore::Document::removeWindowEventListener):
864         (WebCore::Document::hasWindowEventListener):
865         Changed all of the list iterators to work with RefPtrs instead of vanilla ptrs
866
867         * dom/Document.h:
868         Changed the EventListener list to be a vanilla pointer list to a refptr list
869
870 2006-07-20  John Sullivan  <sullivan@apple.com>
871
872         Reviewed by Maciej
873
874         - WebCore part of fix for:
875         <rdar://problem/4557386> REGRESSION (419.3-521.19): repro Safari world leak involving 
876         closing tabs after clicking in a web page
877         
878         * bridge/mac/WebCoreFrameBridge.h:
879         (-[WebCoreFrameBridge textViewWasFirstResponderAtMouseDownTime:])
880         renamed to be more specific (formerly wasFirstResponderAtMouseDownTime:)
881         * bridge/mac/FrameMac.mm:
882         (WebCore::FrameMac::passMouseDownEventToWidget):
883         updated for name change
884
885 2006-07-19  Alexey Proskuryakov  <ap@nypop.com>
886
887         Reviewed by Darin.
888
889         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8272
890         Use of window.open & window.close can cause crash
891
892         * platform/PlatformMouseEvent.h:
893         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
894         * platform/mac/PlatformMouseEventMac.mm:
895         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
896         The default constructor now creates a "zero" event, and a new one was added to create the "current" one.
897
898         * bridge/mac/FrameMac.mm:
899         (WebCore::FrameMac::handleMouseMoveEvent):
900         * rendering/RenderFormElement.cpp:
901         (WebCore::RenderFormElement::clicked): 
902         Updated for the above changes.
903
904         * platform/gdk/MouseEventGdk.cpp:
905         * platform/gdk/TemporaryLinkStubs.cpp:
906         (PlatformMouseEvent::PlatformMouseEvent):
907         * platform/win/MouseEventWin.cpp:
908         * platform/win/TemporaryLinkStubs.cpp:
909         (PlatformMouseEvent::PlatformMouseEvent):
910         Trying not to break other platforms.
911
912         * manual-tests/invalid-mouse-event.html: Added.
913
914 2006-07-20  Maciej Stachowiak  <mjs@apple.com>
915         
916         Reviewed by Anders.
917
918         - delete line that I only commented in the last patch - meant to do this before landing
919
920         * html/HTMLFrameElement.cpp:
921         (WebCore::HTMLFrameElement::close): 
922
923 2006-07-19  Maciej Stachowiak  <mjs@apple.com>
924
925         Reviewed by Geoff.
926
927         - fixed <rdar://problem/4634484> REGRESSION: Project Change Request form should have vertical scroll bar, but doesn't
928         
929         I couldn't figure out how to make an automated test case for this,
930         or even a manual one. It seems to be timing-related in some way.
931
932         * html/HTMLFrameElement.cpp:
933         (WebCore::HTMLFrameElement::close): detach the child frame from
934         its element, not the frame containing this element.
935
936 2006-07-20  Anders Carlsson  <acarlsson@apple.com>
937
938         Reviewed by Darin.
939
940         * bridge/mac/FrameMac.mm:
941         (WebCore::FrameMac::nextKeyViewInFrame):
942         Hold a ref to the node in case it gets destroyed by an event handler.
943
944 2006-07-19  Mark Rowe  <opendarwin.org@bdash.net.nz>
945
946         Reviewed by Darin.
947
948         http://bugzilla.opendarwin.org/show_bug.cgi?id=10021
949         Bug 10021: REGRESSION: Stack overflow due to infinite recursion in 
950         Image::checkForSolidColor
951
952         * platform/Image.cpp:
953         (WebCore::Image::cacheFrame): Don't call checkForSolidColor unless 
954         the frame was decoded successfully.
955
956 2006-07-19  Adele Peterson  <adele@apple.com>
957
958         Reviewed by Maciej.
959
960         - Fix for: 
961         <rdar://problem/4422657> REGRESSION: member name field or password field should have focus after loading webmail.mac.com (7405)
962         http://bugzilla.opendarwin.org/show_bug.cgi?id=7405
963
964         <rdar://problem/4614181> REGRESSION: Crash in WebCore::RenderTextField::text() when quoting post at the Ars Technica forum (9707)
965         http://bugzilla.opendarwin.org/show_bug.cgi?id=9707
966
967         Needs an http test. (http://bugzilla.opendarwin.org/show_bug.cgi?id=10020)
968
969         These bugs were both cases where focus() was called on an element which didn't have a renderer yet because stylesheets hadn't finished loading yet.
970         Now, we detect this case and let setFocusNode be called.  And when the stylesheet finishes loading, and the element attaches, a timer will fire, 
971         which will cause the correct selection & scrolling behavior to occur. 
972
973         This fix removes selection and scrolling behavior from the focus method.  This code is now in a new method, updateFocusAppearance.
974         updateFocusAppearance can now be called directly from focus(), but it can also be called when a timer fires.  This timer gets set
975         up when an element attaches, and its already been focused by the focus method.  We have to use a timer, because updateFocusAppearance can cause
976         a layout to happen, and we don't want that to happen in the middle of attach().
977
978         * bindings/objc/DOM.mm: (-[DOMElement isFocused]): Added SPI for autofill.
979         * bindings/objc/DOMPrivate.h:
980
981         * dom/Element.cpp:
982         (WebCore::Element::Element): Initializes timer and needFocusAppearanceUpdate bool.
983         (WebCore::Element::attach): Checks needsFocusAppearanceUpdate, and if the node is focused, then starts the timer.
984         (WebCore::Element::focus): Updated to check supportsFocus before calling setFocusNode, 
985         and only requiring the element to be focusable now before updating focus appearance.
986         (WebCore::Element::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
987         (WebCore::Element::updateFocusAppearanceTimerFired): Stops the timer, and if the element is focusable, calls updateFocusAppearance.
988         (WebCore::Element::stopUpdateFocusAppearanceTimer):  Cancels timer, and setsNeedsFocusAppearanceUpdate(false).
989         (WebCore::Element::detach): Calls stopUpdateFocusAppearanceTimer.
990         (WebCore::Element::blur): ditto.
991         * dom/Element.h:
992         (WebCore::Element::needsFocusAppearanceUpdate): Added so the timer only fires when focus() methods have caused an element to be focused.
993         (WebCore::Element::setNeedsFocusAppearanceUpdate): Added so focus methods can set this flag.
994
995         * dom/Node.h: (WebCore::Node::supportsFocus): Added.  Base class just calls isFocusable.
996         * html/HTMLAnchorElement.h: Added supportsFocus.
997         * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::supportsFocus): Added. Checks for the case where stylesheets haven't loaded yet,
998         so we can still focus the node without a renderer, and when it gets a renderer, we'll update the focus appearance.
999         * html/HTMLGenericFormElement.h: (WebCore::HTMLGenericFormElement::supportsFocus): ditto.
1000         * html/HTMLGenericFormElement.cpp: Removed include of Document.h since this is now in the header.
1001
1002         * html/HTMLInputElement.cpp:
1003         (WebCore::HTMLInputElement::focus): Updated to check supportsFocus before calling setFocusNode, 
1004         and only requiring the element to be focusable now before updating focus appearance.
1005         (WebCore::HTMLInputElement::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
1006         * html/HTMLInputElement.h:
1007
1008         * html/HTMLTextAreaElement.cpp:
1009         (WebCore::HTMLTextAreaElement::focus): Updated to check supportsFocus before calling setFocusNode, 
1010         and only requiring the element to be focusable now before updating focus appearance.
1011         (WebCore::HTMLTextAreaElement::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
1012         * html/HTMLTextAreaElement.h:
1013
1014 2006-07-19  Justin Garcia  <justin.garcia@apple.com>
1015
1016         Reviewed by levi
1017         
1018         <rdar://problem/4631972>
1019         REGRESSION: Mail crashes when pasting entire contents of http://www.apple.com/support/ into a new mail message
1020
1021         * dom/Position.cpp:
1022         (WebCore::Position::upstream): Deployed isBlock and enclosingBlock.
1023         (WebCore::Position::downstream): Ditto.
1024         * editing/CompositeEditCommand.cpp:
1025         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Ditto.
1026         * editing/htmlediting.cpp:
1027         (WebCore::canHaveChildrenForEditing): Added !iframe.
1028         (WebCore::isBlock): Added, returns !node->renderer()->isInline()
1029         (WebCore::enclosingBlock): Added.
1030         * editing/htmlediting.h:
1031
1032 2006-07-19  Anders Carlsson  <acarlsson@apple.com>
1033
1034         Reviewed by Adele.
1035
1036         <rdar://problem/4631272> REGRESSION: Crash tabbing out of hostname field at autorestore.apple.com
1037         
1038         * bridge/mac/FrameMac.mm:
1039         (WebCore::FrameMac::nextKeyViewInFrame):
1040         Take into account that focus handlers can cause a node's renderer to be destroyed.
1041         
1042 2006-07-19  David Hyatt  <hyatt@apple.com>
1043
1044         Fix for 4638376.  The 1x1 solid color image optimization was broken when
1045         I re-architected image.  This patch restores the optimization for CG.  Cairo
1046         will still need the optimization.
1047
1048         Reviewed by darin
1049
1050         WARNING: NO TEST CASES ADDED OR CHANGED (need test cases still)
1051
1052         * platform/Image.cpp:
1053         (WebCore::Image::Image):
1054         (WebCore::Image::invalidateData):
1055         (WebCore::Image::cacheFrame):
1056         * platform/Image.h:
1057         (WebCore::Image::setIsPDF):
1058         * platform/cairo/ImageCairo.cpp:
1059         (WebCore::Image::checkForSolidColor):
1060         * platform/mac/ImageMac.mm:
1061         (WebCore::Image::initNativeData):
1062         (WebCore::Image::invalidateNativeData):
1063         (WebCore::Image::checkForSolidColor):
1064         (WebCore::Image::draw):
1065         (WebCore::Image::drawTiled):
1066
1067 2006-07-19  Justin Garcia  <justin.garcia@apple.com>
1068
1069         Reviewed by levi
1070         
1071         <rdar://problem/4613519>
1072         REGRESSION: Pasting text in native text area inserts text one character before it should (9527)
1073
1074         * editing/InsertParagraphSeparatorCommand.cpp:
1075         (WebCore::InsertParagraphSeparatorCommand::doApply): Turn into an InsertLineBreakCommand instead of bailing
1076         if the enclosingBlockFlowElement doesn't have a parent.
1077
1078 2006-07-19  David Harrison  <harrison@apple.com>
1079
1080         Reviewed by Tim Hatcher.
1081
1082         <rdar://problem/4629307> -[DOMRange markupString] does not include the initial table element if it is at the beginning of the range
1083         <rdar://problem/4062218> pasting in contents of web.apple.com strips off the <table> element from the first table
1084         
1085         Better patch than previous checkin.
1086
1087         * test: editing/pasteboard/paste-table-003.html
1088         
1089         * editing/markup.cpp:
1090         (WebCore::createMarkup):
1091         Make sure to include the table when including a tbody.
1092
1093 === Safari-521.19 ===
1094
1095 2006-07-19  David Harrison  <harrison@apple.com>
1096
1097         Reviewed by Tim Hatcher.
1098
1099         <rdar://problem/4629307> -[DOMRange markupString] does not include the initial table element if it is at the beginning of the range
1100
1101         No test case as this can only be reproduced through ObjC APIs.
1102
1103         * editing/markup.cpp:
1104         (WebCore::createMarkup):
1105         Adjust the range for ancestor markup handling when main loop skips first node.
1106
1107 2006-07-18  David Hyatt  <hyatt@apple.com>
1108
1109         Fix for radar 4611287, make resizable text fields opt-in rather than
1110         opt-out.  Open source users will need to write the pref into their defaults
1111         to see the resizers on textareas now.
1112
1113         Reviewed by mjs and adele
1114
1115         * WebCore.xcodeproj/project.pbxproj:
1116         * bridge/mac/WebCoreSettings.mm:
1117         (-[WebCoreSettings setTextAreasAreResizable:]):
1118         * css/cssparser.cpp:
1119         (WebCore::CSSParser::parseValue):
1120         * css/cssstyleselector.cpp:
1121         (WebCore::CSSStyleSelector::applyProperty):
1122         * css/html4.css:
1123
1124 2006-07-18  Anders Carlsson  <acarlsson@apple.com>
1125
1126         Reviewed by Darin.
1127
1128         http://bugzilla.opendarwin.org/show_bug.cgi?id=9959
1129         REGRESSION: iframes stop rendering after 200th one on successive reloads
1130         
1131         * html/HTMLFrameElement.cpp:
1132         (WebCore::HTMLFrameElement::attach):
1133         (WebCore::HTMLFrameElement::close):
1134         * html/HTMLIFrameElement.cpp:
1135         (WebCore::HTMLIFrameElement::insertedIntoDocument):
1136         (WebCore::HTMLIFrameElement::willRemove):
1137         Remove calls to incrementFrameCount and decrementFrameCount.
1138         
1139         * page/Frame.cpp:
1140         (WebCore::Frame::Frame):
1141         Call incrementFrameCount here.
1142         
1143         (WebCore::Frame::~Frame):
1144         Call disconnectOwnerElement.
1145         
1146         (WebCore::Frame::disconnectOwnerElement):
1147         Call decrementFrameCount here.
1148         
1149 2006-07-18  Alexey Proskuryakov  <ap@nypop.com>
1150
1151         Reviewed by Darin.
1152
1153         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9013
1154         Let correct CSS custom cursor declarations parse
1155
1156         * css/cssparser.cpp:
1157         (WebCore::CSSParser::parseValue): Ignore any values following a custom CSS cursor URI, instead of
1158         requiring that it is the only one in the list (which is actually illegal, according to the spec). 
1159         This is only a temporary hack, with a real implementation to follow in bug 6001/6002.
1160
1161         * manual-tests/custom-cursors.html: Added a test for this issue.
1162         * manual-tests/resources/helpCursor.tiff: A cursor image used in the test.
1163
1164 2006-07-18  Timothy Hatcher  <timothy@apple.com>
1165
1166         Reviewed by Anders.
1167         
1168         <rdar://problem/4636216> NetNewsWire fails to launch on 9A224 - missing symbols
1169         
1170         WebCore needs to add -sub_library libobjc to maintain
1171         backwards compatibility with binaries linked with WebKit
1172         before JavaScriptCore moved out of WebKit.
1173
1174         * WebCore.xcodeproj/project.pbxproj:
1175
1176 2006-07-18  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1177
1178         Reviewed by Justin.
1179
1180         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9978
1181           REGRESSION (r12949-r12988): Clicking the first letter on a line places the caret at the end of the previous line
1182
1183         Test: editing/selection/click-start-of-line.html
1184
1185         * rendering/RenderText.cpp:
1186         (WebCore::RenderText::positionForCoordinates): Changed to return downstream
1187         affinity if the x coordinate is to the left of the middle of the first character
1188         in the text box.
1189
1190 2006-07-18  Anders Carlsson  <acarlsson@apple.com>
1191
1192         Reviewed by Darin.
1193
1194         http://bugzilla.opendarwin.org/show_bug.cgi?id=9695
1195         <rdar://problem/4614085> 
1196         TOT REGRESSION: NativeTextArea: Text area does not respond to Cmd-UpArrow/Cmd-DownArrow (9695)
1197         
1198         * editing/SelectionController.cpp:
1199         (WebCore::SelectionController::modifyExtendingRightForward):
1200         (WebCore::SelectionController::modifyMovingRightForward):
1201         (WebCore::SelectionController::modifyExtendingLeftBackward):
1202         (WebCore::SelectionController::modifyMovingLeftBackward):
1203         If the caret is inside an editable region, the beginning/end of the document should actually be the
1204         beginning/end of the editable region.
1205
1206 2006-07-17  Tim Omernick  <timo@apple.com>
1207
1208         Reviewed by Maciej.
1209
1210         <rdar://problem/4612079> need a way to prevent pages from scrolling to reveal elements that are focused
1211         by script
1212
1213         * bridge/mac/WebCoreFrameBridge.h:
1214         * bridge/mac/WebCoreFrameBridge.mm:
1215         (-[WebCoreFrameBridge setProhibitsScrolling:]):
1216         * page/Frame.cpp:
1217         (WebCore::Frame::prohibitsScrolling):
1218         (WebCore::Frame::setProhibitsScrolling):
1219         * page/Frame.h:
1220         * page/FramePrivate.h:
1221         (WebCore::FramePrivate::FramePrivate):
1222         * page/FrameView.cpp:
1223         (WebCore::FrameView::scrollPointRecursively):
1224         (WebCore::FrameView::setContentsPos):
1225         * page/FrameView.h:
1226         * platform/ScrollView.h:
1227
1228 2006-07-17  Maciej Stachowiak  <mjs@apple.com>
1229
1230         Reviewed by Dave Harrison.
1231         
1232         - fixed <rdar://problem/4618089> Blot crashes when I paste in all the contents of http://www.apple.com/startpage/
1233
1234         * editing/htmlediting.cpp:
1235         (WebCore::editingIgnoresContent):
1236
1237 2006-07-17  Justin Garcia  <justin.garcia@apple.com>
1238
1239         Reviewed by levi
1240         
1241         <rdar://problem/4621728>
1242         REGRESSION: Selecting by dragging down creates selection in wrong direction, with certain steps
1243         <rdar://problem/4604932>
1244         REGRESSION: Dragging too far left on a line will select all lines above it.
1245  
1246         No layout test because of 9980.
1247
1248         * rendering/RenderBlock.cpp:
1249         (WebCore::RenderBlock::positionForCoordinates): Don't return positions inside editable roots
1250         for coordinates outside those roots, except for coordinates outside a document that is entirely 
1251         editable.
1252
1253 2006-07-17  Timothy Hatcher  <timothy@apple.com>
1254
1255         Reviewed by Darin.
1256
1257         <rdar://problem/4635281> JSCanvasRenderingContext2D::drawImage needs to initialize the exception code to zero
1258
1259         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
1260         (WebCore::JSCanvasRenderingContext2D::drawImage): initialize ec to zero
1261         * html/CanvasRenderingContext2D.cpp:
1262         (WebCore::CanvasRenderingContext2D::drawImage): initialize ec before earlier return
1263
1264 2006-07-17  Timothy Hatcher  <timothy@apple.com>
1265
1266         Reviewed by Maciej.
1267
1268         <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
1269
1270         Moves WebScriptObject and WebUndefined to WebCore.
1271
1272         * WebCore.exp:
1273         * WebCore.xcodeproj/project.pbxproj:
1274         * bindings/objc/DOM.mm:
1275         * bindings/objc/DOMCore.h:
1276         * bindings/objc/DOMInternal.mm:
1277         * bindings/objc/DOMUtility.mm:
1278         * bindings/objc/WebScriptObject.mm: Added.
1279         (+[WebUndefined allocWithZone:]):
1280         (-[WebUndefined initWithCoder:]):
1281         (-[WebUndefined encodeWithCoder:]):
1282         (-[WebUndefined copyWithZone:]):
1283         * bindings/objc/WebScriptObjectPrivate.h: Added.
1284         * bridge/mac/FrameMac.mm:
1285         * bridge/mac/WebCoreScriptDebugger.mm:
1286
1287 2006-07-17  David Hyatt  <hyatt@apple.com>
1288
1289         Back out the fix for 5564, since it turns out font:x-small; is a pretty
1290         prominent IE-specific CSS hack.  Because Web sites rely on IE's incorrect
1291         font parsing as a means of also correcting IE's incorrect font size rules.
1292
1293         This fixes Yahoo.com.
1294
1295         Reviewed by darin
1296
1297         * css/cssparser.cpp:
1298         (WebCore::CSSParser::parseFont):
1299
1300 2006-07-17  Justin Garcia  <justin.garcia@apple.com>
1301
1302         Reviewed by levi
1303         
1304         <rdar://problem/4618389> REGRESSION: After applying a link to the last word of a sentence, a new selection is created at the start of the sentence
1305         
1306         * dom/Document.cpp:
1307         (WebCore::Document::updateSelection):
1308
1309 2006-07-17  Maciej Stachowiak  <mjs@apple.com>
1310
1311         Reviewed by Beth.
1312         
1313         <rdar://problem/4604946> REGRESSION: 'checkboxRef.checked = true' fires onchange event in Leopard
1314
1315         * html/HTMLInputElement.cpp:
1316         (WebCore::HTMLInputElement::setChecked):
1317         (WebCore::HTMLInputElement::preDispatchEventHandler):
1318         * html/HTMLInputElement.h:
1319
1320 2006-07-16  David Kilzer  <ddkilzer@kilzer.net>
1321
1322         Reviewed by Darin.
1323
1324         - fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9954
1325           REGRESSION: document.dir should return empty string in <head>
1326
1327         Test: fast/dom/document-dir-property.html
1328
1329         * bindings/js/kjs_html.cpp:
1330         (KJS::JSHTMLDocument::getValueProperty): Return an empty string instead of an
1331         undefined value for an unset document.dir property.
1332
1333 2006-07-16  David Kilzer  <ddkilzer@kilzer.net>
1334
1335         Reviewed by Darin.
1336
1337         * dom/NodeFilter.idl:
1338         Removed "No newline at end of file" that snuck in as part of the "apply patch" process.
1339         * manual-tests/input-empty-on-focus.html:
1340         Removed "Property changes" that snuck in as part of the "apply patch" process.
1341
1342 2006-07-16  Darin Adler  <darin@apple.com>
1343
1344         Reviewed by John Sullivan.
1345
1346         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9943
1347           <rdar://problem/4590613>
1348           REGRESSION (Tiger-TOT): menus are offset to the right at http://movies.aol.com/movie-photo-bts/superman-returns
1349
1350         The problem turns out to be the fact that body.offsetLeft is returning a non-zero value.
1351         I have no idea why the menus worked in Tiger Safari, because body.offsetLeft behavior has not changed.
1352         Presumably some other bug that we fixed had been compensating.
1353
1354         Test: fast/html/body-offset-properties.html
1355
1356         * rendering/RenderObject.cpp:
1357         (WebCore::RenderObject::offsetLeft): Always return 0 for any object without an offsetParent.
1358         (WebCore::RenderObject::offsetTop): Ditto.
1359         (WebCore::RenderObject::offsetParent): Return 0 for the body (treat as a special case).
1360
1361 2006-07-16  Beth Dakin  <bdakin@apple.com>
1362
1363         Reviewed by Maciej.
1364
1365         Fix for <rdar://problem/4616595> REGRESSION: Problems with world 
1366         clock widget clock hand motion on 9A211 + 4604574
1367
1368         The second hand on the widget was jiggling because the rotation was 
1369         messing up the use of the affine transformation matrix while 
1370         rounding to pixel boundaries in device space. We are mainly 
1371         concerned with rounding to pixel boundaries with the scale in mind, 
1372         so this patch extracts the scale to device space from the matrix, 
1373         and rounds to pixel boundaries using only the scale. This doesn't 
1374         seem like it is a perfect solution, but it definitely solves the 
1375         immediate problem. We will probably need to re-address what should 
1376         happen to avoid pixel cracks with rotations at non-integral scale 
1377         factors. 
1378
1379         * platform/cg/GraphicsContextCG.cpp:
1380         (WebCore::GraphicsContext::roundToDevicePixels):
1381
1382 2006-07-15  Darin Adler  <darin@apple.com>
1383
1384         - fix mistake from fix for 8952 that was breaking layout tests
1385
1386         * editing/SelectionController.cpp: (WebCore::SelectionController::nodeWillBeRemoved):
1387         Justin was right! I changed the behavior of the function by accident. Changed it
1388         back so that it doesn't blow away the selection on the DOM side in the case where
1389         it didn't before.
1390
1391         I will write 100 times on the blackboard: "When Justin says something about editing,
1392         assume he is right."
1393
1394 2006-07-15  Darin Adler  <darin@apple.com>
1395
1396         - try to fix Windows build
1397
1398         * WebCore.vcproj/WebCore/WebCore.vcproj: Added StreamingTextDecoderICU.cpp/h.
1399
1400 2006-07-15  Darin Adler  <darin@apple.com>
1401
1402         Reviewed by John Sullivan.
1403
1404         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8952
1405           <rdar://problem/4575185>
1406           REGRESSION: crash on drag of highlighted Google custom home page modules
1407
1408         Test: fast/dynamic/move-node-with-selection.html
1409
1410         * editing/SelectionController.cpp: (WebCore::SelectionController::nodeWillBeRemoved):
1411         Call updateRendering before calling clearSelection(), since it's important to do any
1412         work beforehand, and there are calls inside clearSelection that will indirectly do an
1413         updateRendering. Also change code to make fewer assumptions about object lifetime.
1414
1415 2006-07-15  Darin Adler  <darin@apple.com>
1416
1417         Reviewed by John Sullivan.
1418
1419         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8587
1420           <rdar://problem/4631844>
1421           REGRESSION: {display:list-item} on items outside an ol or ul element no longer causes incremental numbering
1422
1423         Test: fast/lists/numeric-markers-outside-list.html
1424
1425         * rendering/RenderListItem.cpp: (WebCore::previousListItem):
1426         Look for list items, even when we're outside any list.
1427
1428 2006-07-15  Adele Peterson  <adele@apple.com>
1429
1430         Reviewed by John.
1431
1432         - Fix for <rdar://problem/4593970> REGRESSION (NativeTextField): autofill menu disappears after typing a 2nd character
1433
1434         This was caused by composite editing commands, (like typing or pasting) that include a DeleteCommand, being
1435         interpreted by the form delegate as an actual delete.  This fix doesn't notify the form delegate if the deletion is
1436         part of an editing command to replace the selected text.
1437
1438         * editing/DeleteSelectionCommand.h: Added m_replace to keep track of whether this deletion is 
1439           part of a composite command to replace the text being deleted.
1440         * editing/DeleteSelectionCommand.cpp:
1441         (WebCore::DeleteSelectionCommand::DeleteSelectionCommand): Initialize m_replace.
1442         (WebCore::DeleteSelectionCommand::doApply): Only notify the form delegate of the deletion if the text is not being replaced.
1443         * editing/CompositeEditCommand.h:
1444         * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::deleteSelection): 
1445           Added replace argument to construct DeleteSelectionCommand.
1446           
1447         * editing/InsertTextCommand.cpp: (WebCore::InsertTextCommand::input): Call deleteSelection with replace argument.
1448         * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::doApply): ditto.
1449
1450 2006-07-15  Geoffrey Garen  <ggaren@apple.com>
1451
1452         Reviewed by Maciej, tweaked to match Darin's patch.
1453         
1454         - Fixed <rdar://problem/4631837> REGRESSION: Reproducible crash on 
1455         FCKeditor demo (9911)
1456         
1457         * WebCore.xcodeproj/project.pbxproj:
1458         * bindings/js/kjs_html.cpp:
1459         (KJS::JSHTMLDocument::putValueProperty): Check for a null body element before
1460         forwarding the put request to it. I confirmed that no other parts of the 
1461         file use 'body' or 'bodyElement' without checking for null. 
1462         
1463         Also, use 'body' rather than 'bodyElement' because dir can bet set on 
1464         any element, not just HTMLBodyElement.
1465
1466 2006-07-15  Darin Adler  <darin@apple.com>
1467
1468         Reviewed by Adele.
1469
1470         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8871
1471           <rdar://problem/4575417>
1472           REGRESSION: Pressing Enter/Return in a text input removes the selected text
1473
1474         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9743
1475           <rdar://problem/4614228>
1476           REGRESSION: crash dispatching JavaScript-created keyboard event to input element
1477
1478         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::doTextFieldCommandFromEvent):
1479         Add a null check to fix the crash, and a FIXME explaining why this is not necessarily
1480         enough for the future.
1481
1482         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler):
1483         Consume Enter key keypress events even if the element is not in a form.
1484
1485         * platform/mac/KeyEventMac.mm: (WebCore::keyIdentifierForKeyEvent): Added \n to the
1486         characters that turn into "Enter". Actual keyboard events always are \r or \003 on
1487         the Macintosh, but in layout tests we can use \n, and everything other than the
1488         code path here works, so worth fixing.
1489
1490 2006-07-15  Darin Adler  <darin@apple.com>
1491
1492         Reviewed by John Sullivan.
1493
1494         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9883
1495           <rdar://problem/4631821>
1496           REGRESSION: NativePopups don't work correctly in some forum software
1497
1498         Test: fast/forms/select-selected.html
1499
1500         * rendering/RenderMenuList.h:
1501         * rendering/RenderMenuList.cpp:
1502         (WebCore::RenderMenuList::updateFromElement): Added code to map the selected option
1503         index to a list index before using it to index into the list.
1504         (WebCore::RenderMenuList::showPopup): Added code to map the selection option index
1505         to a list index before passing it to the menu renderer.
1506         (WebCore::RenderMenuList::valueChanged): Added code to map the list index back to a
1507         option index before calling setSelectedIndex (that function takes an option index).
1508
1509 2006-07-15  Darin Adler  <darin@apple.com>
1510
1511         Reviewed by John Sullivan.
1512
1513         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9928
1514           REGRESSION: Text Encoding menu inoperative (after gcc protocol build fix)
1515
1516         * bindings/objc/DOM.mm:
1517         (-[DOMNode addEventListener:::]): Moved into DOMEventTarget category.
1518         (-[DOMNode removeEventListener:::]): Ditto.
1519         (-[DOMNode dispatchEvent:]): Ditto.
1520
1521         * WebCore.xcodeproj/project.pbxproj: Allow Xcode to do its thing.
1522
1523 2006-07-15  Maciej Stachowiak  <mjs@apple.com>
1524
1525         Reviewed by Anders.
1526
1527         <rdar://problem/4632144> REGRESSION: table column tests failing as a result of very recent fix
1528
1529         * rendering/RenderTable.cpp:
1530         (WebCore::RenderTable::addChild): columns and colgroups are valid children of a table too, not
1531         just table sections!
1532
1533 2006-07-15  Anders Carlsson  <acarlsson@apple.com>
1534
1535         Reviewed by Darin.
1536
1537         http://bugzilla.opendarwin.org/show_bug.cgi?id=9866
1538         <rdar://problem/4631561>
1539         REGRESSION: Repro crash from mangleme using iframe, only from server.
1540         
1541         * html/HTMLIFrameElement.cpp:
1542         (WebCore::HTMLIFrameElement::attach):
1543         Add null check for contentFrame() since content frames won't be created for invalid URLs.        
1544
1545 2006-07-14  Alexey Proskuryakov  <ap@nypop.com>
1546
1547         Reviewed by Darin.
1548
1549         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=4195
1550         REGRESSION: KOI8-U encoding no longer supported.
1551
1552         Tests:
1553         * http/tests/misc/BOM-override.pl
1554         * http/tests/misc/BOM-override-script.html
1555         * fast/encoding/charset-koi8-u.html
1556         * fast/encoding/charset-x-nextstep.html
1557
1558         Restored a TEC code path for encodings that are not supported by ICU (but which currently
1559         passes all layout tests even by itself with ICU disabled). A lot of refactoring is 
1560         still needed - most importantly, round-tripping encoding names via CFStringEncoding 
1561         makes little sense now.
1562
1563         * WebCore.exp:
1564         * bridge/mac/WebCoreTextDecoder.h: Removed.
1565         * bridge/mac/WebCoreTextDecoder.mm: Removed.
1566         WebCoreTextDecoder was not used anywhere since WebTextView was moved into WebCore.
1567
1568         * loader/Decoder.cpp:
1569         (Decoder::Decoder):
1570         (Decoder::setEncodingName):
1571         (Decoder::decode):
1572         Use StreamingTextDecoder::create().
1573
1574         * platform/StreamingTextDecoder.cpp:
1575         (WebCore::StreamingTextDecoder::create):
1576         (WebCore::StreamingTextDecoder::~StreamingTextDecoder):
1577         * platform/StreamingTextDecoder.h:
1578         StreamingTextDecoder is just an abstract interface to implementations now.
1579
1580         * platform/StreamingTextDecoderICU.cpp: Added.
1581         (WebCore::StreamingTextDecoderICU::StreamingTextDecoderICU):
1582         (WebCore::StreamingTextDecoderICU::~StreamingTextDecoderICU):
1583         (WebCore::StreamingTextDecoderICU::releaseICUConverter):
1584         (WebCore::StreamingTextDecoderICU::textEncodingSupported):
1585         (WebCore::StreamingTextDecoderICU::convertUTF16):
1586         (WebCore::StreamingTextDecoderICU::convertIfASCII):
1587         (WebCore::StreamingTextDecoderICU::createICUConverter):
1588         (WebCore::StreamingTextDecoderICU::appendOmittingBOM):
1589         (WebCore::StreamingTextDecoderICU::convertUsingICU):
1590         (WebCore::StreamingTextDecoderICU::convert):
1591         (WebCore::StreamingTextDecoderICU::toUnicode):
1592         (WebCore::StreamingTextDecoderICU::fromUnicode):
1593         * platform/StreamingTextDecoderICU.h: Added.
1594         Renamed from StreamingTextDecoder; added a way to tell whether the encoding is actually
1595         supported by the decoder; minor cleanup.
1596
1597         * platform/TextEncoding.cpp:
1598         (WebCore::TextEncoding::effectiveEncoding): Moved from StreamingTextDecoder.
1599         (WebCore::TextEncoding::toUnicode): Use StreamingTextDecoder::create().
1600         (WebCore::TextEncoding::fromUnicode): Moved to StreamingTextDecoderICU.
1601         
1602         * platform/TextEncoding.h: Changed __APPLE__ to PLATFORM(MAC); added effectiveEncoding().
1603
1604         * platform/mac/StreamingTextDecoderMac.cpp: Added.
1605         (WebCore::StreamingTextDecoderMac::StreamingTextDecoderMac):
1606         (WebCore::StreamingTextDecoderMac::~StreamingTextDecoderMac):
1607         (WebCore::StreamingTextDecoderMac::releaseTECConverter):
1608         (WebCore::StreamingTextDecoderMac::textEncodingSupported):
1609         (WebCore::StreamingTextDecoderMac::convertUTF16):
1610         (WebCore::StreamingTextDecoderMac::convertIfASCII):
1611         (WebCore::StreamingTextDecoderMac::createTECConverter):
1612         (WebCore::StreamingTextDecoderMac::appendOmittingBOM):
1613         (WebCore::StreamingTextDecoderMac::convertOneChunkUsingTEC):
1614         (WebCore::StreamingTextDecoderMac::convertUsingTEC):
1615         (WebCore::StreamingTextDecoderMac::convert):
1616         (WebCore::StreamingTextDecoderMac::toUnicode):
1617         (WebCore::StreamingTextDecoderMac::fromUnicode):
1618         * platform/mac/StreamingTextDecoderMac.h: Added.
1619         (WebCore::StreamingTextDecoderMac::convert):
1620         This is a TEC+CFString code path for decoding, basically restored from a year-old revision.
1621
1622         * platform/mac/TextEncodingMac.cpp: Removed. Code moved to StreamingTextDecoderMac.
1623
1624         * WebCore.xcodeproj/project.pbxproj:
1625
1626 === Safari-521.17 ===
1627
1628 2006-07-14  Timothy Hatcher  <timothy@apple.com>
1629
1630         <rdar://problem/4623957> SWB: gcc-5412 (new?) objc warning causes WebCore project failure
1631
1632         Made a DOMNode category in DOMEvents.h that lets DOMNode conform to the
1633         DOMEventTarget protocol that works with GCC 5412.
1634
1635         Removed forward declarations of WebCoreWidgetHolder and imported WebCoreWidgetHolder.h.
1636
1637         Removed all <Cocoa/Cocoa.h> and <Foundation/Foundation.h> imports in other headers,
1638         we import <Cocoa/Cocoa.h> in the prefix header for ObjC.
1639
1640         * WebCore.xcodeproj/project.pbxproj:
1641         * bindings/objc/DOMCore.h:
1642         * bindings/objc/DOMEvents.h:
1643         * bridge/mac/FormDataMac.h:
1644         * bridge/mac/WebCoreAXObject.h:
1645         * bridge/mac/WebCoreCache.h:
1646         * bridge/mac/WebCoreEncodings.h:
1647         * bridge/mac/WebCoreFrameBridge.h:
1648         * bridge/mac/WebCoreFrameNamespaces.h:
1649         * bridge/mac/WebCoreJavaScript.h:
1650         * bridge/mac/WebCorePageBridge.h:
1651         * bridge/mac/WebCorePageState.h:
1652         * bridge/mac/WebCoreResourceLoader.h:
1653         * bridge/mac/WebCoreScriptDebugger.h:
1654         * bridge/mac/WebCoreSettings.h:
1655         * bridge/mac/WebCoreStringTruncator.h:
1656         * bridge/mac/WebCoreStringTruncator.mm:
1657         * bridge/mac/WebCoreTextDecoder.h:
1658         * bridge/mac/WebDashboardRegion.h:
1659         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
1660         * platform/mac/CookieJar.mm:
1661         * platform/mac/DeprecatedStringMac.mm:
1662         * platform/mac/FontDataMac.mm:
1663         * platform/mac/FoundationExtras.h:
1664         * platform/mac/TextBoundaries.mm:
1665         * platform/mac/WebCoreHistory.h:
1666         * platform/mac/WebCoreHistory.m:
1667         * platform/mac/WebCoreKeyGenerator.h:
1668         * platform/mac/WebCoreTextArea.h:
1669         * platform/mac/WebCoreTextField.h:
1670         * platform/mac/WebCoreTextRenderer.h:
1671         * platform/mac/WebCoreView.h:
1672         * platform/mac/WebCoreWidgetHolder.h:
1673
1674 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
1675
1676         Reviewed by Maciej.
1677
1678         - Updated ScriptInterpreter to work with Interpreter ref-counting in 
1679         JavaScriptCore.
1680
1681         (KJS::ScriptInterpreter::~ScriptInterpreter): Now protected to catch
1682         manual delete.
1683
1684 2006-07-14  Anders Carlsson  <acarlsson@apple.com>
1685
1686         Reviewed by Adele and Justin.
1687
1688         http://bugzilla.opendarwin.org/show_bug.cgi?id=9658
1689         <rdar://problem/4613948>
1690         REGRESSION: Check Spelling does not work in textarea elements
1691         
1692         * bridge/mac/FrameMac.mm:
1693         (WebCore::FrameMac::advanceToNextMisspelling):
1694         Don't use setStartBefore or setEndAfter on the search range because for shadow trees, there
1695         is no notion of before and after. Instead, use setStart and setEnd and pass in the start and end
1696         indices respectively.
1697         
1698         * dom/Range.cpp:
1699         (WebCore::Range::checkNodeBA):
1700         Allow range operations on shadow trees.
1701
1702         * manual-tests/form-element-spelling.html: Added.
1703
1704 2006-07-14  Beth Dakin  <bdakin@apple.com>
1705
1706         Reviewed by Hyatt.
1707
1708         Fix for <rdar://problem/4621660> REGRESSION: Safari crashing in 
1709         WebCore::FrameView::updateOverflowStatus
1710
1711         m_viewportRenderer is never initialized for framesets, and it 
1712         shouldn't be. So we just need to nil-check for it in 
1713         updateOverflowStatus() and return early.
1714
1715         * page/FrameView.cpp:
1716         (WebCore::FrameView::updateOverflowStatus): Nil check.
1717
1718 2006-07-14  Adele Peterson  <adele@apple.com>
1719
1720         RS by Darin.
1721
1722         Backing out fix for <rdar://problem/4604703> 
1723         REGRESSION (NativeTextField): Focus is not removed from password field after I ctrl-click into a different field
1724
1725         Darin had a better fix in WebKit for this.
1726
1727         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::sendContextMenuEvent):
1728
1729 2006-07-14  Adele Peterson  <adele@apple.com>
1730
1731         Reviewed by Darin.
1732
1733         - Fix for <rdar://problem/4614054> REGRESSION: Safari submits forms when the Return key is hit to complete inline inputs
1734
1735         * page/Frame.h: (WebCore::Frame::inputManagerHasMarkedText): Added.
1736         * bridge/mac/FrameMac.h: ditto.
1737         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::inputManagerHasMarkedText): Added. Asks the input manager if there's marked text.
1738         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler): For text fields, don't submit the form on Enter
1739         if the input manager says there's marked text.  I added this code for all text field paths.  For widgets, WebCoreTextField.mm
1740         has code to deal with this case.  But as we convert search, password, and isindex, they will need to do this check too.
1741
1742 2006-07-14  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1743
1744         Reviewed by Darin.
1745
1746         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9907
1747           REGRESSION (r15418): editing/pasteboard/paste-table-001 fails in pixel  mode
1748
1749         * rendering/RenderText.cpp:
1750         (WebCore::RenderText::caretRect): Fixed the calculation of the max/min allowed caret
1751         position.
1752
1753 2006-07-14  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1754
1755         Reviewed by Darin.
1756
1757         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9905
1758           REGRESSION (r15404-r15415): Repro crash when pressing delete in an empty editable div
1759
1760         Test: editing/deleting/delete-at-start-or-end.html
1761
1762         * editing/TypingCommand.cpp:
1763         (WebCore::TypingCommand::deleteKeyPressed): Added null check.
1764         (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
1765
1766 2006-07-14  David Kilzer  <ddkilzer@kilzer.net>
1767
1768         Reviewed by Geoffrey.
1769
1770         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9903
1771           Simplify logic in JSHTMLOptionsCollection::setLength() by using no-arg getNumber()
1772
1773         No test cases since there is no change in functionality.
1774
1775         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
1776         (WebCore::JSHTMLOptionsCollection::setLength):  Simplified logic by using the
1777         no-argument getNumber() method.
1778
1779 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
1780
1781         Reviewed by Adele.
1782
1783         - Build fix: don't need BLOCK_OBJC_EXCEPTIONS because we already have
1784         one surrounding this function, and the nested one makes the compiler
1785         think our local variable is volatile (seems like a compiler bug to me).
1786         
1787         * bridge/mac/FrameMac.mm:
1788         (WebCore::FrameMac::sendContextMenuEvent):
1789
1790 2006-07-14  Timothy Hatcher  <timothy@apple.com>
1791
1792         Reviewed by Maciej.
1793
1794         Make JavaScriptCore a public framework. Adjusted the paths.
1795
1796         * WebCore.xcodeproj/project.pbxproj:
1797
1798 2006-07-14  Maciej Stachowiak  <mjs@apple.com>
1799
1800         Reviewed by Hyatt.
1801
1802         - fixed <rdar://problem/4567031> REGRESSION: Crash at WebCore::RenderBlock::createLineBoxes (seems to be a security hole?)
1803         
1804         I also fixed all the similar crash / assertion failure cases I could think of.
1805
1806         * dom/Node.cpp:
1807         (WebCore::Node::nextRendererWithSameParent): Helper function for some of the above.
1808         * dom/Node.h:
1809         * rendering/RenderTable.cpp:
1810         (WebCore::RenderTable::addChild): Don't allow inserting forms when not in
1811         an HTML document, since we don't need that quirk and because parsing won't
1812         do certain render tree fixups. Also watch out for case when inserting before
1813         the renderer of a misnested child.
1814         * rendering/RenderTableRow.cpp:
1815         (WebCore::RenderTableRow::addChild): ditto
1816         * rendering/RenderTableSection.cpp:
1817         (WebCore::RenderTableSection::addChild): ditto
1818
1819 2006-07-13  Adele Peterson  <adele@apple.com>
1820
1821         Reviewed by Maciej.
1822
1823         - Fix for <rdar://problem/4604703> 
1824         REGRESSION (NativeTextField): Focus is not removed from password field after I ctrl-click into a different field
1825
1826         Test:
1827         * manual-tests/password-ctrl-click-lose-focus.html: Added.
1828
1829         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::sendContextMenuEvent):
1830         If we're about to set a selection in the current view, make sure its the first responder.
1831         In this case, this will cause the password field to resign first responder at the right time.
1832
1833 2006-07-13  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1834
1835         Reviewed by Hyatt.
1836
1837         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9670
1838           REGRESSION: RTL white-space:pre-wrap text is offset to the right
1839
1840         Test: fast/text/international/rtl-white-space-pre-wrap.html
1841
1842         * rendering/RenderText.cpp:
1843         (WebCore::RenderText::caretRect): Fixed LTR case and added the RTL case
1844         of clipping the caret position to the text box when the caret is after
1845         the trailing space of an autowrapped line.
1846         * rendering/bidi.cpp:
1847         (WebCore::RenderBlock::computeHorizontalPositionsForLine): Changed to truncate-
1848         to-fit the logically last text box if it contains the trailing spaces of an
1849         autowrapped line. 
1850         (WebCore::RenderBlock::bidiReorderLine): Remember the logically last text run.
1851         In the case of autowrapped text with white space that overflows beyond the line,
1852         the last text run is the one containing the overflowing white space.
1853         (WebCore::RenderBlock::findNextLineBreak): Split overflowing white space on a
1854         line that autowraps only after white space into a separate text run.
1855
1856 2006-07-13  David Harrison  <harrison@apple.com>
1857
1858         Reviewed by Dave Hyatt.
1859
1860         <rdar://problem/4624203> -webkit-highlight should be behind images
1861
1862         * rendering/RenderImage.cpp:
1863         (WebCore::RenderImage::paint):
1864         * rendering/RenderListMarker.cpp:
1865         (WebCore::RenderListMarker::paint):
1866         * rendering/RenderWidget.cpp:
1867         (WebCore::RenderWidget::paint):
1868         Call custom highlighter before painting the image, marker, or widget.
1869
1870 2006-07-13  David Harrison  <harrison@apple.com>
1871
1872         Reviewed by Justin and Levi.
1873
1874         <rdar://problem/4620743> REGRESSION: Option-Delete doesn't delete words during typing
1875
1876         * Tests:
1877         editing/deleting/delete-by-word-001.html
1878         editing/deleting/delete-by-word-002.html
1879
1880         * editing/TypingCommand.cpp:
1881         (WebCore::TypingCommand::deleteKeyPressed):
1882         (WebCore::TypingCommand::forwardDeleteKeyPressed):
1883         (WebCore::TypingCommand::doApply):
1884         * editing/TypingCommand.h:
1885         Delete and forward delete to use specified granularity.
1886         Undo of delete and forward delete to select what had been deleted (non-char granularity only).
1887         
1888         * page/Frame.cpp:
1889         (WebCore::Frame::setSelection):
1890         Close typing and end style even if selection is not changing.
1891         * page/Frame.h:
1892         Remove unused setSelection parameter keepTypingStyle.
1893
1894 2006-07-12  Levi Weintraub  <lweintraub@apple.com>
1895
1896         Reviewed by justin
1897
1898         <rdar://problem/4622763> Deleting from beginning of paragraph following a table deletes rather than selects the table
1899
1900         * editing/DeleteSelectionCommand.cpp:
1901         (WebCore::DeleteSelectionCommand::initializeStartEnd): Added selection expansion for HRs.
1902         (WebCore::DeleteSelectionCommand::initializePositionData): Now uses enclosingBlockFlowOrTableElement
1903         instead of enclosingBlockFlowElement.
1904         (WebCore::DeleteSelectionCommand::removeNode): Use to identify that we need a placeholder
1905         when the start or end block is removed.
1906         (WebCore::DeleteSelectionCommand::handleGeneralDelete): Added check for canHaveChildrenForEditing
1907         to keep things like HRs from being given children.
1908         (WebCore::DeleteSelectionCommand::doApply): Switched to use member variable for needPlaceholder.
1909         * editing/DeleteSelectionCommand.h: Made needPlaceholder a member variable.
1910         * editing/TypingCommand.cpp:
1911         (WebCore::TypingCommand::deleteKeyPressed): Fixed selection bug for tables and open typing commands.
1912         (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
1913         * editing/htmlediting.cpp:
1914         (WebCore::editingIgnoresContent): Added check for HRs, since it's not considered a widget.
1915         * editing/visible_units.cpp:
1916         (WebCore::startOfParagraph): Fix for HRs and tables.
1917         (WebCore::endOfParagraph): Ditto.
1918
1919 2006-07-13  Alexey Proskuryakov  <ap@nypop.com>
1920
1921         Reviewed by Darin.
1922
1923         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9880
1924           Memory leaks running DOM-Hanoi
1925
1926         No change in behavior, thus no test included.
1927
1928         * bridge/mac/FrameMac.mm:
1929         (WebCore::FrameMac::setStatusBarText): Use a local autorelease pool to release the temporaries - 
1930         the test runs non-stop, and the enclosing pool doesn't get a chance to be drained.
1931
1932 2006-07-12  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1933
1934         Reviewed by Adele.
1935
1936         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9862
1937           REGRESSION: GMail: Crash in RenderView::repaintViewRectangle when spoofing as FF
1938         - see also <rdar://problem/4622407>
1939
1940         Test: fast/frames/repaint-display-none-crash.html
1941
1942         * rendering/RenderView.cpp:
1943         (WebCore::RenderView::repaintViewRectangle): Added null checking of the owner element's
1944         renderer, which can be null if the iframe is set to display:none.
1945
1946 2006-07-12  Justin Garcia  <justin.garcia@apple.com>
1947
1948         Reviewed by levi
1949         
1950         <rdar://problem/4509393>
1951         selected DOM range starts with <object>, 0 offset but selection should include the <object>
1952
1953         * editing/ReplaceSelectionCommand.cpp:
1954         (WebCore::ReplaceSelectionCommand::shouldMergeStart): 
1955         Don't pull content out of a table cell.
1956         * editing/htmlediting.cpp:
1957         (WebCore::editingIgnoresContent): Added <select> nodes.
1958         (WebCore::rangeCompliantEquivalent): Convert [node, 0] positions to positionBeforeNode(node)
1959         for more types of nodes.
1960         * rendering/RenderContainer.cpp:
1961         (WebCore::RenderContainer::positionForCoordinates): 
1962         Fix a crasher when right clicking on an anonymous table.
1963
1964 2006-07-12  John Sullivan  <sullivan@apple.com>
1965
1966         Reviewed by Brady Eidson
1967         
1968         - fixed <rdar://problem/4611164> REGRESSION: Crash occurs when undoing a series of 
1969         misspelled words (WebCore::RenderObject::repaint(bool)
1970
1971         * dom/Document.cpp:
1972         (WebCore::Document::removeMarkers):
1973         put (it - markers.begin()) in a local variable before altering markers, in every case where this was
1974         happening. One of the cases like this was fixed a while back, but other cases were
1975         either missed at that time or crept in since. 
1976
1977 2006-07-13  Anders Carlsson  <acarlsson@apple.com>
1978
1979         Reviewed by Justin.
1980
1981         http://bugzilla.opendarwin.org/show_bug.cgi?id=9663
1982         REGRESSION (r14948-r14956): Selection in text field remains highlighted when the text field loses focus
1983         
1984         * dom/Document.cpp:
1985         (WebCore::Document::updateSelection):
1986         Don't return early if the selection is empty.
1987
1988 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
1989
1990         Reviewed by Adele.
1991
1992         <rdar://problem/4614656> REGRESSION: onpaste() handlers don't run for textarea elements
1993         
1994         * bridge/mac/FrameMac.mm:
1995         (WebCore::FrameMac::dispatchCPPEvent):
1996         If the element is a shadow node, dispatch the event to its real parent.
1997
1998         * manual-tests/textarea-onpaste.html: Added.
1999
2000 2006-07-12  Beth Dakin  <bdakin@apple.com>
2001
2002         Reviewed by Anders.
2003
2004         Fix for layout test regressions after my check-in last night. Just 
2005         a silly mistake where I should have asked if we were NOT printing 
2006         instead of if we were in the listbox code.
2007
2008         * WebCore.xcodeproj/project.pbxproj: Project file wars. Back to 
2009         XCode 2.3
2010         * platform/mac/ListBoxMac.mm:
2011         (itemTextRenderer): Inverted check.
2012         (groupLabelTextRenderer): Inverted check.
2013
2014 2006-07-12  Darin Adler  <darin@apple.com>
2015
2016         Reviewed by Maciej.
2017
2018         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9806
2019           <rdar://problem/4622622>
2020           REGRESSION: Large rowspan causes WebKit to call abort()
2021
2022         Test: fast/table/large-rowspan-crash.html
2023
2024         * rendering/RenderTableSection.cpp:
2025         (WebCore::RenderTableSection::ensureRows):
2026         Use sizeof(RowStruct) instead of sizeof(int).
2027         Clearly we'll need something better to solve this completely.
2028         I expect another smaller, but still huge, value will still cause a problem.
2029
2030 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
2031
2032         Reviewed by Maciej.
2033
2034         <rdar://problem/4586665> REGRESSION: autorestore.apple.com: Crashes Safari in WebCore::Widget::client() const
2035
2036         * bridge/mac/FrameMac.h:
2037         Add focusCallResultedInViewBeingCreated argument. 
2038         
2039         * bridge/mac/FrameMac.mm:
2040         (WebCore::FrameMac::nextKeyViewInFrame):
2041         If the call to focus() caused the node to get a native widget, set focusCallResultedInViewBeingCreated to true.
2042         
2043         (WebCore::FrameMac::nextKeyViewInFrameHierarchy):
2044         Don't reset the focus node if focusCallResultedInViewBeingCreated is true. Also, add magic to prevent setting
2045         a text field as the first responder if its field editor already is the current first responder.
2046         
2047         * page/FrameView.cpp:
2048         (WebCore::FrameView::handleMousePressEvent):
2049         In some cases, get the event target node again after dispatching the mouse event.
2050
2051 2006-07-12  Beth Dakin  <bdakin@apple.com>
2052
2053         Reviewed by Adele.
2054
2055         Fix for <rdar://problem/4615765> Input[type='search' fields 
2056         initially render too large in Widgets
2057
2058         Fundamentally, the problem here is that we were miscalculating 
2059         things because [NSGraphicsContext currentContextDrawingToScreen] 
2060         was evaluating to false when widgets first load. We only ever used 
2061         this check, however, to determine if we were printing or not, so it 
2062         should not have evaluated to false for loading in Dashbaord. 
2063         Instead, if we query the RenderView about whether or not we are 
2064         printing, we will get the right answer.
2065
2066         No test case added since this appears only to affect Dashboard.
2067
2068         * bridge/mac/WebCoreFrameBridge.mm:
2069         (-[WebCoreFrameBridge drawRect:]): Ask the RenderView if we are 
2070         printing instead. This is not part of the actual bug fix, but it 
2071         seems wise to get rid of all calls to [NSGraphicsContext 
2072         currentContextDrawingToScreen] when we are just trying to determine 
2073         if we are printing or not.
2074         * platform/mac/ListBoxMac.mm:
2075         (itemTextRenderer):This function now takes a boolean, isPrinting.
2076         (groupLabelTextRenderer): Same as above.
2077         (ListBox::sizeForNumberOfLines): Ask the RenderView if we are 
2078         printing.
2079         (-[WebCoreTableView drawRow:clipRect:]): Same as above.
2080         * platform/mac/PopUpButtonMac.mm:
2081         (PopUpButton::sizeHint): Same as above.
2082         * platform/mac/TextFieldMac.mm:
2083         (-[NSSearchFieldCell _addStringToRecentSearches:]):
2084         * rendering/RenderLineEdit.cpp: Same as above.
2085
2086 2006-07-12  Adele Peterson  <adele@apple.com>
2087
2088         Reviewed by Maciej.
2089
2090         Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=9813
2091         OPTION text can paint over select element's scrollbar
2092
2093         Test: fast/forms/option-text-clip.html
2094
2095         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::paintObject):
2096         When calculating the clip to apply to the button text, also consider padding.
2097         In the future, we may have separate renderers for the text part, and the arrow part
2098         of the control, and then the separation should be natural.  For now, we use padding.
2099
2100 2006-07-11  David Kilzer  <ddkilzer@kilzer.net>
2101
2102         Windows build fix.  Reviewed by NOBODY.
2103
2104         * WebCore.vcproj/WebCore/WebCore.vcproj:  Added JSHTMLOptionsCollection.cpp/h
2105         and JSHTMLOptionsCollectionCuston.cpp.  VC++ Express realphabetized the file list.
2106
2107 2006-07-11  Darin Adler  <darin@apple.com>
2108
2109         Reviewed by Adele.
2110
2111         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9809
2112           <rdar://problem/4619515>
2113           focus ring fails to appear on select element after choosing item from popup
2114
2115         - includes http://bugzilla.opendarwin.org/show_bug.cgi?id=9853
2116           improvements to select element, including some storage leak fixes
2117
2118         * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::index): Use a const
2119         reference for the list items, so we don't have to copy a vector.
2120         * html/HTMLSelectElement.cpp:
2121         (WebCore::HTMLSelectElement::selectedIndex): Ditto.
2122         (WebCore::HTMLSelectElement::setSelectedIndex): Ditto.
2123         (WebCore::HTMLSelectElement::length): Ditto.
2124         (WebCore::HTMLSelectElement::remove): Ditto.
2125         (WebCore::HTMLSelectElement::value): Ditto.
2126         (WebCore::HTMLSelectElement::setValue): Ditto.
2127         (WebCore::HTMLSelectElement::stateValue): Ditto.
2128         (WebCore::HTMLSelectElement::restoreState): Ditto.
2129         (WebCore::HTMLSelectElement::appendFormData): Ditto.
2130         (WebCore::HTMLSelectElement::optionToListIndex): Ditto.
2131         (WebCore::HTMLSelectElement::listToOptionIndex): Ditto.
2132         (WebCore::HTMLSelectElement::recalcListItems): Made const, with the appropriate
2133         fields mutable.
2134         (WebCore::HTMLSelectElement::reset): Use a const reference for
2135         the list items, so we don't have to copy the vector. Remove the call to
2136         setSelectionChanged for the RenderMenuList case.
2137         (WebCore::HTMLSelectElement::notifyOptionSelected): Ditto, on both counts.
2138         (WebCore::HTMLSelectElement::defaultEventHandler): Call focus() before showing
2139         the pop-up.
2140         * html/HTMLSelectElement.h: The RenderMenuList class is no longer a friend.
2141         Changed the listItems function to return a const reference to the vector so
2142         it no longer copies the vector. Removed the const_cast to the call to
2143         recalcListItems and changed it to a const member function. Made m_recalcListItems
2144         mutable.
2145         * rendering/DeprecatedRenderSelect.cpp:
2146         (WebCore::DeprecatedRenderSelect::updateFromElement): Removed an unnecessary call
2147         to recalcListItems, which is called automatically. Use a const reference for the
2148         list items so we don't have to copy a vector.
2149         (WebCore::DeprecatedRenderSelect::layout): Ditto.
2150         (WebCore::DeprecatedRenderSelect::selectionChanged): Ditto.
2151         (WebCore::DeprecatedRenderSelect::updateSelection): Ditto.
2152         * rendering/RenderMenuList.cpp:
2153         (WebCore::RenderMenuList::RenderMenuList): Updated for renamed data members.
2154         (WebCore::RenderMenuList::createInnerBlock): Ditto.
2155         (WebCore::RenderMenuList::addChild): Ditto.
2156         (WebCore::RenderMenuList::removeChild): Ditto.
2157         (WebCore::RenderMenuList::setStyle): Ditto. Also removed code to set the style
2158         on the pop-up menu, because it's created with the correct style and destroyed
2159         before it a style change could occur.
2160         (WebCore::RenderMenuList::updateFromElement): Rearranged code to compute the
2161         maximum width in a simpler fashion, and to not bother trying to maintain
2162         the "selected" flags on the elements, since the HTMLSelectElement class
2163         takes care of that. Store the width as an int. Call setText to set the text
2164         based on the selected element's option text.
2165         (WebCore::RenderMenuList::paintObject): Don't check m_inner when setting
2166         up the clip -- always set up the clip.
2167         (WebCore::RenderMenuList::calcMinMaxWidth): Use m_optionsWidth directly
2168         instead of calling ceilf on m_longestWidth.
2169         (WebCore::RenderMenuList::showPopup): Don't use m_popupMenu to store the
2170         menu -- instead keep the pointer in a local variable. Get the selected
2171         index from the HTMLSelectElement.
2172         (WebCore::RenderMenuList::valueChanged): Call HTMLSelectElement::setSelectedIndex
2173         to do most of the work.
2174         * rendering/RenderMenuList.h: Renamed m_inner to m_innerBlock. Removed
2175         m_popupMenu, m_size, m_selectionChanged, and m_selectedIndex. Renamed
2176         m_longestWidth to m_optionsWidth and changed it to be an int. Removed
2177         unneeded override of removeLeftoverAnonymousBoxes function. Removed
2178         unneeded selectionChanged, setSelectionChanged, updateSelection, and
2179         hasPopupMenu functions. Removed extra includes.
2180         * rendering/RenderPopupMenu.cpp: (WebCore::RenderPopupMenu::populate):
2181         Change to iterate the list items instead of iterating all children
2182         of the select node.
2183         * rendering/RenderPopupMenu.h: Renamed getRenderMenuList to menuList.
2184         * rendering/RenderPopupMenuMac.mm:
2185         (WebCore::RenderPopupMenuMac::populate): Moved code to clear and create
2186         the pop-up here from the caller. Removed an extra retain that would cause
2187         the NSPopUpButtonCell to leak.
2188         (WebCore::RenderPopupMenuMac::showPopup): Removed unnecessary code to
2189         create the pop-up, which is now in populate, and also the call to the
2190         clear function, for the same reason. Reorganized code to make it a bit
2191         more readable. Removed an unnecessary if to check if frame is nil.
2192         Used a RefPtr to make sure we don't make a call on a frame after it's
2193         deleted. As part of the reorganization fixed a problem where we'd retain
2194         the event and then return early without releasing it in one case.
2195         (WebCore::RenderPopupMenuMac::addSeparator): Tweaked a little.
2196         (WebCore::RenderPopupMenuMac::addGroupLabel): Grouped all the code to
2197         manage the NSMenu at the bottom of the function.
2198         (WebCore::RenderPopupMenuMac::addOption): Ditto.
2199
2200 2006-07-11  Justin Garcia  <justin.garcia@apple.com>
2201
2202         Reviewed by levi
2203         
2204         <rdar://problem/4620686>
2205         REGRESSION: Mispelling markers are still displayed when using the delete key to place caret into a misspelled word
2206
2207         * bridge/mac/FrameMac.mm:
2208         (WebCore::FrameMac::respondToChangedSelection): Remove markers from newAdjacentWords 
2209         even if oldAdjacentWords is equal to newAdjacentWords.  This happens during a deletion.
2210         
2211
2212 2006-07-11  Tim Omernick  <timo@apple.com>
2213
2214         Reviewed by NOBODY (build fix)
2215
2216         * bindings/objc/DOMPrivate.h:
2217         Don't @class NPObject; that breaks files that actually #import <JavaScriptCore/npruntime.h>, since the NPObject
2218         there is of a different type.
2219         Also clarified a highly misleading comment from my last commit.  I meant to clarify the comment
2220         before landing.
2221
2222 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
2223
2224         Reviewed by Geoff.
2225
2226         http://bugzilla.opendarwin.org/show_bug.cgi?id=9635
2227         REGRESSION: Crash when adding to cart at <http://www.yemeksepeti.com/>
2228         
2229         * html/HTMLTokenizer.cpp:
2230         (WebCore::HTMLTokenizer::scriptHandler):
2231         Don't load external scripts if the parser is stopped.
2232         
2233         * manual-tests/open-close-tokenizer-crash.html: Added.
2234         * manual-tests/resources/empty-file.js: Added.
2235         * manual-tests/resources/open-close-tokenizer-crash.html: Added.
2236         Add manual test.
2237
2238 2006-07-11  John Sullivan  <sullivan@apple.com>
2239
2240         Reviewed by Kevin, Timo O, Brady, Darin, and Hyatt (whee!)
2241
2242         - added support for creating a selection image with white text
2243
2244         * rendering/RenderObject.h:
2245         (WebCore::):
2246         add PaintRestriction enum
2247         (WebCore::RenderObject::PaintInfo::PaintInfo):
2248         add forceWhiteText boolean to PaintInfo struct
2249
2250         * page/FramePrivate.h:
2251         (WebCore::FramePrivate::FramePrivate):
2252         replaced m_selectionOnly bool with m_paintRestriction, which also handles forcing the
2253         text to white
2254
2255         * page/Frame.cpp:
2256         (WebCore::Frame::paint):
2257         updated to use & pass m_paintRestriction where it used to use & pass just m_selectionOnly
2258
2259         * bridge/mac/FrameMac.h:
2260         * bridge/mac/FrameMac.mm:
2261         (WebCore::FrameMac::selectionImage):
2262         now takes forceWhiteText parameter, stored in FramePrivate as part of PaintRestriction
2263
2264         * bridge/mac/WebCoreFrameBridge.h:
2265         * bridge/mac/WebCoreFrameBridge.mm:
2266         (-[WebCoreFrameBridge selectionImageForcingWhiteText:]):
2267         renamed from selectionImage, now takes forceWhiteText parameter, which is passed
2268         down into Frame
2269
2270         * rendering/RenderLayer.h:
2271         * rendering/RenderLayer.cpp:
2272         (WebCore::RenderLayer::paint):
2273         use a PaintRestriction value where we used to use a selectionOnly bool
2274         (WebCore::RenderLayer::paintLayer):
2275         ditto; also stores forceWhiteText in PaintInfo struct
2276
2277         * kcanvas/KCanvasResources.cpp:
2278         (WebCore::KCanvasMarker::draw):
2279         updated for changed signature of PaintInfo constructor
2280
2281         * ksvg2/svg/SVGMaskElement.cpp:
2282         (WebCore::SVGMaskElement::drawMaskerContent):
2283         ditto
2284
2285         * ksvg2/svg/SVGPatternElement.cpp:
2286         (WebCore::SVGPatternElement::drawPatternContentIntoTile):
2287         ditto
2288
2289         * rendering/InlineTextBox.cpp:
2290         (WebCore::InlineTextBox::paint):
2291         paint with white text color if forceWhiteText is set in PaintInfo struct
2292
2293 2006-07-11  Tim Omernick  <timo@apple.com>
2294
2295         Reviewed by Anders.
2296
2297         <http://bugzilla.opendarwin.org/show_bug.cgi?id=9843>:
2298         Give Netscape plug-ins access to their own DOM element
2299
2300         * html/HTMLPlugInElement.h:
2301         Just import JSC headers on Mac.  The NPObject and Bindings::Instance stuff is only used on Mac anyway.
2302         Changed __APPLE__ to PLATFORM(MAC).
2303         Added m_NPObject ivar.
2304         * html/HTMLPlugInElement.cpp:
2305         (WebCore::HTMLPlugInElement::HTMLPlugInElement):
2306         Initialize the NPObject.
2307         (WebCore::HTMLPlugInElement::~HTMLPlugInElement):
2308         Release the NPObject when the element is destroyed.
2309         (WebCore::HTMLPlugInElement::createNPObject):
2310         Creates an NPObject for the element.
2311         (WebCore::HTMLPlugInElement::getNPObject):
2312         Returns the NPObject for the element, creating and caching it if necessary.
2313
2314         * html/HTMLAppletElement.h:
2315         Changed __APPLE__ to PLATFORM(MAC).
2316         * html/HTMLAppletElement.cpp:
2317         ditto
2318         * html/HTMLEmbedElement.h:
2319         ditto
2320         * html/HTMLEmbedElement.cpp:
2321         ditto
2322         * html/HTMLObjectElement.h:
2323         ditto
2324         * html/HTMLObjectElement.cpp:
2325         ditto
2326
2327         * bindings/objc/DOMPrivate.h:
2328         Added -[DOMElement _NPObject].
2329
2330         * bindings/objc/DOM.mm:
2331         (-[DOMElement _NPObject]):
2332         Returns the NPObject for the element.  Since this is only needed by the Netscape plug-in API, you can only get 
2333         the NPObject for applet, embed, and object elements.
2334         
2335 2006-07-11  Adele Peterson  <adele@apple.com>
2336
2337         Reviewed by Hyatt.
2338
2339         - Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9861
2340         REGRESSION: Can't dynamically change list box to popup
2341         
2342         and updated fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9859
2343         REGRESSION: Can't dynamically change popup to list box
2344
2345         The original fix for 9859 was in the renderer, and I think we can catch the change
2346         earlier in the element to detach and reattach.
2347
2348         I also did some cleanup to remove the PopupButton code path from DeprecatedRenderSelect
2349
2350         Test: fast/forms/select-change-listbox-to-popup.html
2351
2352         * html/HTMLSelectElement.cpp:
2353         (WebCore::HTMLSelectElement::parseMappedAttribute): If the new attribute value is going to require us to change from listbox to popup or vice versa,
2354         and we're already attached, then detach and reattach to create the correct renderer.  If we're not attached, then we'll create the correct renderer
2355         when we attach.
2356         (WebCore::HTMLSelectElement::recalcStyle): Updated shouldUseMenuList since it no longer takes a RenderStyle.
2357         (WebCore::HTMLSelectElement::isKeyboardFocusable): ditto.
2358         (WebCore::HTMLSelectElement::isMouseFocusable): ditto.
2359         (WebCore::HTMLSelectElement::createRenderer): ditto.
2360         (WebCore::HTMLSelectElement::setRecalcListItems): ditto.
2361         (WebCore::HTMLSelectElement::reset): ditto.
2362         (WebCore::HTMLSelectElement::notifyOptionSelected): ditto.
2363         (WebCore::HTMLSelectElement::defaultEventHandler): ditto.
2364
2365         * html/HTMLSelectElement.h: (WebCore::HTMLSelectElement::shouldUseMenuList):
2366         This method no longer takes a RenderStyle.  That was leftover from when we used to use the appearance
2367         to determine whether or not to use the new menu list implementation.
2368
2369         * rendering/DeprecatedRenderSelect.h: Removed PopupButton code path.
2370         * rendering/DeprecatedRenderSelect.cpp:
2371         (WebCore::DeprecatedRenderSelect::DeprecatedRenderSelect):
2372         (WebCore::DeprecatedRenderSelect::setWidgetWritingDirection):
2373         (WebCore::DeprecatedRenderSelect::updateFromElement):
2374         (WebCore::DeprecatedRenderSelect::baselinePosition):
2375         (WebCore::DeprecatedRenderSelect::layout):
2376         (WebCore::DeprecatedRenderSelect::updateSelection):
2377
2378         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
2379         Backed out previous fix since this is now done in HTMLSelectElement.
2380
2381 2006-07-11  Adele Peterson  <adele@apple.com>
2382
2383         Reviewed by Hyatt.
2384
2385         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9859
2386         REGRESSION: Can't dynamically change popup to list box
2387
2388         Test: fast/forms/select-change-popup-to-listbox.html
2389
2390         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
2391         If the select element has the multiple property set, or has a size > 1, then it
2392         really should be a list box, so we detach and attach the element so it creates the
2393         correct type of renderer.
2394
2395 2006-07-11  John Sullivan  <sullivan@apple.com>
2396
2397         Reviewed by Beth Dakin and Tim Omernick
2398
2399         - fixed <rdar://problem/4622794> HiDPI: dragging the selection in Safari can show pixel cracks 
2400         at non-integral scale factors
2401
2402         * bridge/mac/FrameMac.mm:
2403         (WebCore::FrameMac::imageFromRect):
2404         round image rect in window coordinate space
2405
2406 2006-07-10  Darin Adler  <darin@apple.com>
2407
2408         Reviewed by Geoff.
2409
2410         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9811
2411           rdar://problem/4619572
2412           OPTION text contained in OPTGROUP appears at the wrong size
2413
2414         * dom/Node.h:
2415         * dom/Node.cpp: (WebCore::Node::renderStyle): Made a const member function.
2416         The derived classes were overriding with const member functions, and I could
2417         change either this or the derived -- decided to do this.
2418
2419 2006-07-10  Darin Adler  <darin@apple.com>
2420
2421         Reviewed by Geoff.
2422
2423         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9810
2424           rdar://problem/4619534
2425           OPTGROUP label text is using the default font instead of Lucida Grande
2426
2427         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::setFontFromControlSize):
2428         Code wants the family name, but was calling fontName, which is not the same thing.
2429         Also removed the unneeded conversion to DeprecatedString.
2430
2431 === Safari-521.16 ===
2432
2433 2006-07-10  David Kilzer  <ddkilzer@kilzer.net>
2434
2435         Reviewed by Darin.
2436
2437         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9179
2438           Implement select.options.add() method
2439
2440         Tests:
2441         - fast/dom/select-selectedIndex-multiple.html
2442         - fast/dom/select-selectedIndex.html
2443         - fast/js/select-options-add.html
2444
2445         * DerivedSources.make: Added JSHTMLOptionsCollection.h.
2446         * ForwardingHeaders/kjs/operations.h: Added.
2447         * WebCore.xcodeproj/project.pbxproj: Added new source files.
2448         * bindings/js/JSHTMLOptionsCollectionCustom.cpp: Added.
2449         (WebCore::JSHTMLOptionsCollection::length):
2450         (WebCore::JSHTMLOptionsCollection::setLength):
2451         (WebCore::JSHTMLOptionsCollection::indexSetter):
2452         * bindings/js/kjs_html.cpp: Removed JSHTMLOptionsCollection implementation.
2453         Renamed classes and methods for consistency.
2454         (KJS::JSHTMLElement::selectGetter):
2455         (KJS::JSHTMLElement::put):
2456         (KJS::JSHTMLElement::selectSetter):
2457         (KJS::JSHTMLCollection::JSHTMLCollection):
2458         (KJS::JSHTMLCollectionProtoFunc::callAsFunction):
2459         (KJS::getHTMLOptionsCollection):
2460         * bindings/js/kjs_html.h: Ditto.
2461         * bindings/scripts/CodeGeneratorJS.pm: Added support for HasCustomIndexSetter class attribute.
2462         Added support for Optional parameter attribute, which makes generated code assume overloaded
2463         implementation methods are available for a JavaScript function with optional arguments.  Changed
2464         local 'impl' variables to 'imp' so that impl() methods could be called without class designation.
2465         * html/HTMLOptionElement.idl: Added GenerateNativeConverter attribute.
2466         * html/HTMLOptionsCollection.cpp: Added methods used by generated JSHTMLOptionsCollection class.
2467         (WebCore::HTMLOptionsCollection::HTMLOptionsCollection):
2468         (WebCore::HTMLOptionsCollection::add):
2469         (WebCore::HTMLOptionsCollection::selectedIndex):
2470         (WebCore::HTMLOptionsCollection::setSelectedIndex):
2471         (WebCore::HTMLOptionsCollection::setLength):
2472         * html/HTMLOptionsCollection.h: Ditto.
2473         * html/HTMLOptionsCollection.idl: Added.
2474
2475 2006-07-10  David Harrison  <harrison@apple.com>
2476
2477         Reviewed by Dave Hyatt.
2478
2479         <rdar://problem/4602408> -webkit-highlight needs to support images and elements other than text
2480
2481         * rendering/RenderBox.cpp:
2482         (WebCore::RenderBox::paintCustomHighlight):
2483         * rendering/RenderBox.h:
2484         Utility for subclasses.
2485         
2486         * rendering/RenderImage.cpp:
2487         (WebCore::RenderImage::paint):
2488         Custom highlight in front of images.
2489         
2490         * rendering/RenderListMarker.cpp:
2491         (WebCore::RenderListMarker::paint):
2492         Custom highlight in front of list markers.
2493
2494         * rendering/RenderWidget.cpp:
2495         (WebCore::RenderWidget::paint):
2496         Custom highlight in front of objects.
2497
2498 2006-07-10  David Hyatt  <hyatt@apple.com>
2499
2500         <rdar://problem/4620557> REGRESSION: In a mail message, text isn't painted
2501         correctly after choosing Redo Typing
2502
2503         Better fix for repainting issue with positioned objects when height
2504         changes.  Optimize when only a positioned child changes so that we don't
2505         incorrectly do normal flow layout.
2506
2507         Reviewed by darin
2508
2509         * WebCore.xcodeproj/project.pbxproj:
2510         * rendering/RenderBlock.cpp:
2511         (WebCore::RenderBlock::layoutBlock):
2512         * rendering/RenderFlexibleBox.cpp:
2513         (WebCore::RenderFlexibleBox::layoutBlock):
2514         * rendering/RenderTable.cpp:
2515         (WebCore::RenderTable::layout):
2516         * rendering/RenderView.cpp:
2517         (WebCore::RenderView::layout):
2518         * rendering/bidi.cpp:
2519         (WebCore::RenderBlock::layoutInlineChildren):
2520
2521 2006-07-10  Adele Peterson  <adele@apple.com>
2522
2523         Reviewed by Beth.
2524
2525         - Fix for <rdar://problem/4621442> REGRESSION (NativePopup) : Popup menus aren't drawn correctly on page at orbitz.com; cheaptickets.com
2526
2527         Test: fast/forms/select-style.html
2528
2529         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::isControlStyled):
2530         Don't let popups be style-able for now.  We'll allow it later, when we
2531         have a good way to handle border & backgrounds and still having it look like a control.
2532
2533 2006-07-10  Justin Garcia  <justin.garcia@apple.com>
2534
2535         Reviewed by harrison
2536         
2537         <rdar://problem/4619260>
2538         9A213 + Safari 521.15.1 Crash with To Do's alarm icon (WebCore::maxDeepOffset(WebCore::Node const*) )
2539         <rdar://problem/4619841>
2540         REGRESSION: Dragging selection over input field results in a crash (WebCore::maxDeepOffset(WebCore::Node const*)
2541
2542         * WebCore.xcodeproj/project.pbxproj:
2543         * editing/Selection.cpp:
2544         (WebCore::Selection::adjustForEditableContent): Iterate using next/previousVisuallyDistinctCandidate 
2545         instead of traverseNext/Previous node because we were skipping positions.  Jump out of shadow trees.  
2546         Migrate to isEditablePosition instead of isContentEditable.
2547         
2548
2549 2006-07-10  Beth Dakin  <bdakin@apple.com>
2550
2551         Reviewed by Adele.
2552
2553         Shuffling comments around from my last check-in to make things read 
2554         more clearly.
2555
2556         * page/DOMWindow.h:
2557         * page/DOMWindow.idl:
2558
2559 2006-07-10  Beth Dakin  <bdakin@apple.com>
2560
2561         Reviewed by Darin.
2562
2563         Fix for <rdar://problem/4621095> The should be a way to 
2564         access the user interface scale factor through the DOM
2565
2566         window.devicePixelRatio returns the user interface scale factor.
2567
2568         * page/DOMWindow.cpp:
2569         (WebCore::DOMWindow::devicePixelRatio):
2570         * page/DOMWindow.h:
2571         * page/DOMWindow.idl:
2572
2573 2006-07-10  Brady Eidson  <beidson@apple.com>
2574
2575         Reviewed by Alexey
2576
2577         Resolved the console error messages people got from the new DB even if they didn't have it enabled
2578
2579         * icon/IconDatabase.cpp:
2580         (WebCore::IconDatabase::pruneUnreferencedIcons):
2581         (WebCore::IconDatabase::pruneUnretainedIcons):
2582         Added quick check to bail if the DB isn't open
2583
2584 2006-07-10  David Harrison  <harrison@apple.com>
2585
2586         Reviewed by Tim Hatcher
2587
2588         Partial fix for...
2589         <rdar://problem/4619260> 9A213 + Safari 521.15.1 Crash with To Do's alarm icon (WebCore::maxDeepOffset(WebCore::Node const*) )
2590         
2591         * editing/Selection.cpp:
2592         (WebCore::Selection::adjustForEditableContent):
2593         Allow for node being 0.  This is a bandaid fix to prevent the crash.  It will still assert in a debug build.  See bug for more info.
2594
2595 2006-07-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2596
2597         Reviewed by Darin.
2598
2599         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9808
2600           REGRESSION: Incorrect layout (and ERROR) when forcing ATSU For All Text
2601
2602         * manual-tests/ATSU-bad-layout.html: Added.
2603         * platform/mac/FontMac.mm:
2604         (WebCore::Font::floatWidthForComplexText): Return 0 immediately for empty runs.
2605
2606 2006-07-10  Darin Adler  <darin@apple.com>
2607
2608         - try to fix the no-SVG build
2609
2610         * ksvg2/misc/SVGImageLoader.cpp: Move namespace brace inside the #if.
2611
2612 2006-07-10  Darin Adler  <darin@apple.com>
2613
2614         Reviewed by Anders.
2615
2616         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9833
2617           REGRESSION: Reproducible crash: RenderMenuList.cpp:58: failed assertion `!m_first'
2618
2619         * manual-tests/empty-title-popup.html: Added.
2620
2621         * rendering/RenderMenuList.h: Add createInnerBlock.
2622         * rendering/RenderMenuList.cpp:
2623         (WebCore::RenderMenuList::createInnerBlock): Factored out of addChild.
2624         (WebCore::RenderMenuList::addChild): Call createInnerBlock.
2625         (WebCore::RenderMenuList::setText): Changed parameter type.
2626         (WebCore::RenderMenuList::showPopup): Call createInnerBlock before calling
2627         the parent class's addChild.
2628
2629 2006-07-10  Rob Buis  <buis@kde.org>
2630
2631         Reviewed by Maciej via IRC.
2632
2633         Make sure the attributes are calculated against viewport width value,
2634         as defined in the spec.  http://paste.lisp.org/display/22342
2635
2636         * ksvg2/svg/SVGEllipseElement.cpp:
2637         (WebCore::SVGEllipseElement::rx): Changed LM_HEIGHT to LM_WIDTH.
2638         * ksvg2/svg/SVGLineElement.cpp:
2639         (SVGLineElement::x2): Ditto.
2640
2641 2006-07-10  Beth Dakin  <bdakin@apple.com>
2642
2643         Reviewed by Maciej.
2644
2645         Fix for <rdar://problem/4610314> Support the CSS3 content property 
2646         for images
2647
2648         This patch provides initial support for the CSS3 content property. 
2649         It lacks support for any content other than images, and only allows 
2650         content for elements that seemed safe for now.
2651
2652         * css/cssstyleselector.cpp:
2653         (WebCore::CSSStyleSelector::applyProperty): Remove restrictions for 
2654         just :before and :after
2655         * html/HTMLBRElement.cpp:
2656         (WebCore::HTMLBRElement::createRenderer):
2657         * html/HTMLFrameSetElement.cpp:
2658         (WebCore::HTMLFrameSetElement::createRenderer):
2659         * html/HTMLImageElement.cpp:
2660         (WebCore::HTMLImageElement::createRenderer):
2661         * html/HTMLLegendElement.cpp:
2662         (WebCore::HTMLLegendElement::createRenderer):
2663         * rendering/RenderImage.cpp:
2664         (WebCore::RenderImage::RenderImage):
2665         (WebCore::RenderImage::setCachedImage): Don't allow the image to be 
2666         set this way if it was already set with the content property.
2667         * rendering/RenderImage.h:
2668         (WebCore::RenderImage::setIsAnonymousImage): Anonymous images are 
2669         those set through the content property.
2670         (WebCore::RenderImage::isAnonymousImage):
2671         * rendering/RenderObject.cpp:
2672         (WebCore::RenderObject::createObject): If there is content 
2673         specified, create a RenderImage with the content and initialize the 
2674         cached image to whatever was specified in the CSS.
2675
2676 2006-07-10  Brady Eidson  <beidson@apple.com>
2677
2678         Reviewed by NOBODY (Build Fix!)
2679
2680         * icon/SiteIcon.cpp:
2681         (SiteIcon::getImage):
2682         Release build made an "unused variable" warning, which is, of course, an error.  fixed that.
2683
2684 2006-07-10  Brady Eidson  <beidson@apple.com>
2685
2686         Reviewed by Maciej
2687
2688         SQLite Icon DB now fully replicates functionality of the old DB, including pruning to keep unused
2689         information out to keep down disk usage.  For now, it is still off by default, as the critical
2690         feature of importing old icons into the new DB is still unrealized.
2691         If you'd like to test, add #define ICONDEBUG to your WebKitPrefix.h
2692
2693         * icon/IconDatabase.cpp:
2694         (WebCore::IconDatabase::IconDatabase):
2695         (WebCore::IconDatabase::open):
2696           -Sets up a timer for initial pruning
2697         (WebCore::IconDatabase::iconForPageURL):
2698           -Switched away from "dirty blob hack" as the problem is provisionally solved
2699         (WebCore::IconDatabase::retainIconForURL):
2700         (WebCore::IconDatabase::releaseIconForURL):
2701           -Same as found in WebKit
2702         (WebCore::IconDatabase::totalRetainCountForIconURL):
2703           -Adds up all retainers of icon
2704         (WebCore::IconDatabase::forgetIconForIconURLFromDatabase):
2705           -Wipes an Icon table entry out
2706         (WebCore::IconDatabase::establishTemporaryIconIDForIconURL):
2707         (WebCore::IconDatabase::establishTemporaryIconIDForEscapedIconURL):
2708         (WebCore::IconDatabase::establishIconIDForIconURL):
2709         (WebCore::IconDatabase::establishIconIDForEscapedIconURL):
2710           -Added ability to get an iconID without creating a new one if a lookup is all
2711            that is genuinely wanted
2712         (WebCore::IconDatabase::pruneUnreferencedIcons):
2713         (WebCore::IconDatabase::pruneUnretainedIcons):
2714           -Called on a timer on DB startup to clean it out
2715         * icon/IconDatabase.h:
2716         * icon/SiteIcon.cpp:
2717         (SiteIcon::SiteIcon):
2718         (SiteIcon::~SiteIcon):
2719           -Deletes the image on deletion
2720         (SiteIcon::getImage):
2721           -Cut down on no-longer-necessary debug info
2722
2723 2006-07-10  Anders Carlsson  <acarlsson@apple.com>
2724
2725         Reviewed by Adele.
2726
2727         http://bugzilla.opendarwin.org/show_bug.cgi?id=9245
2728         Quirksmode: Incorrect handling of disabled BUTTON elements
2729
2730         * html/HTMLButtonElement.cpp:
2731         (WebCore::HTMLButtonElement::defaultEventHandler):
2732         Don't call prepareSubmit if the element is disabled.
2733
2734         * html/HTMLInputElement.cpp:
2735         (WebCore::HTMLInputElement::defaultEventHandler):
2736         Don't call prepareSubmit if the element is disabled.
2737
2738 2006-07-10  Darin Adler  <darin@apple.com>
2739
2740         - try to fix Windows build
2741
2742         * platform/win/TemporaryLinkStubs.cpp: Put a few functions in the WebCore namespace.
2743         * platform/gdk/TemporaryLinkStubs.cpp: Ditto.
2744
2745 2006-07-10  Darin Adler  <darin@apple.com>
2746
2747         Reviewed by Geoff.
2748
2749         - fix failures seen in layout tests
2750
2751         * bindings/js/kjs_dom.cpp: (KJS::toJS): Restore one of the few WebCore:: prefixes
2752         that really needed to be there -- because we have two classes named JSHTMLDocument
2753         at the moment! (One in KJS and one in WebCore namespace.)
2754
2755 2006-07-10  Darin Adler  <darin@apple.com>
2756
2757         - try to fix Windows build
2758
2759         * rendering/RenderLayer.h: Correct a forward declaration of ScrollBar.
2760
2761 2006-07-09  Adele Peterson  <adele@apple.com>
2762
2763         Reviewed by Maciej.
2764
2765         Fix for <rdar://problem/4463835> Switch to use new popup menu implementation for <select>
2766
2767         * css/html4.css: Added style for new selects, and for list boxes.
2768         * html/HTMLSelectElement.h: (WebCore::HTMLSelectElement::shouldUseMenuList): Removed check for appearance so new popups can be styled.
2769    
2770         * rendering/RenderMenuList.cpp:
2771         (WebCore::RenderMenuList::setStyle): Removed padding.  This is now set by the theme.
2772         (WebCore::RenderMenuList::calcMinMaxWidth): Now takes minimum text size into account.
2773         * rendering/RenderMenuList.h: Removed baselinePosition since we're letting the theme calculate that.
2774
2775         * rendering/RenderTheme.cpp: (WebCore::RenderTheme::isControlContainer): Added menuList as a ControlContainer, 
2776         so RenderThemeMac will compute its baseline.
2777         * rendering/RenderTheme.h: (WebCore::RenderTheme::minimumTextSize): Added.
2778         * rendering/RenderThemeMac.h: Added minimumTextSize, setPopupPaddingFromControlSize, popupButtonSizes, popupButtonMargins, popupButtonPadding.
2779         Removed sizeOfArrowControl. 
2780         * rendering/RenderThemeMac.mm:
2781         (WebCore::): Added enum for padding.
2782         (WebCore::RenderThemeMac::adjustRepaintRect): Now inflates rect to account for control shadow.
2783         (WebCore::RenderThemeMac::baselinePosition): Now calculates baseline for menulist.
2784         (WebCore::RenderThemeMac::popupButtonMargins): Tweaked values.
2785         (WebCore::RenderThemeMac::popupButtonSizes): Added.
2786         (WebCore::RenderThemeMac::popupButtonPadding): Added, so different padding can be set for different control sizes.
2787         (WebCore::RenderThemeMac::setPopupPaddingFromControlSize): Added.
2788         (WebCore::RenderThemeMac::paintMenuList): Now inflates rect to account for control shadow.
2789         (WebCore::RenderThemeMac::adjustMenuListStyle): Resets border, sets padding, sets control size.
2790         (WebCore::RenderThemeMac::setPopupButtonCellState): Removed unnecessary class name.
2791         (WebCore::RenderThemeMac::minimumTextSize): Added.
2792
2793 2006-07-09  Darin Adler  <darin@apple.com>
2794
2795         - add back "unused code" for plain text fields, still used by <isindex>!
2796
2797         * platform/TextField.h:
2798         * platform/mac/TextFieldMac.mm:
2799         * platform/mac/WebCoreTextField.h:
2800         * platform/mac/WebCoreTextField.mm:
2801         * rendering/RenderLineEdit.cpp:
2802
2803 2006-07-09  Darin Adler  <darin@apple.com>
2804
2805         Reviewed by Tim Hatcher.
2806
2807         - put more into the WebCore namespace
2808         - removed unused code for plain text fields
2809
2810         Put more classes, class templates, enums, functions, and constants into
2811         the WebCore namespace, including all the headers in the platform directory.
2812
2813         Removed lots of unneeded "WebCore::" qualifiers and "using" directives.
2814
2815         Added some "WebCore::" qualifiers in a few places.
2816
2817         Removed "uses WebCore::" in headers that we said we'd remove "when
2818         everything is in the WebCore namespace".
2819
2820         * bindings/js/JSDOMParser.cpp:
2821         * bindings/js/JSHTMLElementWrapperFactory.cpp:
2822         * bindings/js/JSXSLTProcessor.cpp:
2823         * bindings/js/kjs_binding.cpp:
2824         * bindings/js/kjs_css.cpp:
2825         * bindings/js/kjs_dom.cpp:
2826         * bindings/js/kjs_dom.h:
2827         * bindings/js/kjs_events.cpp:
2828         * bindings/js/kjs_proxy.h:
2829         * bindings/js/kjs_window.h:
2830         * bindings/objc/DOM.mm:
2831         * bridge/History.h:
2832         * bridge/JavaAppletWidget.h:
2833         * bridge/mac/FormDataMac.h:
2834         * bridge/mac/FormDataMac.mm:
2835         * bridge/mac/WebCoreAXObject.mm:
2836         * bridge/mac/WebCoreEncodings.mm:
2837         * bridge/mac/WebCoreFrameBridge.h:
2838         * bridge/mac/WebCoreIconDatabaseBridge.mm:
2839         * bridge/mac/WebCorePageState.h:
2840         * bridge/mac/WebCoreScriptDebugger.mm:
2841         * bridge/mac/WebCoreSettings.h:
2842         * css/CSSGrammar.y:
2843         * css/CSSPageRule.cpp:
2844         * css/CSSPageRule.h:
2845         * css/MediaList.cpp:
2846         * css/cssstyleselector.h:
2847         * dom/Clipboard.h:
2848         * dom/Document.cpp:
2849         * dom/Document.h:
2850         * dom/EventTargetNode.h:
2851         * dom/Node.cpp:
2852         * dom/Node.h:
2853         * dom/Position.h:
2854         * dom/Range.cpp:
2855         * dom/XMLTokenizer.cpp:
2856         * editing/AppendNodeCommand.h:
2857         * editing/ApplyStyleCommand.cpp:
2858         * editing/BreakBlockquoteCommand.cpp:
2859         * editing/BreakBlockquoteCommand.h:
2860         * editing/CompositeEditCommand.cpp:
2861         * editing/CompositeEditCommand.h:
2862         * editing/CreateLinkCommand.h:
2863         * editing/DeleteFromTextNodeCommand.h:
2864         * editing/DeleteSelectionCommand.h:
2865         * editing/FormatBlockCommand.h:
2866         * editing/HTMLInterchange.cpp:
2867         * editing/HTMLInterchange.h:
2868         * editing/IndentOutdentCommand.h:
2869         * editing/InsertIntoTextNodeCommand.h:
2870         * editing/InsertLineBreakCommand.h:
2871         * editing/InsertListCommand.h:
2872         * editing/InsertNodeBeforeCommand.h:
2873         * editing/InsertTextCommand.cpp:
2874         * editing/InsertTextCommand.h:
2875         * editing/JSEditor.cpp:
2876         * editing/JSEditor.h:
2877         * editing/JoinTextNodesCommand.h:
2878         * editing/MergeIdenticalElementsCommand.cpp:
2879         * editing/MergeIdenticalElementsCommand.h:
2880         * editing/ModifySelectionListLevel.h:
2881         * editing/MoveSelectionCommand.h:
2882         * editing/RebalanceWhitespaceCommand.h:
2883         * editing/RemoveNodeAttributeCommand.h:
2884         * editing/RemoveNodeCommand.h:
2885         * editing/RemoveNodePreservingChildrenCommand.h:
2886         * editing/ReplaceSelectionCommand.h:
2887         * editing/SetNodeAttributeCommand.h:
2888         * editing/SplitElementCommand.cpp:
2889         * editing/SplitElementCommand.h:
2890         * editing/SplitTextNodeCommand.cpp:
2891         * editing/SplitTextNodeCommand.h:
2892         * editing/SplitTextNodeContainingElementCommand.h:
2893         * editing/TypingCommand.cpp:
2894         * editing/TypingCommand.h:
2895         * editing/UnlinkCommand.h:
2896         * editing/VisiblePosition.cpp:
2897         * editing/WrapContentsInDummySpanCommand.cpp:
2898         * editing/WrapContentsInDummySpanCommand.h:
2899         * editing/markup.cpp:
2900         * editing/markup.h:
2901         * html/HTMLAnchorElement.cpp:
2902         * html/HTMLBodyElement.cpp:
2903         * html/HTMLButtonElement.h:
2904         * html/HTMLCollection.h:
2905         * html/HTMLDocument.h:
2906         * html/HTMLEmbedElement.cpp:
2907         * html/HTMLFormElement.cpp:
2908         * html/HTMLFormElement.h:
2909         * html/HTMLFrameElement.cpp:
2910         * html/HTMLFrameSetElement.cpp:
2911         * html/HTMLKeygenElement.cpp:
2912         * html/HTMLLabelElement.cpp:
2913         * html/HTMLObjectElement.cpp:
2914         * html/HTMLObjectElement.h:
2915         * html/HTMLTableElement.cpp:
2916         * html/HTMLTablePartElement.cpp:
2917         * icon/IconDatabase.h:
2918         * kcanvas/KCanvasPath.h:
2919         * kcanvas/KCanvasResources.cpp:
2920         * kcanvas/KCanvasResources.h:
2921         * kcanvas/KCanvasTreeDebug.cpp:
2922         * kcanvas/KCanvasTreeDebug.h:
2923         * kcanvas/RenderSVGContainer.cpp:
2924         * kcanvas/RenderSVGText.h:
2925         * kcanvas/device/KRenderingPaintServer.h:
2926         * kcanvas/device/KRenderingPaintServerGradient.h:
2927         * kcanvas/device/KRenderingPaintServerSolid.cpp:
2928         * ksvg2/misc/SVGImageLoader.cpp:
2929         * ksvg2/svg/SVGElement.cpp:
2930         * ksvg2/svg/SVGElement.h:
2931         * ksvg2/svg/SVGForeignObjectElement.cpp:
2932         * ksvg2/svg/SVGForeignObjectElement.h:
2933         * ksvg2/svg/SVGImageElement.cpp:
2934         * ksvg2/svg/SVGPoint.h:
2935         * ksvg2/svg/SVGStylable.h:
2936         * ksvg2/svg/SVGTRefElement.cpp:
2937         * ksvg2/svg/SVGTRefElement.h:
2938         * ksvg2/svg/SVGTSpanElement.cpp:
2939         * ksvg2/svg/SVGTSpanElement.h:
2940         * ksvg2/svg/SVGTextElement.h:
2941         * ksvg2/svg/svgpathparser.cpp:
2942         * ksvg2/svg/svgpathparser.h:
2943         * loader/Cache.h:
2944         * loader/DocLoader.h:
2945         * loader/LoaderFunctions.h:
2946         * loader/mac/LoaderFunctionsMac.mm:
2947         * page/Frame.h:
2948         * page/FrameView.h:
2949         * page/Page.h:
2950         * page/Settings.h:
2951         * platform/AffineTransform.cpp:
2952         * platform/AffineTransform.h:
2953         * platform/Arena.cpp:
2954         * platform/Arena.h:
2955         * platform/CookieJar.h:
2956         * platform/DeprecatedCString.cpp:
2957         * platform/DeprecatedCString.h:
2958         * platform/DeprecatedPtrList.h:
2959         * platform/DeprecatedPtrListImpl.cpp:
2960         * platform/DeprecatedPtrListImpl.h:
2961         * platform/DeprecatedPtrQueue.h:
2962         * platform/DeprecatedString.cpp:
2963         * platform/DeprecatedString.h:
2964         * platform/DeprecatedStringList.cpp:
2965         * platform/DeprecatedStringList.h:
2966         * platform/DeprecatedValueList.h:
2967         * platform/DeprecatedValueListImpl.cpp:
2968         * platform/DeprecatedValueListImpl.h:
2969         * platform/FileButton.h:
2970         * platform/FloatPoint.h:
2971         * platform/FloatRect.h:
2972         * platform/FloatSize.h:
2973         * platform/FontData.h:
2974         * platform/FontFallbackList.h:
2975         * platform/GraphicsContext.h:
2976         * platform/IntPoint.h:
2977         * platform/IntRect.h:
2978         * platform/IntSize.h:
2979         * platform/KURL.cpp:
2980         * platform/KURL.h:
2981         * platform/ListBox.h:
2982         * platform/Logging.cpp:
2983         * platform/Logging.h:
2984         * platform/Pen.h:
2985         * platform/PopUpButton.h:
2986         * platform/RegularExpression.cpp:
2987         * platform/RegularExpression.h:
2988         * platform/SSLKeyGenerator.h:
2989         * platform/ScrollBar.h:
2990         * platform/SegmentedString.h:
2991         * platform/Shared.h:
2992         * platform/Slider.h:
2993         * platform/StringImpl.h:
2994         * platform/TextBox.h:
2995         * platform/TextField.h:
2996         * platform/TextStream.cpp:
2997         * platform/TextStream.h:
2998         * platform/TransferJob.h:
2999         * platform/TransferJobClient.h:
3000         * platform/Widget.h:
3001         * platform/cg/AffineTransformCG.cpp:
3002         * platform/mac/ClipboardMac.h:
3003         * platform/mac/ClipboardMac.mm:
3004         * platform/mac/DeprecatedStringListMac.mm:
3005         * platform/mac/FontCacheMac.mm:
3006         * platform/mac/KURLMac.mm:
3007         * platform/mac/ListBoxMac.mm:
3008         * platform/mac/PopUpButtonMac.mm:
3009         * platform/mac/SSLKeyGeneratorMac.mm:
3010         * platform/mac/TextBoxMac.mm:
3011         * platform/mac/TextFieldMac.mm:
3012         * platform/mac/WebCoreTextArea.h:
3013         * platform/mac/WebCoreTextArea.mm:
3014         * platform/mac/WebCoreTextField.h:
3015         * platform/mac/WebCoreTextField.mm:
3016         * rendering/DeprecatedRenderSelect.h:
3017         * rendering/RenderArena.cpp:
3018         * rendering/RenderArena.h:
3019         * rendering/RenderBlock.cpp:
3020         * rendering/RenderBox.cpp:
3021         * rendering/RenderContainer.cpp:
3022         * rendering/RenderFlexibleBox.cpp:
3023         * rendering/RenderFlow.cpp:
3024         * rendering/RenderLayer.cpp:
3025         * rendering/RenderLineEdit.cpp:
3026         * rendering/RenderObject.h:
3027         * rendering/RenderStyle.cpp:
3028         * rendering/RenderStyle.h:
3029         * rendering/RenderText.cpp:
3030         * rendering/RenderTextFragment.cpp:
3031         * rendering/RenderTheme.h:
3032         * rendering/RenderTreeAsText.cpp:
3033         * rendering/RenderTreeAsText.h:
3034         * rendering/RenderView.h:
3035         * rendering/bidi.h:
3036         * xml/XSLStyleSheet.cpp:
3037         * xml/XSLTProcessor.cpp:
3038
3039 2006-07-09  Geoffrey Garen  <ggaren@apple.com>
3040
3041         Reviewed by Beth.
3042
3043         * bindings/js/kjs_window.cpp:
3044         (KJS::Window::clear): Garbage collect after reinitalizing the global
3045         object, not before, since the reinitialization tends to create garbage.
3046
3047 2006-07-09  Timothy Hatcher  <timothy@apple.com>
3048
3049         Reviewed by Darin.
3050
3051         Bug 9820: Move new DOM API that has been through API review to public headers
3052         http://bugzilla.opendarwin.org/show_bug.cgi?id=9820
3053
3054         * bindings/objc/DOM.mm:
3055         (-[DOMElement focus]):
3056         (-[DOMElement blur]):
3057         (-[DOMRange text]):
3058         (-[DOMRange _text]):
3059         * bindings/objc/DOMCSS.mm:
3060         (-[DOMRGBColor color]):
3061         (-[DOMRGBColor _color]):
3062         * bindings/objc/DOMCore.h:
3063         * bindings/objc/DOMEvents.h:
3064         * bindings/objc/DOMExtensions.h:
3065         * bindings/objc/DOMHTML.mm:
3066         (-[DOMHTMLElement titleDisplayString]):
3067         (-[DOMHTMLDocument createDocumentFragmentWithMarkupString:baseURL:]):
3068         (-[DOMHTMLDocument createDocumentFragmentWithText:]):
3069         (-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:]):
3070         (-[DOMHTMLDocument _createDocumentFragmentWithText:]):
3071         * bindings/objc/DOMPrivate.h:
3072         * bindings/objc/DOMXPath.h:
3073         * bindings/objc/DOMXPath.mm:
3074
3075 2006-07-09  Beth Dakin  <bdakin@apple.com>
3076
3077         Reviewed by Maciej.
3078
3079         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9749 A 
3080         nested content editable div causes unnecessary screen redraws.
3081         
3082         We were repainting too much because we were deciding that we needed 
3083         a full layout because we didn't have a first line box. Our code 
3084         used to hold a lot of assumptions that positioned elements would 
3085         always have line boxes, but I fixed a few bugs a while back that 
3086         appeared because this assumption isn't true. This assumption was 
3087         also causing the extra redraws because the check meant that we 
3088         would decide to do a full layout for any positioned element that 
3089         did not have any line boxes in the first place. Maciej and I talked 
3090         about this, and we couldn't figure out why the check for line boxes 
3091         was part of determining if we need a full layout in the first 
3092         place. After hunting around the code, we decided to assume that 
3093         this check is antiquated. Removing it fixes the bug and doesn't 
3094         seem to break any layout tests. So, fingers crossed!
3095
3096         Will add layout test so soon.
3097
3098         * rendering/bidi.cpp:
3099         (WebCore::RenderBlock::layoutInlineChildren): Remove firstLineBox 
3100         check.
3101
3102 2006-07-09  David Harrison  <harrison@apple.com>
3103
3104         Reviewed by John Sullivan.
3105
3106         <rdar://problem/4598149> Deleting the contents of a DOMRange and then inserting a node into it crashes in WebCore::Font::canUseGlyphCache
3107
3108         Test: fast/dom/delete-contents.html
3109         
3110         * dom/Range.cpp:
3111         (WebCore::Range::processContents):
3112
3113 2006-07-09  Darin Adler  <darin@apple.com>
3114
3115         - another round of renaming; and KWQ is dead
3116
3117         * WebCore.vcproj/WebCore/WebCore.vcproj: Remove paths for kwq and khtml directories.
3118         Move files to their new locations. Did rename.
3119         * WebCore.xcodeproj/project.pbxproj: Move files to their new locations. Did rename.
3120         * WebCoreSources.bkl: Did rename.
3121         * webcore-base.bkl: Removed kwq.
3122
3123         * kwq/AccessibilityObjectCache.h: Removed.
3124         * kwq/AccessibilityObjectCache.mm: Removed.
3125         * kwq/FormDataMac.h: Removed.
3126         * kwq/FormDataMac.mm: Removed.
3127         * kwq/WebCoreAXObject.h: Removed.
3128         * kwq/WebCoreAXObject.mm: Removed.
3129         * kwq/WebCoreEditCommand.h: Removed.
3130         * kwq/WebCoreEditCommand.mm: Removed.
3131         * kwq/WebCorePageState.h: Removed.
3132         * kwq/WebCorePageState.mm: Removed.
3133         * kwq/WebCoreResourceLoaderImp.h: Removed.
3134         * kwq/WebCoreResourceLoaderImp.mm: Removed.
3135
3136         * bridge/AXObjectCache.h: Added.
3137         * bridge/mac/AXObjectCacheMac.mm: Added.
3138         * bridge/mac/WebCoreAXObject.h: Added.
3139         * bridge/mac/WebCoreAXObject.mm: Added.
3140
3141         * loader/CachedObject.cpp: Removed.
3142         * loader/CachedObject.h: Removed.
3143         * loader/CachedObjectClient.h: Removed.
3144         * loader/CachedObjectClientWalker.cpp: Removed.
3145         * loader/CachedObjectClientWalker.h: Removed.
3146
3147         * loader/CachedResource.cpp: Added.
3148         * loader/CachedResource.h: Added.
3149         * loader/CachedResourceClient.h: Added.
3150         * loader/CachedResourceClientWalker.cpp: Added.
3151         * loader/CachedResourceClientWalker.h: Added.
3152
3153         * bridge/mac/FrameMac.mm:
3154         * bridge/mac/WebCoreFrameBridge.mm:
3155         * css/CSSImageValue.h:
3156         * css/CSSImportRule.h:
3157         * dom/Document.cpp:
3158         * dom/Document.h:
3159         * dom/Notation.h:
3160         * dom/ProcessingInstruction.h:
3161         * dom/XMLTokenizer.cpp:
3162         * html/CanvasPattern.h:
3163         * html/HTMLDocument.h:
3164         * html/HTMLImageLoader.cpp:
3165         * html/HTMLImageLoader.h:
3166         * html/HTMLLinkElement.h:
3167         * html/HTMLScriptElement.cpp:
3168         * html/HTMLScriptElement.h:
3169         * html/HTMLTokenizer.cpp:
3170         * html/HTMLTokenizer.h:
3171         * kcanvas/KCanvasFilters.h:
3172         * ksvg2/svg/SVGCursorElement.cpp:
3173         * ksvg2/svg/SVGCursorElement.h:
3174         * ksvg2/svg/SVGFEImageElement.cpp:
3175         * ksvg2/svg/SVGFEImageElement.h:
3176         * loader/Cache.cpp:
3177         * loader/Cache.h:
3178         * loader/CachedCSSStyleSheet.cpp:
3179         * loader/CachedCSSStyleSheet.h:
3180         * loader/CachedImage.cpp:
3181         * loader/CachedImage.h:
3182         * loader/CachedScript.cpp:
3183         * loader/CachedScript.h:
3184         * loader/CachedXBLDocument.cpp:
3185         * loader/CachedXBLDocument.h:
3186         * loader/CachedXSLStyleSheet.cpp:
3187         * loader/CachedXSLStyleSheet.h:
3188         * loader/DocLoader.cpp:
3189         * loader/DocLoader.h:
3190         * loader/LoaderFunctions.h:
3191         * loader/Request.cpp:
3192         * loader/Request.h:
3193         * loader/loader.cpp:
3194         * loader/loader.h:
3195         * loader/mac/LoaderFunctionsMac.mm:
3196         * page/Frame.cpp:
3197         * page/FrameView.cpp:
3198         * platform/gdk/TemporaryLinkStubs.cpp:
3199         * platform/mac/ClipboardMac.h:
3200         * platform/win/TemporaryLinkStubs.cpp:
3201         * rendering/RenderBox.h:
3202         * rendering/RenderContainer.cpp:
3203         * rendering/RenderImage.cpp:
3204         * rendering/RenderImage.h:
3205         * rendering/RenderLayer.h:
3206         * rendering/RenderObject.cpp:
3207         * rendering/RenderObject.h:
3208         * rendering/RenderStyle.cpp:
3209         * rendering/RenderStyle.h:
3210         * xml/XSLImportRule.h:
3211         Did renaming.
3212
3213         * platform/mac/can-convert.mm: Removed.
3214
3215 2006-07-09  Anders Carlsson  <acarlsson@apple.com>
3216
3217         Reviewed by Tim O.
3218
3219         * WebCore.exp:
3220         Add wkPathFromFont.
3221         
3222         * platform/mac/FontDataMac.mm:
3223         (-[NSFont WebCore]):
3224         Use wkPathFromFont.
3225         
3226         * platform/mac/WebCoreSystemInterface.h:
3227         * platform/mac/WebCoreSystemInterface.mm:
3228         Declare wkPathFromFont.
3229
3230 2006-07-09  Brady Eidson  <beidson@apple.com>
3231
3232         Reviewed by Maciej
3233
3234         Set the stage to remove the workaround for the SQLite BLOB corruption.  A few other small cleanups, and
3235         preparation for pruning unreferenced and unretained icons.
3236
3237         * icon/IconDatabase.cpp:
3238         (WebCore::IconDatabase::recreateDatabase):  Added another trigger to assist in icon removal
3239         (WebCore::IconDatabase::deletePrivateTables):  Cleaned up logging messages
3240         (WebCore::IconDatabase::imageDataForIconID):  #ifdefed the blobbing hack for impending removal, use the real blob by default
3241         (WebCore::IconDatabase::imageDataForIconURL):  same
3242         (WebCore::IconDatabase::imageDataForPageURL):  same
3243         (WebCore::IconDatabase::pruneUnreferencedIcons):  Will delete any icons and their data that are not referenced
3244           by any PageURL
3245         * icon/IconDatabase.h:
3246
3247         * icon/SQLDatabase.h:  Changed BlobAsVector to be unsigned char as thats the most reasonable type for
3248           a byte-buffer, and is what CFData expects
3249         * icon/SQLStatement.cpp:
3250         (WebCore::SQLStatement::getColumnBlobAsVector):
3251
3252 2006-07-09  Darin Adler  <darin@apple.com>
3253
3254         - move all but the last 12 files out of kwq directory
3255         - removed a few unused source files I discovered
3256
3257         * WebCore.vcproj/WebCore/WebCore.vcproj: Update for new file locations.
3258         * WebCore.xcodeproj/project.pbxproj: Ditto.
3259
3260         * bridge/mac/FrameMac.mm:
3261         * dom/Element.h:
3262         * html/HTMLImageLoader.cpp:
3263         * loader/Cache.cpp:
3264         * loader/Cache.h:
3265         * loader/CachedCSSStyleSheet.cpp:
3266         * loader/CachedCSSStyleSheet.h:
3267         * loader/CachedImage.cpp:
3268         * loader/CachedImage.h:
3269         * loader/CachedObject.h:
3270         * loader/CachedScript.cpp:
3271         * loader/CachedScript.h:
3272         * loader/CachedXBLDocument.cpp:
3273         * loader/CachedXBLDocument.h:
3274         * loader/CachedXSLStyleSheet.cpp:
3275         * loader/CachedXSLStyleSheet.h:
3276         * loader/DocLoader.cpp:
3277         * loader/DocLoader.h:
3278         * page/Frame.cpp:
3279         * page/Frame.h:
3280         * page/FramePrivate.h:
3281         * platform/gdk/TemporaryLinkStubs.cpp:
3282         * platform/win/TemporaryLinkStubs.cpp:
3283         * rendering/DeprecatedSlider.cpp:
3284         * rendering/RenderObject.h:
3285         * xml/xmlhttprequest.cpp:
3286         Updated includes as needed for file location changes. Changed
3287         CachePolicy uses to match new filename and enum names.
3288
3289         * loader/CachedResource.cpp: Removed.
3290         * loader/CachedResource.h: Removed.
3291         * loader/CachedResourceClient.h: Removed.
3292         * loader/CachedResourceClientWalker.cpp: Removed.
3293         * loader/CachedResourceClientWalker.h: Removed.
3294         The above files were checked in by accident a while back. The rename of
3295         CachedObject to CachedResource is now reflected in do-webcore-rename,
3296         and will be done soon.
3297
3298         * kwq/AffineTransform.cpp: Removed.
3299         * kwq/AffineTransform.h: Removed.
3300         * kwq/CacheControl.h: Removed.
3301         * kwq/DeprecatedPtrQueue.h: Removed.
3302         * kwq/FileButton.h: Removed.
3303         * kwq/FileButton.mm: Removed.
3304         * kwq/ListBox.h: Removed.
3305         * kwq/ListBox.mm: Removed.
3306         * kwq/LoaderFunctions.h: Removed.
3307         * kwq/LoaderFunctions.mm: Removed.
3308         * kwq/PopUpButton.h: Removed.
3309         * kwq/PopUpButton.mm: Removed.
3310         * kwq/SSLKeyGenerator.h: Removed.
3311         * kwq/SSLKeyGenerator.mm: Removed.
3312         * kwq/Settings.h: Removed.
3313         * kwq/TextBox.h: Removed.
3314         * kwq/TextBox.mm: Removed.
3315         * kwq/TextField.h: Removed.
3316         * kwq/TextField.mm: Removed.
3317         * kwq/WebCoreScrollBar.h: Removed.
3318         * kwq/WebCoreScrollBar.mm: Removed.
3319         * kwq/WebCoreSlider.h: Removed.
3320         * kwq/WebCoreSlider.mm: Removed.
3321
3322         * loader/CachePolicy.h: Added.
3323         * loader/LoaderFunctions.h: Added.
3324
3325         * loader/mac/LoaderFunctionsMac.mm: Added.
3326
3327         * page/Settings.h: Added.
3328
3329         * platform/AffineTransform.cpp: Added.
3330         * platform/AffineTransform.h: Added.
3331         * platform/DeprecatedPtrQueue.h: Added.
3332         * platform/FileButton.h: Added.
3333         * platform/ListBox.h: Added.
3334         * platform/PopUpButton.h: Added.
3335         * platform/SSLKeyGenerator.h: Added.
3336         * platform/ScrollBar.h: Added.
3337         * platform/Slider.h: Added.
3338         * platform/TextBox.h: Added.
3339         * platform/TextField.h: Added.
3340
3341         * platform/cg/AffineTransformCG.cpp: Added.
3342
3343         * platform/mac/FileButtonMac.mm: Added.
3344         * platform/mac/ListBoxMac.mm: Added.
3345         * platform/mac/PopUpButtonMac.mm: Added.
3346         * platform/mac/SSLKeyGeneratorMac.mm: Added.
3347         * platform/mac/ScrollBarMac.mm: Added.
3348         * platform/mac/ScrollBarMac.mm: Added.
3349         * platform/mac/SliderMac.mm: Added.
3350         * platform/mac/SliderMac.mm: Added.
3351         * platform/mac/TextBoxMac.mm: Added.
3352         * platform/mac/TextFieldMac.mm: Added.
3353
3354 2006-07-09  Darin Adler  <darin@apple.com>
3355
3356         - move 4 files out of kwq directory
3357         - make some minor project adjustments for the WebCore project
3358
3359         * WebCore.xcodeproj/project.pbxproj: Link libsqlite3 the same way we do other
3360         libraries, rather than using a custom linker option. Moved the files from their
3361         old locations to the new ones. Removed "khtml" from the list of header search
3362         paths since that directory doesn't exist any more. Eliminated STYLE_LDFLAGS
3363         and just put -umbrella WebKit in OTHER_LDFLAGS in the Production configuration
3364         (was a leftover from "build styles" in Xcode 1). Changed to use EXPORTED_SYMBOLS_FILE
3365         instead of using -exported_symbols_list directly again now that Xcode has fixed the
3366         "strip twice" bug. Removed unneeded explicit SECTORDER_FLAGS = "" settings.
3367         Removed the explicit -Y,3 option now that Xcode does that by default.
3368
3369         * WebCore.vcproj/WebCore/WebCore.vcproj: Removed some obsolete uneeded files,
3370         many of which didn't exist any more. Moved the files from their old locations
3371         to the new ones.
3372
3373         * WebCoreSources.bkl: Moved the files from their old locations to the new ones.
3374
3375         * kwq/DeprecatedCString.cpp: Removed.
3376         * kwq/DeprecatedCString.h: Removed.
3377         * kwq/TextStream.cpp: Removed.
3378         * kwq/TextStream.h: Removed.
3379         * platform/DeprecatedCString.cpp: Added.
3380         * platform/DeprecatedCString.h: Added.
3381         * platform/TextStream.cpp: Added.
3382         * platform/TextStream.h: Added.
3383
3384 2006-07-09  Darin Adler  <darin@apple.com>
3385
3386         Rubber stamped by Maciej (kinda).
3387
3388         - did the next pass of renaming (used do-webcore-rename script)
3389           this takes care of most of the remaining KWQ names (almost all)
3390
3391         * WebCore+SVG/DOMList.h:
3392         * WebCore.vcproj/WebCore/WebCore.vcproj:
3393         * WebCore.xcodeproj/project.pbxproj:
3394         * WebCoreSources.bkl:
3395         * bindings/js/kjs_dom.cpp:
3396         * bindings/js/kjs_window.cpp:
3397         * bindings/objc/DOMHTML.mm:
3398         * bridge/mac/FrameMac.h:
3399         * bridge/mac/FrameMac.mm:
3400         * bridge/mac/WebCoreFrameBridge.mm:
3401         * bridge/mac/WebCoreSettings.h:
3402         * bridge/mac/WebCoreSettings.mm:
3403         * bridge/win/FrameWin.cpp:
3404         * css/CSSPrimitiveValue.cpp:
3405         * css/CSSValueKeywords.in:
3406         * css/MediaQueryEvaluator.cpp:
3407         * css/cssparser.cpp:
3408         * css/cssstyleselector.cpp:
3409         * css/cssstyleselector.h:
3410         * dom/CharacterData.cpp:
3411         * dom/CharacterData.h:
3412         * dom/Document.cpp:
3413         * dom/Element.cpp:
3414         * dom/Element.h:
3415         * dom/EventTargetNode.cpp:
3416         * dom/EventTargetNode.h:
3417         * dom/Node.cpp:
3418         * dom/Node.h:
3419         * dom/Position.cpp:
3420         * dom/ProcessingInstruction.cpp:
3421         * dom/QualifiedName.cpp:
3422         * dom/QualifiedName.h:
3423         * dom/XMLTokenizer.cpp: Added.
3424         * dom/xml_tokenizer.cpp: Removed.
3425         * dom/xml_tokenizer.h: Removed.
3426         * editing/EditAction.h:
3427         * editing/HTMLInterchange.cpp:
3428         * editing/HTMLInterchange.h:
3429         * editing/Selection.h:
3430         * editing/SelectionController.h:
3431         * editing/TextAffinity.h:
3432         * editing/TextIterator.cpp:
3433         * editing/TextIterator.h:
3434         * editing/VisiblePosition.h:
3435         * editing/htmlediting.cpp:
3436         * editing/markup.cpp:
3437         * editing/markup.h:
3438         * editing/visible_units.cpp:
3439         * editing/visible_units.h:
3440         * html/HTMLDocument.cpp:
3441         * html/HTMLFontElement.cpp:
3442         * html/HTMLInputElement.cpp:
3443         * html/HTMLKeygenElement.cpp:
3444         * html/HTMLSelectElement.h:
3445         * html/HTMLTextAreaElement.cpp:
3446         * html/HTMLTextFieldInnerElement.cpp:
3447         * html/HTMLTokenizer.cpp:
3448         * html/HTMLTokenizer.h:
3449         * kcanvas/KCanvasContainer.cpp: Removed.
3450         * kcanvas/KCanvasContainer.h: Removed.
3451         * kcanvas/KCanvasCreator.cpp:
3452         * kcanvas/KCanvasFilters.cpp:
3453         * kcanvas/KCanvasFilters.h:
3454         * kcanvas/KCanvasMatrix.cpp:
3455         * kcanvas/KCanvasMatrix.h:
3456         * kcanvas/KCanvasPath.cpp:
3457         * kcanvas/KCanvasPath.h:
3458         * kcanvas/KCanvasResources.cpp:
3459         * kcanvas/KCanvasResources.h:
3460         * kcanvas/KCanvasTreeDebug.cpp:
3461         * kcanvas/KCanvasTreeDebug.h:
3462         * kcanvas/RenderForeignObject.cpp:
3463         * kcanvas/RenderForeignObject.h:
3464         * kcanvas/RenderPath.cpp:
3465         * kcanvas/RenderPath.h:
3466         * kcanvas/RenderSVGContainer.cpp: Added.
3467         * kcanvas/RenderSVGContainer.h: Added.
3468         * kcanvas/RenderSVGImage.cpp:
3469         * kcanvas/RenderSVGImage.h:
3470         * kcanvas/RenderSVGText.cpp:
3471         * kcanvas/RenderSVGText.h:
3472         * kcanvas/device/KRenderingPaintServer.h:
3473         * kcanvas/device/KRenderingPaintServerGradient.cpp:
3474         * kcanvas/device/KRenderingPaintServerGradient.h:
3475         * kcanvas/device/KRenderingPaintServerPattern.cpp:
3476         * kcanvas/device/KRenderingPaintServerPattern.h:
3477         * kcanvas/device/KRenderingPaintServerSolid.cpp:
3478         * kcanvas/device/KRenderingPaintServerSolid.h:
3479         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
3480         * kcanvas/device/quartz/KCanvasItemQuartz.h:
3481         * kcanvas/device/quartz/KCanvasResourcesQuartz.h:
3482         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
3483         * kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm:
3484         * kcanvas/device/quartz/KRenderingPaintServerQuartz.mm:
3485         * ksvg2/css/CSSValueKeywords.in:
3486         * ksvg2/css/SVGRenderStyleDefs.cpp:
3487         * ksvg2/misc/KCanvasRenderingStyle.cpp:
3488         * ksvg2/misc/KSVGTimeScheduler.cpp:
3489         * ksvg2/svg/SVGAElement.cpp:
3490         * ksvg2/svg/SVGAnimateTransformElement.cpp:
3491         * ksvg2/svg/SVGAnimateTransformElement.h:
3492         * ksvg2/svg/SVGGElement.cpp:
3493         * ksvg2/svg/SVGHelper.cpp:
3494         * ksvg2/svg/SVGHelper.h:
3495         * ksvg2/svg/SVGImageElement.cpp:
3496         * ksvg2/svg/SVGLinearGradientElement.cpp:
3497         * ksvg2/svg/SVGMarkerElement.cpp:
3498         * ksvg2/svg/SVGMaskElement.cpp:
3499         * ksvg2/svg/SVGMatrix.cpp:
3500         * ksvg2/svg/SVGMatrix.h:
3501         * ksvg2/svg/SVGPatternElement.cpp:
3502         * ksvg2/svg/SVGRadialGradientElement.cpp:
3503         * ksvg2/svg/SVGSVGElement.cpp:
3504         * ksvg2/svg/SVGStyledElement.h:
3505         * ksvg2/svg/SVGStyledTransformableElement.cpp:
3506         * ksvg2/svg/SVGStyledTransformableEleme