Reviewed by Maciej.
[WebKit-https.git] / WebCore / ChangeLog
1 2006-05-05  Alexey Proskuryakov  <ap@nypop.com>
2
3         Reviewed by Maciej.
4
5         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8626
6           Strict mode erroneously triggered by a broken comment
7
8         Test: fast/parser/broken-comments-vs-parsing-mode.html
9
10         * page/Frame.cpp:
11         (WebCore::Frame::endIfNotLoading): Call determineParseMode() if needed.
12
13 2006-05-05  Darin Adler  <darin@apple.com>
14
15         - fix the Windows build (this time for sure)
16
17         * platform/win/TemporaryLinkStubs.cpp:
18         (GraphicsContext::translate): Added.
19         (GraphicsContext::rotate): Ditto.
20         (GraphicsContext::scale): Ditto.
21
22 2006-05-05  Darin Adler  <darin@apple.com>
23
24         - fix the Windows build
25
26         * bridge/win/FrameWin.h: Add Element* parameter to createPlugin.
27         * platform/win/TemporaryLinkStubs.cpp: (FrameWin::createPlugin): Ditto.
28
29 2006-05-05  Darin Adler  <darin@apple.com>
30
31         - get the Windows build a little closer to building again
32
33         * platform/cairo/GraphicsContextCairo.cpp:
34         (WebCore::GraphicsContext::drawRect): Call alpha to check if the color is transparent.
35         Call setColor directly instead of setColorFromPen.
36         (WebCore::GraphicsContext::drawLine): Ditto.
37         (WebCore::GraphicsContext::drawEllipse): Ditto.
38         (WebCore::GraphicsContext::drawArc): Ditto.
39         (WebCore::GraphicsContext::drawConvexPolygon): Ditto.
40         * platform/win/TemporaryLinkStubs.cpp: (JavaAppletWidget::JavaAppletWidget): Updated parameter types.
41
42 2006-05-05  Darin Adler  <darin@apple.com>
43
44         Reviewed by Adele.
45
46         - fixed data structure used to save/restore form element state to remove the
47           O(n^2) algorithm and remove anomalies in how it works
48         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8683
49           REGRESSION: imdb search button has "Submit" overload after going back
50
51         * manual-tests/form-value-restore.html: Added.
52
53         * bridge/mac/WebCoreFrameBridge.mm:
54         (-[WebCoreFrameBridge saveDocumentState]): Rewrote to call the new formElementsState
55         function on the document and also to convert null strings to NSNull instead of empty
56         NSString objects.
57         (-[WebCoreFrameBridge restoreDocumentState]): Ditto, with the setStateForNewFormElements
58         function.
59
60         * dom/Document.h: Added FormElementKey, FormElementKeyHash, and FormElementKeyHashTraits
61         for use in the hash map. Made readyState, inputEncoding, defaultCharset, charset,
62         characterSet, getElementByAccessKey, haveStylesheetsLoaded, usesDescendantRules,
63         usesSiblingRules, inCompatMode, inAlmostStrictMode, inStrictMode, preferredStylesheetSet,
64         selectedStylesheetSet, and getCSSTarget all const member functions. Removed the unused
65         nextState function. Renamed registerMaintainsState and deregisterMaintainsState to
66         registerFormElementWithState and HTMLGenericFormElement and changed them to use form
67         elements rather than arbitrary DOM nodes. Replaced docState with formElementsState and
68         setRestoreState and restoreState with setStateForNewFormElements, hasStateForNewFormElements,
69         and takeStateForFormElement. Replaced m_maintainsState with m_formElementsWithState,
70         m_state with m_stateForNewFormElements. Made m_elementsByAccessKey and m_accessKeyMapValid
71         mutable. Removed unused m_elementNames, m_elementNameAlloc, m_elementNameCount, m_attrNames,
72         m_attrNameAlloc, m_attrNameCount, m_namespaceURIs, m_namespaceURIAlloc, m_namespaceURICount.
73
74         * dom/Document.cpp:
75         (WebCore::Document::Document): Remove initialization of long-obsolete m_elementNames and
76         m_attrNames.
77         (WebCore::Document::~Document): Remove destruction of same.
78         (WebCore::Document::readyState): Made const.
79         (WebCore::Document::inputEncoding): Ditto.
80         (WebCore::Document::defaultCharset): Ditto.
81         (WebCore::Document::getElementByAccessKey): Ditto.
82         (WebCore::Document::preferredStylesheetSet): Ditto.
83         (WebCore::Document::selectedStylesheetSet): Ditto.
84         (WebCore::Document::getCSSTarget): Ditto.
85         (WebCore::Document::formElementsState): Added. Replaces the old docState function.
86         Builds a vector of strings, with 3 strings for each form element containing the
87         name, type, and state value.
88         (WebCore::Document::setStateForNewFormElements): Added. Converts the state vector
89         into a hash map, considering the scheme with 3 strings for form element used above.
90         (WebCore::Document::hasStateForNewFormElements): Added.
91         (WebCore::Document::takeStateForFormElement): Added. Given a name and type, looks
92         up the values in the hash map and "peels off" the last one.
93         (WebCore::FormElementKey::FormElementKey): Added.
94         (WebCore::FormElementKey::~FormElementKey): Added.
95         (WebCore::FormElementKey::operator=): Added.
96         (WebCore::FormElementKey::ref): Added.
97         (WebCore::FormElementKey::deref): Added.
98         (WebCore::FormElementKeyHash::hash): Added.
99         (WebCore::FormElementKeyHashTraits::deletedValue): Added.
100
101         * dom/Element.h: Removed state function.
102         * dom/Node.h: Removed maintainsState, state, and restoreState functions.
103         * dom/Node.cpp: Ditto.
104
105         * dom/QualifiedName.cpp: Reformatted.
106         (WebCore::hashComponents): Removed code to handle buffers that are not multiples
107         of 4 bytes, since a QualifiedName is guaranteed to be; also asserted that fact.
108
109         * html/HTMLParser.cpp:
110         (WebCore::HTMLParser::insertNode): Remove code to restore state; that's now handled
111         by closeRenderer.
112         (WebCore::HTMLParser::popOneBlock): Ditto.
113
114         * html/HTMLFormElement.cpp: Added include of HTMLInputElement.h.
115
116         * html/HTMLGenericFormElement.h: Changed form to be a const member function.
117         Changed type function to return a const AtomicString& instead of a String.
118         Added an override of closeRenderer. Removed state and findMatchingState functions.
119         Added stateValue and restoreState functions. Made m_form, m_disabled, and m_readOnly
120         be private instead of protected. Removed m_inited. Changed booleans to not use bit
121         fields since there are only two of them.
122         * html/HTMLGenericFormElement.cpp: Removed encodedElementName, state, and
123         findMatchingState functions.
124         (WebCore::HTMLGenericFormElement::stateValue): Added. No implementation. This will only be
125         called for subclasses that call registerFormElementWithState, and those will override and
126         implement it.
127         (WebCore::HTMLGenericFormElement::restoreState): Ditto.
128         (WebCore::HTMLGenericFormElement::closeRenderer): Added. Replaces code that was in the
129         HTML parser. Calls takeStateForFormElement, passing in the name and type, and if a
130         state is found, calls restoreState.
131
132         * html/HTMLButtonElement.h: Changed type to return a const AtomicString& instead
133         of a String.
134         * html/HTMLButtonElement.cpp:
135         (WebCore::HTMLButtonElement::type): Return a const AtomicString& instead of a
136         String.
137         (WebCore::HTMLButtonElement::defaultEventHandler): Use form() instead of m_form.
138         (WebCore::HTMLButtonElement::isSuccessfulSubmitButton): Use disabled() instead of
139         m_disabled.
140
141         * html/HTMLInputElement.h: Changed type to return a const AtomicString& instead
142         of a String. Removed maintainsState, state, and restoreState functions, and added
143         new stateValue and restoreState functions. Added m_inited (moved here from the generic
144         form element base class).
145         * html/HTMLInputElement.cpp:
146         (WebCore::HTMLInputElement::init): Call registerFormElementWithState. This was
147         formerly done by the HTML parser.
148         (WebCore::HTMLInputElement::~HTMLInputElement): Call deregisterFormElementWithState
149         by its new name.
150         (WebCore::HTMLInputElement::isKeyboardFocusable): Use form() instead of m_form.
151         (WebCore::HTMLInputElement::setType): Ditto.
152         (WebCore::HTMLInputElement::setInputType): Ditto. Also call inputType() != PASSWORD
153         instead of maintainsState(), since this is the only function that needs to know
154         the rule and it's no longer a function in the base class. Also call register and
155         deregister functions by their new names.
156         (WebCore::HTMLInputElement::type): Changed to return const AtomicString& instead
157         of String.
158         (WebCore::HTMLInputElement::stateValue): Renamed from state and changed to no
159         longer include the name and type, formerly obtained by calling the base class's
160         HTMLGenericFormElement::state, and to no longer modify the value() string by
161         adding a ".", which gets in the way of distinguishing null and empty values
162         and is slower and unnecessary.
163         (WebCore::HTMLInputElement::restoreState):  Changed because it takes a single
164         state and doesn't need to call findMatchingState, and also to no longer remove the last
165         character from the value when restoring state.
166         (WebCore::HTMLInputElement::parseMappedAttribute): Use form() instead of m_form.
167         (WebCore::HTMLInputElement::isSuccessfulSubmitButton): Use disabled() instead of
168         m_disabled.
169         (WebCore::HTMLInputElement::setChecked): Use form() instead of m_form.
170         (WebCore::HTMLInputElement::preDispatchEventHandler): Ditto.
171         (WebCore::HTMLInputElement::defaultEventHandler): Ditto.
172
173         * html/HTMLSelectElement.h: Changed type to return a const AtomicString& instead
174         of a String.
175         * html/HTMLSelectElement.cpp:
176         (WebCore::HTMLSelectElement::HTMLSelectElement): Call registerFormElementWithState.
177         This was formerly done by the HTML parser.
178         (WebCore::HTMLSelectElement::~HTMLSelectElement): Call deregisterFormElementWithState
179         by its new name.
180         (WebCore::HTMLSelectElement::type): Changed to return const AtomicString& instead
181         of String.
182         (WebCore::HTMLSelectElement::stateValue): Renamed from state and changed to no
183         longer include the name and type, formerly obtained by calling the base class's
184         HTMLGenericFormElement::state, and to build the string in a Vector<char> instead of
185         appending characters one at a time to a string.
186         (WebCore::HTMLSelectElement::restoreState):  Changed because it takes a single
187         state and doesn't need to call findMatchingState.
188         (WebCore::HTMLSelectElement::defaultEventHandler): Use form() instead of m_form.
189
190         * html/HTMLTextAreaElement.h: Changed type to return a const AtomicString& instead
191         of a String. Removed maintainsState, state, and restoreState functions, and added
192         new stateValue and restoreState functions.
193         * html/HTMLTextAreaElement.cpp:
194         (WebCore::HTMLTextAreaElement::HTMLTextAreaElement): Call registerFormElementWithState.
195         This was formerly done by the HTML parser. Also use member initialization instead of
196         assignment.
197         (WebCore::HTMLTextAreaElement::~HTMLTextAreaElement): Call deregisterFormElementWithState
198         by its new name.
199         (WebCore::HTMLTextAreaElement::type): Changed to return const AtomicString& instead
200         of String.
201         (WebCore::HTMLTextAreaElement::stateValue): Renamed from state and changed to no
202         longer include the name and type, formerly obtained by calling the base class's
203         HTMLGenericFormElement::state, and to no longer modify the value() string by
204         adding a ".", which is unnecessary.
205         (WebCore::HTMLTextAreaElement::restoreState): Changed because it takes a single
206         state and doesn't need to call findMatchingState, and also to no longer remove the last
207         character from the value when restoring state.
208         (WebCore::HTMLTextAreaElement::updateValue): Changed to const.
209         (WebCore::HTMLTextAreaElement::value): Ditto.
210         (WebCore::HTMLTextAreaElement::defaultValue): Ditto.
211
212         * html/HTMLFieldSetElement.h: Changed type to return a const AtomicString& instead
213         of a String.
214         * html/HTMLFieldSetElement.cpp: (WebCore::HTMLFieldSetElement::type): Ditto.
215         * html/HTMLKeygenElement.h: Ditto.
216         * html/HTMLKeygenElement.cpp: (WebCore::HTMLKeygenElement::type): Ditto.
217         * html/HTMLLegendElement.h: Ditto.
218         * html/HTMLLegendElement.cpp: (WebCore::HTMLLegendElement::type):
219         * html/HTMLOptGroupElement.h: Ditto.
220         * html/HTMLOptGroupElement.cpp: (WebCore::HTMLOptGroupElement::type): Ditto.
221         * html/HTMLOptionElement.h: Ditto.
222         * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::type): Ditto.
223
224         * ksvg2/svg/SVGAnimationElement.cpp: (SVGAnimationElement::closeRenderer):
225         Added missing call to base class.
226
227         * rendering/render_form.h: Removed element() functions that cast to the
228         appropriate derived element class. They do make some bits of code slightly
229         more readable, but they also require including too many headers. Removed
230         the includes of HTMLInputElement.h, HTMLSelectElement.h, HTMLTextAreaElement.h,
231         and KWQLineEdit.h, and added an include of GraphicsTypes.h.
232         * rendering/render_form.cpp:
233         (WebCore::RenderFormElement::updateFromElement): Changed use of element()
234         to instead use node() and cast.
235         (WebCore::RenderFormElement::clicked): Ditto.
236         (WebCore::RenderLineEdit::selectionChanged): Ditto.
237         (WebCore::RenderLineEdit::returnPressed): Ditto.
238         (WebCore::RenderLineEdit::performSearch): Ditto.
239         (WebCore::RenderLineEdit::addSearchResult): Ditto.
240         (WebCore::RenderLineEdit::calcMinMaxWidth): Ditto.
241         (WebCore::RenderLineEdit::setStyle): Ditto.
242         (WebCore::RenderLineEdit::updateFromElement): Ditto.
243         (WebCore::RenderLineEdit::valueChanged): Ditto.
244         (WebCore::RenderFileButton::calcMinMaxWidth): Ditto.
245         (WebCore::RenderFileButton::updateFromElement): Ditto.
246         (WebCore::RenderFileButton::returnPressed): Ditto.
247         (WebCore::RenderFileButton::valueChanged): Ditto.
248         (WebCore::RenderSelect::updateFromElement): Ditto.
249         (WebCore::RenderSelect::layout): Ditto.
250         (WebCore::RenderSelect::valueChanged): Ditto.
251         (WebCore::RenderSelect::selectionChanged): Ditto.
252         (WebCore::RenderSelect::updateSelection): Ditto.
253         (WebCore::RenderTextArea::destroy): Ditto.
254         (WebCore::RenderTextArea::calcMinMaxWidth): Ditto.
255         (WebCore::RenderTextArea::setStyle): Ditto.
256         (WebCore::RenderTextArea::updateFromElement): Ditto.
257         (WebCore::RenderTextArea::valueChanged): Ditto.
258         (WebCore::RenderTextArea::selectionChanged): Ditto.
259         (WebCore::RenderSlider::updateFromElement): Ditto.
260         (WebCore::RenderSlider::valueChanged): Ditto.
261
262 2006-05-05  Matt Gough  <matt@softchaos.com>
263
264         Reviewed by Darin.
265
266         http://bugzilla.opendarwin.org/show_bug.cgi?id=8563
267
268         Test: fast/doctypes/005-case-preserving.html
269
270         The doctype object in the DOM is now usable by client code
271         as opposed to always being exposed as nil. Now also ensures that
272         the 'name' of the component preserves the case of the original html source.
273         (i.e HtMl -> HtMl not HTML)
274
275         * dom/Document.h:
276         Changes comment by docType() to say it may return 0 for html
277         * html/HTMLDocument.cpp:
278         (WebCore::parseDocTypeDeclaration):
279         (WebCore::HTMLDocument::determineParseMode):
280         Preserves the case of the name component
281         (WebCore::HTMLDocument::doctype):removed
282         * html/HTMLDocument.h:
283         (WebCore::HTMLDocument::doctype):removed
284
285 2006-05-05  Rob Buis  <buis@kde.org>
286
287         Reviewed by Darin.
288
289         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8651:
290         [DOMHTMLSelectElement multiple] returns no when the select element is multiple
291
292         Correct the logic errors, which are clearly indicated by the changeset given
293         in the bug report.
294
295         * bindings/objc/DOMHTML.mm:
296         (-[DOMHTMLLinkElement disabled]):
297         (-[DOMHTMLSelectElement disabled]):
298         (-[DOMHTMLSelectElement multiple]):
299         (-[DOMHTMLOptGroupElement disabled]):
300         (-[DOMHTMLOptionElement defaultSelected]):
301         (-[DOMHTMLOptionElement disabled]):
302
303 2006-05-04  Darin Adler  <darin@apple.com>
304
305         Reviewed by Tim Omernick.
306
307         - fix storage leak I introduced yesterday
308
309         * platform/cg/GraphicsContextCG.cpp:
310         (WebCore::setCGFillColor): Added.
311         (WebCore::setCGStrokeColor): Added.
312         (WebCore::GraphicsContext::drawRect): Use setCGFillColor to avoid allocating
313         a CGColorRef object.
314         (WebCore::GraphicsContext::drawLine): Use setCGStrokeColor and setCGFillColor
315         to avoid allocating a CGColorRef object.
316         (WebCore::GraphicsContext::drawEllipse): Ditto.
317         (WebCore::GraphicsContext::drawArc): Ditto.
318         (WebCore::GraphicsContext::drawConvexPolygon): Ditto.
319         (WebCore::GraphicsContext::fillRect): Ditto.
320
321 2006-05-04  Justin Garcia  <justin.garcia@apple.com>
322
323         Reviewed by harrison
324
325         * dom/Node.cpp:
326         (WebCore::Node::rootEditableElement):
327         Restored code to stop at the body tag.  Editing shouldn't be allowed to 
328         happen outside the body, so it needs to be the editable root even if the 
329         html element is contentEditable.
330         * editing/ReplaceSelectionCommand.cpp:
331         (WebCore::ReplaceSelectionCommand::shouldMergeEnd):
332         Now takes in more information so it can be "the decider".
333         (WebCore::ReplaceSelectionCommand::doApply):
334         Merging two paragraphs will destroy the moved one's block styles. Perform 
335         the end merge backward (from content already in the document to just inserted
336         content) if moving forward would move the paragraph that contained the start of 
337         the selection being pasted into, since we always want to preserve that paragraph's 
338         block style.
339         Moving backward in this case is also helpful because otherwise it would be
340         difficult to remember the position where inserted content began (since merging
341         would remove m_firstNodeInserted).  That position is needed in order to select 
342         the replacement and to add smart replace whitespace.
343         (WebCore::ReplaceSelectionCommand::removeEndBRIfNeeded):
344         If [br, 0] is at the end of a block, the br is not necessarily collapsed
345         in quirks mode.  [br, 0] needs to also not be at the start of a block.
346          
347         * editing/ReplaceSelectionCommand.h:
348
349 2006-05-04  Tim Omernick  <timo@apple.com>
350
351         Reviewed by Darin.
352
353         <rdar://problem/4537606> Give Java WebKit plugin access to its own DOM element
354
355         * bridge/mac/WebCoreFrameBridge.h:
356         Added DOMElement parameter to -viewForJavaAppletWithFrame:attributeNames:attributeValues:baseURL:.
357
358         * bridge/JavaAppletWidget.h:
359         Constructor now takes the applet's element instead of its containing frame.
360
361         * bridge/mac/JavaAppletWidget.mm:
362         (JavaAppletWidget::JavaAppletWidget):
363         Pass the applet's element to viewForJavaAppletWithFrame:.
364
365         * rendering/RenderApplet.cpp:
366         (WebCore::RenderApplet::createWidgetIfNecessary):
367         Pass the element along to JavaAppletWidget.
368
369 2006-05-04  Tim Omernick  <timo@apple.com>
370
371         Reviewed by John Sullivan.
372
373         <rdar://problem/4480186> Give WebKit plugins access to their own DOM element
374
375         * bridge/mac/WebCoreFrameBridge.h:
376         Added DOMElement: parameter to -viewForPluginWithURL:attributeNames:attributueValues:MIMEType:
377
378         * bridge/mac/FrameMac.h:
379         * bridge/mac/FrameMac.mm:
380         (WebCore::FrameMac::createPlugin):
381         Added "element" parameter; wrap element in DOMElement and pass up to the bridge.
382
383         * page/Frame.h:
384         Added "element" parameter to createPlugin().
385         * page/Frame.cpp:
386         (WebCore::Frame::loadPlugin):
387         Get the plugin's DOM element and pass to createPlugin().
388
389 2006-05-04  Eric Seidel  <eseidel@apple.com>
390
391         Reviewed by timo.
392
393         Add drag & drop support to <input type="file">
394         http://bugzilla.opendarwin.org/show_bug.cgi?id=8733
395
396         Test: manual/input-type-file-drag-drop.html
397
398         * kwq/KWQFileButton.mm:
399         (-[WebFileChooserButton initWithWidget::]):
400         (-[WebCoreFileButton initWithWidget:]):
401         (-[WebCoreFileButton drawRect:]):
402         (-[WebCoreFileButton updateLabel]):
403         (-[WebCoreFileButton setFilename:]):
404         (-[WebCoreFileButton changeFilename:]):
405         (-[WebCoreFileButton chooseFilename:]):
406         (validFilenameFromPasteboard):
407         (-[WebCoreFileButton draggingEntered:]):
408         (-[WebCoreFileButton draggingExited:]):
409         (-[WebCoreFileButton performDragOperation:]):
410
411 2006-05-04  Beth Dakin  <bdakin@apple.com>
412
413         Reviewed by Hyatt.
414
415         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8732 
416         Backgrounds with background-size and background-origin do not 
417         always lay out correctly
418
419         * platform/cairo/ImageCairo.cpp:
420         (WebCore::Image::drawTiled): We no longer need to scale the source 
421         point since it will now come in with the scale already taken into 
422         account.
423         * platform/mac/ImageMac.mm:
424         (WebCore::Image::drawTiled): Same as above.
425         * rendering/RenderBox.cpp:
426         (WebCore::cacluateBackgroundSize): Now calculate the background 
427         size in a helper method.
428         (WebCore::RenderBox::paintBackgroundExtended): Calculate the 
429         background size before calculating cx, cy, cw, ch, sx, and sy so 
430         that they can all be calculated with the scaled image size taken 
431         into account.
432
433 2006-05-04  David Hyatt  <hyatt@apple.com>
434
435         Fix for 8693, crash when reloading PDF. Make sure to clear the truncator's
436         cached renderer.
437
438         Reviewed by beth
439
440         * bridge/mac/WebCoreStringTruncator.h:
441         * bridge/mac/WebCoreStringTruncator.mm:
442         (+[WebCoreStringTruncator clear]):
443         * platform/mac/WebTextRendererFactory.mm:
444         (-[WebTextRendererFactory clearCaches]):
445
446 2006-05-03  Darin Adler  <darin@apple.com>
447
448         Reviewed by Eric.
449
450         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8696
451           another round of GraphicsContext improvements
452
453         * WebCore.xcodeproj/project.pbxproj: Added GraphicsContextCG.cpp.
454         * html/CanvasRenderingContext2D.cpp:
455         (WebCore::CanvasRenderingContext2D::scale): Use new GraphicsContext function.
456         (WebCore::CanvasRenderingContext2D::rotate): Ditto.
457         (WebCore::CanvasRenderingContext2D::translate): Ditto.
458         * kwq/KWQComboBox.mm: Added include (not sure if this is needed for this patch,
459         but it's needed for one of my upcoming ones).
460
461         * platform/GraphicsContext.h: Changed fillColor and setFillColor to use Color
462         instead of RGBA32. Removed setColorFromFillColor and setColorFromPen. Added
463         scale, rotate, and translate functions.
464         * platform/GraphicsContext.cpp:
465         (WebCore::GraphicsContext::setFillColor): Changed to use Color instead of RGBA32.
466         (WebCore::GraphicsContext::fillColor): Ditto.
467
468         * platform/GraphicsTypes.h: Moved HorizontalAlignment here.
469         * platform/Widget.h: Removed HorizontalAlignment from here.
470
471         * platform/cg/GraphicsContextCG.cpp: Added. Started as a copy of GraphicsContextMac.mm.
472         (WebCore::GraphicsContext::drawRect): Rewrote to not rely on [NSGraphicsContext currentContext].
473         (WebCore::GraphicsContext::drawLine): Ditto.
474         (WebCore::GraphicsContext::drawEllipse): Ditto.
475         (WebCore::GraphicsContext::drawArc): Ditto.
476         (WebCore::GraphicsContext::drawConvexPolygon): Ditto.
477         (WebCore::GraphicsContext::fillRect): Ditto.
478         (WebCore::GraphicsContext::setLineWidth):  Added check of paintingDisabled(). 
479         (WebCore::GraphicsContext::setMiterLimit): Ditto.
480         (WebCore::GraphicsContext::setAlpha): Ditto.
481         (WebCore::GraphicsContext::clearRect): Ditto.
482         (WebCore::GraphicsContext::strokeRect): Ditto.
483         (WebCore::GraphicsContext::setLineCap): Ditto.
484         (WebCore::GraphicsContext::setLineJoin): Ditto.
485         (WebCore::GraphicsContext::clip): Ditto.
486         (WebCore::GraphicsContext::scale): Added.
487         (WebCore::GraphicsContext::rotate): Added.
488         (WebCore::GraphicsContext::translate): Added.
489
490         * platform/mac/GraphicsContextMac.mm: Moved most of this file into GraphicsContextCG.cpp.
491         (WebCore::GraphicsContext::setCompositeOperation): Added check of paintingDisabled().
492
493         * platform/mac/WebCoreSystemInterface.h: Added declarations so this header
494         stands alone.
495
496 2006-05-03  Darin Adler  <darin@apple.com>
497
498         Reviewed by Justin.
499
500         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8159
501           REGRESSION: Clicking outside new text field focuses the field
502
503         This bug has always been present for "content editable" HTML, but
504         now affects <input type=text> as well. The problem is with the editing
505         concept of a "deep equivalent". When computing the deep equivalent,
506         the code can move from outside an editable area to inside. To fix this,
507         I removed all use of the "deep equivalent" concept.
508
509         * rendering/RenderBlock.cpp: (WebCore::RenderBlock::positionForCoordinates):
510         Changed argument names from _x and _y to just x and y. When the element
511         is the editable root, changed things so that clicks that are not within
512         the element at all return positions before or after the element, rather than
513         always choosing the closest point within the element. This gets us off on
514         the right foot, by not choosing a position inside an editable root when you
515         click outside that editable root. This code handles shadowParentNode as well,
516         and also calls positionForCoordinates on children rather than calling
517         positionForRenderer (which I believe is now a function that can be removed).
518
519         * editing/VisiblePosition.h: Removed the deepEquivalent function.
520         * editing/VisiblePosition.cpp:
521         (WebCore::VisiblePosition::previousVisiblePosition): Removed use of the
522         deepEquivalent function. Also, to make this function easier to understand
523         I separated out the case where the start point is "in rendered content"
524         and the case where it's not into two separate loops.
525         (WebCore::VisiblePosition::nextVisiblePosition): Ditto.
526         (WebCore::VisiblePosition::initDeepPosition): Removed use of the deepEquivalent
527         function. Also added code to make sure that this work never turns a position
528         outside an editable element into a position inside that editable element, or
529         vice versa. Reorganized the code a bit.
530
531         * dom/Position.cpp:
532         (WebCore::Position::upstream): Removed use of the deepEquivalent function.
533         (WebCore::Position::downstream): Ditto.
534
535         * editing/htmlediting.cpp:
536         (WebCore::editingIgnoresContent): Changed to use isReplaced instead of isWidget
537         and isImage to determine if editing should ignore content.
538         (WebCore::firstInSpecialElement): Rewrote isFirstVisiblePositionInSpecialElement
539         to have code to share with positionBeforeContainingSpecialElement. And changed
540         to allow both the position just before a table and the position just inside a
541         table to qualify. While this is slightly sloppy, the old code worked because
542         of the "deep equivalent" technique. This change is needed to get the desired
543         results even without that technique.
544         (WebCore::lastInSpecialElement): Ditto.
545         (WebCore::isFirstVisiblePositionInSpecialElement): Changed to use the new function.
546         (WebCore::positionBeforeContainingSpecialElement): Ditto.
547         (WebCore::isLastVisiblePositionInSpecialElement): Ditto.
548         (WebCore::positionAfterContainingSpecialElement): Ditto.
549
550         * dom/Node.cpp: (WebCore::Node::rootEditableElement): Rewrote to remove
551         special case for body tag.
552
553         - other changes
554
555         * html/HTMLElement.cpp:
556         (WebCore::HTMLElement::setOuterHTML): Added a FIXME about the fact
557         that this won't merge neighboring text nodes the way setOuterText does.
558         (WebCore::HTMLElement::setInnerText): Added a FIXME about the fact that
559         this creates a text node even when setting to empty text.
560         (WebCore::HTMLElement::setOuterText): Ditto.
561
562         * editing/DeleteSelectionCommand.cpp: Removed some #if 1 and #if 0.
563         * editing/ReplaceSelectionCommand.cpp: A little reformatting.
564         * rendering/render_button.h: Tiny formatting tweak.
565
566 2006-05-02  Adele Peterson  <adele@apple.com>
567
568         Reviewed by Beth.
569
570         Fix for <rdar://problem/4523671> 
571         REGRESSION (NativeTextField): Auto-complete popup list doesn't appear at the correct location after scrolling page.
572
573         * bindings/objc/DOMHTML.mm: (-[DOMHTMLInputElement _rectOnScreen]):
574         Use the documentView to compute the correct rect for the element when the view is scrolled.
575
576 2006-05-02  Justin Garcia  <justin.garcia@apple.com>
577
578         Reviewed by harrison
579         
580         <http://bugzilla.opendarwin.org/show_bug.cgi?id=8704>
581         Fix a few end merge bugs
582         <rdar://problem/4424044>
583         REGRESSION: Extra line appears when typing
584
585         * bridge/mac/WebCoreFrameBridge.mm:
586         (-[WebCoreFrameBridge smartInsertForString:replacingRange:beforeString:afterString:]): 
587         Use renamed characterAfter.
588         * editing/InsertParagraphSeparatorCommand.cpp:
589         (WebCore::InsertParagraphSeparatorCommand::doApply):
590         Regenerate a VisiblePosition that became stale during a text node split.
591         Don't rebalance whitespace after the operation, 1) it has a bug that turns preserved
592         newlines into nbsps, 2) I think it should only be done during serialization, not after 
593         every command (since editable regions now always have -webkit-nbsp-mode:space on them).
594         Use a regular br for the placeholder as I think we can move away from -webkit-block-placeholders.
595         
596         * editing/RebalanceWhitespaceCommand.cpp: Added FIXMEs.
597         * editing/ReplaceSelectionCommand.cpp:
598         (WebCore::ReplaceSelectionCommand::shouldMergeStart): Removed FIXME.
599         (WebCore::ReplaceSelectionCommand::shouldMergeEnd): Can now use rendering information.
600         (WebCore::ReplaceSelectionCommand::doApply):
601         Call shouldMergeEnd after the insertion so that it can use rendering information.
602         Don't use positionAfterNode of the last node inserted to mark the position at the end 
603         of inserted content because canonicalization can send it into content that was already
604         in the document.
605         
606         * editing/ReplaceSelectionCommand.h:
607         * editing/VisiblePosition.cpp:
608         (WebCore::VisiblePosition::characterAfter): 
609         Renamed.  When two candidates are visually equivalent, the rightmost candidate will be 
610         the one inside the text node where the character will be.
611         
612         * editing/VisiblePosition.h:
613         * editing/htmlediting.cpp:
614         (WebCore::enclosingTableCell): Added.
615         (WebCore::enclosingList):
616         * editing/htmlediting.h:
617
618 2006-05-02  David Hyatt  <hyatt@apple.com>
619
620         Partial fix for the crash in bugzilla bug 8088.  There's a third crash
621         even after fixing this though.
622
623         Reviewed by darin
624
625         * platform/mac/WebTextRenderer.mm:
626         (WebCore::WidthMap::widths):
627         (WebCore::extendWidthMap):
628         * platform/mac/WebTextRendererFactory.mm:
629         (-[WebTextRendererFactory clearCaches]):
630
631 2006-05-02  Steve Falkenburg  <sfalken@apple.com>
632
633         Reviewed by eric.
634
635         * WebCore.vcproj/WebCore/WebCore.vcproj: defined NDEBUG in release build
636         * bridge/win/FrameWin.cpp:
637         (WebCore::FrameWin::FrameWin): turned on javascript.
638         * kwq/KWQKHTMLSettings.h: 
639         (KHTMLSettings::KHTMLSettings): initialized settings to 0
640
641 2006-05-02  David Hyatt  <hyatt@apple.com>
642
643         Make sure to updateLayout on all scrolling functions (in particular when
644         setting scrollLeft/Top).
645
646         Reviewed by eric
647
648         fast/overflow/008,html added as a test case.
649
650         * dom/Element.cpp:
651         (WebCore::Element::scrollIntoView):
652         (WebCore::Element::scrollIntoViewIfNeeded):
653         (WebCore::Element::setScrollLeft):
654         (WebCore::Element::setScrollTop):
655
656 2006-05-02  Anders Carlsson  <andersca@mac.com>
657
658         Reviewed by Dave Hyatt.
659         
660         http://bugzilla.opendarwin.org/show_bug.cgi?id=8688
661         file URLs aren't being serialized correctly when using window.location
662         
663         * platform/KURL.cpp:
664         (KURL::prettyURL):
665         Append "//" for file URLs.
666         
667 2006-05-01  David Hyatt  <hyatt@apple.com>
668
669         Convert WebTextRenderer to be a C++ class.  Change the factory so
670         that it uses pointer-based hashmaps instead of NSMutableDictionaries.
671         Convert uses of malloc/free to new/delete so that they start using
672         the fastMalloc/fastFree code.
673
674         Reviewed by darin
675
676         * bridge/mac/WebCoreStringTruncator.mm:
677         (stringWidth):
678         (truncateString):
679         * kwq/KWQComboBox.mm:
680         (QComboBox::sizeHint):
681         * kwq/KWQLineEdit.mm:
682         (QLineEdit::sizeForCharacterWidth):
683         * kwq/KWQListBox.mm:
684         (itemTextRenderer):
685         (groupLabelTextRenderer):
686         (QListBox::sizeForNumberOfLines):
687         (QListBox::clearCachedTextRenderers):
688         (-[KWQTableView drawRow:clipRect:]):
689         * platform/FontDataSet.h:
690         * platform/mac/FontMac.mm:
691         (WebCore::FontDataSet::~FontDataSet):
692         (WebCore::FontDataSet::getRenderer):
693         (WebCore::FontDataSet::invalidate):
694         (WebCore::Font::ascent):
695         (WebCore::Font::descent):
696         (WebCore::Font::lineSpacing):
697         (WebCore::Font::xHeight):
698         (WebCore::Font::selectionRectForText):
699         (WebCore::Font::drawText):
700         (WebCore::Font::drawHighlightForText):
701         (WebCore::Font::drawLineForText):
702         (WebCore::Font::drawLineForMisspelling):
703         (WebCore::Font::misspellingLineThickness):
704         (WebCore::Font::floatWidth):
705         (WebCore::Font::checkSelectionPoint):
706         * platform/mac/WebCoreTextRenderer.mm:
707         (WebCoreDrawTextAtPoint):
708         (WebCoreTextFloatWidth):
709         (WebCoreSetAlwaysUseATSU):
710         * platform/mac/WebTextRenderer.h:
711         (WebCore::WebTextRenderer::ascent):
712         (WebCore::WebTextRenderer::descent):
713         (WebCore::WebTextRenderer::lineSpacing):
714         (WebCore::WebTextRenderer::lineGap):
715         (WebCore::WebTextRenderer::misspellingLineThickness):
716         (WebCore::WebTextRenderer::misspellingLinePatternWidth):
717         (WebCore::WebTextRenderer::misspellingLinePatternGapWidth):
718         * platform/mac/WebTextRenderer.mm:
719         (WebCore::WebCoreInitializeFont):
720         (WebCore::WebCoreInitializeTextRun):
721         (WebCore::WebCoreInitializeEmptyTextStyle):
722         (WebCore::WebCoreInitializeEmptyTextGeometry):
723         (WebCore::widthForGlyph):
724         (WebCore::overrideLayoutOperation):
725         (WebCore::m_ATSUMirrors):
726         (WebCore::WebTextRenderer::~WebTextRenderer):
727         (WebCore::WebTextRenderer::xHeight):
728         (WebCore::WebTextRenderer::drawRun):
729         (WebCore::WebTextRenderer::floatWidthForRun):
730         (WebCore::WebTextRenderer::drawLineForCharacters):
731         (WebCore::WebTextRenderer::selectionRectForRun):
732         (WebCore::WebTextRenderer::drawHighlightForRun):
733         (WebCore::WebTextRenderer::drawLineForMisspelling):
734         (WebCore::WebTextRenderer::pointToOffset):
735         (WebCore::WebTextRenderer::setAlwaysUseATSU):
736         (WebCore::getSmallCapsRenderer):
737         (WebCore::findSubstituteFont):
738         (WebCore::rendererForAlternateFont):
739         (WebCore::computeWidthForSpace):
740         (WebCore::setUpFont):
741         (WebCore::CG_selectionRect):
742         (WebCore::CG_draw):
743         (WebCore::updateGlyphMapEntry):
744         (WebCore::extendGlyphMap):
745         (WebCore::extendWidthMap):
746         (WebCore::initializeATSUStyle):
747         (WebCore::createATSULayoutParameters):
748         (WebCore::disposeATSULayoutParameters):
749         (WebCore::addDirectionalOverride):
750         (WebCore::ATSU_selectionRect):
751         (WebCore::ATSU_draw):
752         (WebCore::ATSU_pointToOffset):
753         (WebCore::freeWidthMap):
754         (WebCore::freeGlyphMap):
755         (WebCore::glyphForCharacter):
756         (WebCore::advanceWidthIterator):
757         * platform/mac/WebTextRendererFactory.h:
758         * platform/mac/WebTextRendererFactory.mm:
759         (-[WebTextRendererFactory clearCaches]):
760         (-[WebTextRendererFactory init]):
761         (-[WebTextRendererFactory dealloc]):
762         (-[WebTextRendererFactory rendererWithFont:]):
763
764 2006-05-01  Justin Garcia  <justin.garcia@apple.com>
765
766         Reviewed by darin
767         
768         <http://bugzilla.opendarwin.org/show_bug.cgi?id=8653>
769         Remove a use of hasMoreThanOneBlock, which uses info from the test rendering.
770
771         * editing/DeleteSelectionCommand.cpp:
772         (WebCore::DeleteSelectionCommand::initializePositionData):
773         Removed code that stopped the merge if the end of the selection to delete
774         was in a fully selected line, which was nonsense.
775         
776         (WebCore::DeleteSelectionCommand::mergeParagraphs):
777         Deletion does a bad job of updating the endpoints of the selection as it removes 
778         content.  If the endpoints have been flip flipped, bail.
779         If deletion has removed everything from the block that contained the
780         start of the selection to delete, we can't create a visible position inside 
781         that block to serve as a destination for the merge.  So, we insert a placeholder 
782         at that position to prop the block open to let content in.
783         
784         * editing/ReplaceSelectionCommand.cpp:
785         (WebCore::ReplaceSelectionCommand::doApply):
786         Added an assert and two early returns for cases where we'll crash.
787         Removed a use of !fragment.hasMoreThanOneBlock, which uses test rendering info 
788         and which was wrong.
789         If we've already inserted content during the start merge, insertionPos will be 
790         the position just after that content, so inserting new content before insertionPos 
791         will reverse its order.
792
793 2006-05-01  Mitz Pettel  <opendarwin.org@mitzpettel.com>
794
795         Reviewed by Darin.
796
797         - manual test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8658
798           Assertion failure in -[WebPluginContainerCheck _isForbiddenFileLoad]
799           (bridge is null) when clicking QuickTime object with href
800
801         * manual-tests/plugin-controller-datasource.html: Added.
802         * manual-tests/resources/orange.mov: Added.
803
804 2006-04-30  Rob Buis  <buis@kde.org>
805
806         Reviewed by eseidel.  Landed by eseidel.
807
808         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8651:
809         CGContextSetLineDash: invalid dash array: emmited during WebKit tests
810
811         Properly discard invalid stroke-dasharray properties like in
812         invalid-css.svg.  (Tests updated.)
813
814         * ksvg2/css/SVGCSSParser.cpp:
815         (WebCore::CSSParser::parseSVGStrokeDasharray):
816
817 2006-04-28  David Hyatt  <hyatt@apple.com>
818
819         Make image buffer sizes in the loader more accurate, since we know we store
820         buffers with 4 bytes per pixel.  Double sizes to account for this.  Also
821         deal better with animated GIFs that may have thousands of frames by adding
822         in a heuristic that will use the data size instead of a single frame RGBA32
823         buffer size if it's larger.
824
825         Reviewed by darin
826
827         * loader/Cache.cpp:
828         * loader/CachedImage.cpp:
829         (WebCore::CachedImage::data):
830
831 2006-04-28  Steve Falkenburg  <sfalken@apple.com>
832
833         Reviewed by eric.
834
835         No test necessary - fixing Win32 build, turned off C++ exceptions, turned off RTTI
836
837         * WebCore.vcproj/WebCore/WebCore.vcproj:
838         * bridge/win/FrameWin.cpp:
839         (WebCore::FrameWin::~FrameWin):
840         * bridge/win/PageWin.cpp:
841         (WebCore::Page::Page):
842         * page/Page.h:
843         * platform/win/TemporaryLinkStubs.cpp:
844         (FrameWin::saveDocumentState):
845         (Path::contains):
846         (Path::boundingRect):
847
848 2006-04-28  David Hyatt  <hyatt@apple.com>
849
850         Merge WebCoreTextRenderer into WebTextRenderer.  Merge WebCoreTextRendererFactory
851         into WebTextRendererFactory.  Change all callers to refer to the concrete classes
852         now.  Change WebCoreTextRenderer.h to be the public API that WebKit uses when
853         it calls in to WebCore.  Clean up the exports to remove things WebKit no longer
854         needs.
855
856         Reviewed by darin
857
858         * WebCore.exp:
859         * WebCore.xcodeproj/project.pbxproj:
860         * bridge/mac/WebCoreStringTruncator.mm:
861         (stringWidth):
862         (truncateString):
863         (+[WebCoreStringTruncator widthOfString:font:]):
864         * kwq/KWQComboBox.mm:
865         (QComboBox::sizeHint):
866         * kwq/KWQLineEdit.mm:
867         (QLineEdit::sizeForCharacterWidth):
868         * kwq/KWQListBox.mm:
869         (itemTextRenderer):
870         (groupLabelTextRenderer):
871         (QListBox::sizeForNumberOfLines):
872         (-[KWQTableView drawRow:clipRect:]):
873         * platform/Font.h:
874         * platform/FontDataSet.h:
875         * platform/mac/FontMac.mm:
876         (WebCore::FontDataSet::getWebCoreFont):
877         (WebCore::FontDataSet::getRenderer):
878         (WebCore::FontDataSet::determinePitch):
879         * platform/mac/WebCoreTextRenderer.h:
880         * platform/mac/WebCoreTextRendererFactory.mm:
881         (-[WebCoreTextRendererFactory init]):
882         * platform/mac/WebTextRenderer.h:
883         * platform/mac/WebTextRenderer.mm:
884         * platform/mac/WebTextRendererFactory.h:
885         * platform/mac/WebTextRendererFactory.mm:
886         (WebCoreInitializeFont):
887         (WebCoreInitializeTextRun):
888         (WebCoreInitializeEmptyTextStyle):
889         (WebCoreInitializeEmptyTextGeometry):
890         (-[WebTextRendererFactory clearCaches]):
891         (+[WebTextRendererFactory createSharedFactory]):
892         (+[WebTextRendererFactory sharedFactory]):
893         (-[WebTextRendererFactory init]):
894
895 2006-04-28  David Hyatt  <hyatt@apple.com>
896
897         Fix for 8586, move WebTextRenderer into WebCore.
898
899         Reviewed by darin
900
901         * WebCore.exp:
902         * WebCore.xcodeproj/project.pbxproj:
903         * bridge/mac/WebCoreStringTruncator.mm:
904         * platform/mac/WebCoreSystemInterface.h:
905         * platform/mac/WebCoreSystemInterface.mm:
906         * platform/mac/WebCoreTextRenderer.h:
907         * platform/mac/WebCoreTextRendererFactory.mm:
908         (+[WebCoreTextRendererFactory sharedFactory]):
909         * platform/mac/WebTextRenderer.h: Added.
910         * platform/mac/WebTextRenderer.mm: Added.
911         (widthForGlyph):
912         (-[WebTextRenderer initWithFont:]):
913         (destroy):
914         (-[WebTextRenderer drawLineForCharacters:yOffset:width:color:thickness:]):
915         (-[WebTextRenderer drawLineForMisspelling:withWidth:]):
916         (findSubstituteFont):
917         (setUpFont):
918         (pathFromFont):
919         (drawGlyphs):
920         (CG_draw):
921         (extendGlyphMap):
922         (extendWidthMap):
923         (initializeATSUStyle):
924         (createATSULayoutParameters):
925         (getTextBounds):
926         (addDirectionalOverride):
927         (ATSU_draw):
928         (normalizeVoicingMarks):
929         (advanceWidthIterator):
930         (fillStyleWithAttributes):
931         * platform/mac/WebTextRendererFactory.h: Added.
932         * platform/mac/WebTextRendererFactory.mm: Added.
933         (getAppDefaultValue):
934         (getUserDefaultValue):
935         (getLCDScaleParameters):
936         (fontsChanged):
937         (+[WebTextRendererFactory createSharedFactory]):
938         (-[WebTextRendererFactory isFontFixedPitch:]):
939         (-[WebTextRendererFactory fontWithFamily:traits:size:]):
940         (FontCacheKeyCopy):
941         (-[WebTextRendererFactory cachedFontFromFamily:traits:size:]):
942
943 2006-04-28  Eric Seidel  <eseidel@apple.com>
944
945         Fix by beth.  Reviewed by darin.  Landed by eseidel.
946
947         Make hackish fix to avoid crash in Xcode and Filemaker.
948         <rdar://problem/4059059> Crash in RenderFlow::detach (XCode Documentation Window)
949
950         * bridge/mac/WebCoreFrameBridge.mm:
951         (-[WebCoreFrameBridge didNotOpenURL:pageCache:]):
952
953 2006-04-28  Alexey Proskuryakov  <ap@nypop.com>
954
955         Reviewed by hyatt.
956
957         - http://bugzilla.opendarwin.org/show_bug.cgi?id=5855
958           REGRESSION: revert SGML comment parsing fix (comment parsing causes most of usbank.com page to be missing)
959
960         * html/HTMLTokenizer.cpp:
961         (WebCore::HTMLTokenizer::parseComment): Revert one change made for acid2, 
962         <http://weblogs.mozillazine.org/hyatt/acid6.txt>.
963
964 2006-04-28  Darin Adler  <darin@apple.com>
965
966         Reviewed by Eric.
967
968         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8608
969           make GraphicsContext more suitable for cross-platform use, step 2
970
971         - Changed GraphicsContext to use NSGraphicsContext as little as possible.
972         - Removed the printing flag from GraphicsContext.
973         - Changed GraphicsContext to assume the NSGraphicsContext is always flipped,
974           and got rid of parameters to pass the flipped boolean around.
975
976         * WebCore.vcproj/WebCore/WebCore.vcproj: Add GraphicsTypes.h/cpp and remove
977         CompositeOperator.h/cpp.
978         * WebCore.xcodeproj/project.pbxproj: Ditto.
979
980         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::setDisplaysWithFocusAttributes):
981         * bridge/mac/WebCoreFrameBridge.mm: (-[WebCoreFrameBridge drawRect:]):
982         * html/CanvasPattern.cpp: (WebCore::patternCallback):
983         * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createDrawingContext):
984         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
985         (WebCore::KRenderingDeviceContextQuartz::createGraphicsContext):
986         * platform/mac/WidgetMac.mm: (WebCore::Widget::lockDrawingFocus):
987         Update for changes to GraphicsContext constructor (no flipped or printing boolean).
988
989         * html/CanvasRenderingContext2D.h: Added a Path to the context state. Changed the
990         LineCap and LineJoin types to use the new ones in GraphicsTypes.h instead of defining
991         types here in this class. Changed m_platformContextStrokeStyleIsPattern and
992         m_platformContextFillStyleIsPattern to be named m_appliedStrokePattern and
993         m_appliedFillPattern and moved them outside the __APPLE__ ifdefs. Removed the
994         platformContext() function. Moved applyStrokePattern and applyFillPattern out of
995         the __APPLE__ ifdef.
996
997         * html/CanvasRenderingContext2D.cpp:
998         (WebCore::CanvasRenderingContext2D::State::State): Moved the stroke pattern
999         booleans out of Mac-specific ifdef.
1000         (WebCore::CanvasRenderingContext2D::save): Changed to use GraphicsContext instead
1001         of using CGContext directly.
1002         (WebCore::CanvasRenderingContext2D::restore): Ditto.
1003         (WebCore::CanvasRenderingContext2D::setStrokeStyle): Ditto.
1004         (WebCore::CanvasRenderingContext2D::setFillStyle): Ditto.
1005         (WebCore::CanvasRenderingContext2D::setLineWidth): Ditto.
1006         (WebCore::CanvasRenderingContext2D::lineCap): Ditto.
1007         (WebCore::CanvasRenderingContext2D::setLineCap): Ditto.
1008         (WebCore::CanvasRenderingContext2D::lineJoin): Ditto.
1009         (WebCore::CanvasRenderingContext2D::setLineJoin): Ditto.
1010         (WebCore::CanvasRenderingContext2D::setMiterLimit): Ditto.
1011         (WebCore::CanvasRenderingContext2D::shadowColor): Ditto.
1012         (WebCore::CanvasRenderingContext2D::setGlobalAlpha): Ditto.
1013         (WebCore::CanvasRenderingContext2D::setGlobalCompositeOperation): Ditto.
1014         (WebCore::CanvasRenderingContext2D::scale): Update since platformContext() function
1015         no longer exists.
1016         (WebCore::CanvasRenderingContext2D::rotate): Ditto.
1017         (WebCore::CanvasRenderingContext2D::translate): Ditto.
1018         (WebCore::CanvasRenderingContext2D::beginPath): Changed to use GraphicsContext instead
1019         of using CGContext directly.
1020         (WebCore::CanvasRenderingContext2D::closePath): Ditto.
1021         (WebCore::CanvasRenderingContext2D::moveTo): Ditto.
1022         (WebCore::CanvasRenderingContext2D::lineTo): Ditto.
1023         (WebCore::CanvasRenderingContext2D::quadraticCurveTo): Ditto.
1024         (WebCore::CanvasRenderingContext2D::bezierCurveTo): Ditto.
1025         (WebCore::CanvasRenderingContext2D::arcTo): Ditto.
1026         (WebCore::CanvasRenderingContext2D::arc): Ditto.
1027         (WebCore::CanvasRenderingContext2D::rect): Ditto.
1028         (WebCore::CanvasRenderingContext2D::fill): Changed to use the current path from this class
1029         instead of relying on the CGContext's current path.
1030         (WebCore::CanvasRenderingContext2D::stroke): Ditto.
1031         (WebCore::CanvasRenderingContext2D::clip): Changed to use the current path and use the
1032         GraphicsContext instead of using CGContext directly.
1033         (WebCore::CanvasRenderingContext2D::clearRect): Changed to use GraphicsContext instead
1034         of using CGContext directly.
1035         (WebCore::CanvasRenderingContext2D::fillRect): Update since platformContext() function
1036         no longer exists.
1037         (WebCore::CanvasRenderingContext2D::strokeRect): Ditto.
1038         (WebCore::CanvasRenderingContext2D::setShadow): Ditto.
1039         (WebCore::CanvasRenderingContext2D::applyShadow): Ditto.
1040         (WebCore::CanvasRenderingContext2D::drawImage): Ditto.
1041         (WebCore::CanvasRenderingContext2D::drawImageFromRect): Ditto.
1042         (WebCore::CanvasRenderingContext2D::createPattern): Ditto.
1043         (WebCore::CanvasRenderingContext2D::applyStrokePattern): Made a tiny bit of this function
1044         cross-platform. The bulk is still Mac-specific.
1045         (WebCore::CanvasRenderingContext2D::applyFillPattern): Ditto.
1046
1047         * html/CanvasStyle.h: Changed to use GraphicsContext instead of CGContext. Now the
1048         platform-specific stuff is in the implementation, not the header.
1049         * html/CanvasStyle.cpp:
1050         (WebCore::CanvasStyle::applyStrokeColor): Moved the ifdefs inside the function, getting
1051         us one step closer to platform independence.
1052         (WebCore::CanvasStyle::applyFillColor): Ditto.
1053
1054         * html/html_imageimpl.cpp:
1055         (WebCore::HTMLAreaElement::getRect): Update for changes to the Path class.
1056         (WebCore::HTMLAreaElement::getRegion): Ditto.
1057
1058         * page/Frame.cpp:
1059         (WebCore::Frame::paint): Change to check printing flag on the document, rather than on
1060         the GraphicsContext, since there is no printing flag for GraphicsContext any more.
1061         (WebCore::Frame::adjustPageHeight): Update for change to GraphicsContext constructor.
1062
1063         * platform/GraphicsContext.h: Define a type called PlatformGraphicsContext so the
1064         platform-specific getter and constructor don't have to be ifdef'd. Added clearRect,
1065         strokeRect, setLineWidth, setLineCap, setLineJoin, setMiterLimit, setAlpha, setCompositeOperation,
1066         and clip functions. Removed the isForPrinting parameter from createGraphicsContextPrivate.
1067         * platform/GraphicsContext.cpp:
1068         (WebCore::GraphicsContextPrivate::GraphicsContextPrivate): Removed isForPrinting.
1069         (WebCore::GraphicsContext::createGraphicsContextPrivate): Ditto.
1070         * platform/mac/GraphicsContextMac.mm:
1071         (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
1072         Removed NSGraphicsContext.
1073         (WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate):
1074         Ditto.
1075         (WebCore::GraphicsContext::GraphicsContext): Removed constructor that
1076         takes an NSGraphicsContext. Removed the flipText and forPrinting parameters
1077         to the other constructor.
1078         (WebCore::GraphicsContext::savePlatformState): Removed NSGraphicsContext code.
1079         (WebCore::GraphicsContext::restorePlatformState): Ditto.
1080         (WebCore::GraphicsContext::drawRect): Updated assertion to more-precisely
1081         reflect the limitation of the current version of this function.
1082         (WebCore::GraphicsContext::setColorFromFillColor): Ditto.
1083         (WebCore::GraphicsContext::setColorFromPen): Ditto.
1084         (WebCore::GraphicsContext::drawLine): Updated assertion to more-precisely
1085         reflect the limitation of the current version of this function.
1086         (WebCore::setCompositeOperation):
1087         (WebCore::GraphicsContext::fillRect): Ditto.
1088         (WebCore::GraphicsContext::setLineWidth): Added.
1089         (WebCore::GraphicsContext::setMiterLimit): Added.
1090         (WebCore::GraphicsContext::setAlpha): Added.
1091         (WebCore::GraphicsContext::setCompositeOperation): Added.
1092         (WebCore::GraphicsContext::clearRect): Added.
1093         (WebCore::GraphicsContext::strokeRect): Added.
1094         (WebCore::GraphicsContext::setLineCap): Added.
1095         (WebCore::GraphicsContext::setLineJoin): Added.
1096         (WebCore::GraphicsContext::clip): Added.
1097
1098         * platform/CompositeOperator.cpp: Removed.
1099         * platform/CompositeOperator.h: Removed.
1100         * platform/GraphicsTypes.cpp: Added. Includes CompositeOperator, LineCap, and LineJoin.
1101         * platform/GraphicsTypes.h: Added.
1102
1103         * platform/Image.h: Changed include to GraphicsTypes.h from CompositeOperator.h.
1104
1105         * platform/Path.h: Removed constructors that take a Rect and an array of points. Made
1106         the Path mutable. Changed the types for contains and boundingRect to be float-based
1107         instead of int-based. Changed translate to take a FloatSize instead of two integers.
1108         Added clear, moveTo, addLineTo, addQuadCurveTo, addBezierCurveTo, addArcTo, closeSubpath,
1109         addArc, addRect, addEllipse, and platformPath functions. Defined a PlatformPath type
1110         so we don't have to ifdef the header so much.
1111         * platform/cg/PathCG.cpp:
1112         (WebCore::Path::Path): Changed class to always have a mutable path.
1113         (WebCore::Path::operator=): Changed to make a mutable copy.
1114         (WebCore::Path::contains): Changed to take a FloatPoint instead of IntPoint.
1115         (WebCore::Path::translate): Changed to use a FloatSize instead of two ints.
1116         (WebCore::Path::boundingRect): Changed to return a FloatRect.
1117         (WebCore::Path::moveTo): Added.
1118         (WebCore::Path::addLineTo): Added.
1119         (WebCore::Path::addQuadCurveTo): Added.
1120         (WebCore::Path::addBezierCurveTo): Added.
1121         (WebCore::Path::addArcTo): Added.
1122         (WebCore::Path::closeSubpath): Added.
1123         (WebCore::Path::addArc): Added.
1124         (WebCore::Path::addRect): Added.
1125         (WebCore::Path::addEllipse): Added.
1126         (WebCore::Path::clear): Added.
1127
1128         * platform/mac/ImageMac.mm:
1129         (WebCore::fillSolidColorInRect): Changed to take a GraphicsContext instead of
1130         a CGContext.
1131         (WebCore::Image::checkForSolidColor): Changed to use the new setCompositeOperation
1132         in GraphicsContex.
1133         (WebCore::Image::draw): Changed to use the new PDF image and fillSolidColorInRect
1134         function that take GraphicsContext instead of CGContext.
1135         (WebCore::Image::drawTiled): Ditto.
1136
1137         * platform/mac/PDFDocumentImage.h: Made most functions private. Changed to
1138         use GraphicsContext and FloatRect instead of CGContext and NSRect. Also
1139         removed the unused alpha and flipped booleans.
1140         * platform/mac/PDFDocumentImage.mm:
1141         (WebCore::PDFDocumentImage::bounds): Update for change in types.
1142         (WebCore::PDFDocumentImage::adjustCTM): Ditto.
1143         (WebCore::PDFDocumentImage::setCurrentPage): Ditto.
1144         (WebCore::PDFDocumentImage::draw): Ditto.
1145
1146         * platform/win/TemporaryLinkStubs.cpp: Added lots of new stubs.
1147
1148         * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): Changed to get
1149         printing boolean from document instead graphics context.
1150         * rendering/RenderBlock.cpp:
1151         (WebCore::RenderBlock::paintChildren): Ditto.
1152         (WebCore::RenderBlock::paintObject): Ditto.
1153         * rendering/RenderFlow.cpp: (WebCore::RenderFlow::paintLines): Ditto.
1154         * rendering/RenderHTMLCanvas.cpp: (WebCore::RenderHTMLCanvas::paint): Ditto.
1155         * rendering/RenderImage.cpp: (WebCore::RenderImage::paint): Ditto.
1156         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintButton): Ditto.
1157         * rendering/render_list.cpp: (WebCore::RenderListMarker::paint): Ditto.
1158         * rendering/render_replaced.cpp: (WebCore::RenderWidget::paint): Ditto.
1159
1160 2006-04-28  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1161
1162         Reviewed by hyatt, landed by ap.
1163
1164         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6769
1165           REGRESSION: Incomplete repaint when a cell's extra bottom margin grows
1166
1167         Test: fast/repaint/table-extra-bottom-grow.html
1168
1169         * rendering/RenderBlock.cpp:
1170         (WebCore::RenderBlock::overflowRect): Changed to not add the top/left overflow twice and
1171         allow the normal overflow height to overlap with the bottom extra height.
1172         * rendering/RenderTableRow.cpp:
1173         (WebCore::RenderTableRow::layout): Removed the code that resets the extra heights.
1174         * rendering/RenderTableSection.cpp:
1175         (WebCore::RenderTableSection::layoutRows): If the top extra height changed or the
1176         bottom extra height increased, just repaint the entire cell.
1177
1178 2006-04-28  Eric Seidel  <eseidel@apple.com>
1179
1180         Reviewed by andersca.
1181
1182         Remove KCanvasContainerQuartz, pushing all logic into KCanvasContainer.
1183         
1184         No tests affected.
1185
1186         * kcanvas/KCanvasContainer.cpp:
1187         (WebCore::KCanvasContainer::canHaveChildren):
1188         (WebCore::KCanvasContainer::requiresLayer):
1189         (WebCore::KCanvasContainer::lineHeight):
1190         (WebCore::KCanvasContainer::baselinePosition):
1191         (WebCore::KCanvasContainer::calcMinMaxWidth):
1192         (WebCore::KCanvasContainer::layout):
1193         (WebCore::KCanvasContainer::paint):
1194         (WebCore::KCanvasContainer::setViewport):
1195         (WebCore::KCanvasContainer::viewport):
1196         (WebCore::KCanvasContainer::setViewBox):
1197         (WebCore::KCanvasContainer::viewBox):
1198         (WebCore::KCanvasContainer::setAlign):
1199         (WebCore::KCanvasContainer::align):
1200         (WebCore::KCanvasContainer::viewportTransform):
1201         (WebCore::KCanvasContainer::getAbsoluteRepaintRect):
1202         (WebCore::KCanvasContainer::absoluteTransform):
1203         (WebCore::KCanvasContainer::getAspectRatio):
1204         * kcanvas/KCanvasContainer.h:
1205         (WebCore::KCanvasContainer::renderName):
1206         * kcanvas/device/KRenderingDevice.h:
1207         * kcanvas/device/quartz/KCanvasResourcesQuartz.h:
1208         * kcanvas/device/quartz/KCanvasResourcesQuartz.mm:
1209         * kcanvas/device/quartz/KRenderingDeviceQuartz.h:
1210         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
1211         (WebCore::KRenderingDeviceQuartz::createPaintServer):
1212         * ksvg2/svg/SVGAElement.cpp:
1213         (WebCore::SVGAElement::createRenderer):
1214         * ksvg2/svg/SVGGElement.cpp:
1215         (SVGGElement::createRenderer):
1216         * ksvg2/svg/SVGMarkerElement.cpp:
1217         (WebCore::SVGMarkerElement::createRenderer):
1218         * ksvg2/svg/SVGMaskElement.cpp:
1219         (WebCore::SVGMaskElement::createRenderer):
1220         * ksvg2/svg/SVGPatternElement.cpp:
1221         (WebCore::SVGPatternElement::createRenderer):
1222         * ksvg2/svg/SVGSVGElement.cpp:
1223         (WebCore::SVGSVGElement::createRenderer):
1224         * ksvg2/svg/SVGSwitchElement.cpp:
1225         (WebCore::SVGSwitchElement::createRenderer):
1226         * ksvg2/svg/SVGUseElement.cpp:
1227         (SVGUseElement::createRenderer):
1228
1229 2006-04-27  Eric Seidel  <eseidel@apple.com>
1230
1231         Reviewed by andersca.
1232
1233         Make WebCore accept any */*+xml type as XML.
1234         http://bugzilla.opendarwin.org/show_bug.cgi?id=5998
1235         <rdar://problem/4031511> XmlHttpRequest doesn't allow responses with Content-Type: application/soap+xml
1236
1237         Test: http/tests/xmlhttprequest/supported-xml-content-types.html
1238
1239         * dom/DOMImplementation.cpp:
1240         (WebCore::DOMImplementation::isXMLMIMEType):
1241
1242 2006-04-27  Eric Seidel  <eseidel@apple.com>
1243
1244         * WebCore.vcproj/WebCore/WebCore.vcproj: Fix break from last checkin.
1245
1246 2006-04-27  Geoffrey Garen  <ggaren@apple.com>
1247
1248         Reviewed by Maciej.
1249
1250         - Added global constructor autogeneration for the following,
1251         many of which are required by *.live.com: Node, Element, Range,
1252         CSSRule, CSSValue, CSSPrimitiveValue, CSSStyleDeclaration, Event,
1253         MutationEvent, NodeFilter
1254
1255         It works like so:
1256         
1257         - The autogenerator knows about the "Constructor" data type, which
1258         gets special treatment because it exists purely in the
1259         bindings. It also knows about the "GenerateConstructor" interface
1260         attribute, which does just that.
1261
1262         - The window interface has many Constructor attributes
1263
1264         - The hash table generator swizzles empty tables to tables with one
1265         empty bucket, to prevent crashes in Lookup::findEntry. (The old
1266         generator used to work this way, too.)
1267
1268         - Window object property lookup gets special treatment to allow
1269         shadowing of its built-in global constructor properties. We'll
1270         need to expand this mechanism in the future and make it more
1271         flexible, but it works for now.
1272         
1273         * DerivedSources.make:
1274         * WebCore.vcproj/WebCore/WebCore.vcproj:
1275         * WebCore.xcodeproj/project.pbxproj:
1276         * bindings/js/kjs_css.cpp:
1277         (KJS::toJS):
1278         * bindings/js/kjs_css.h:
1279         * bindings/js/kjs_window.cpp: Removed 'namedFrameGetter' and its use
1280         because they were bogus; added FIXME describing what they were
1281         attempting to do.
1282         (KJS::Window::getValueProperty):
1283         (KJS::Window::getOverridePropertySlot):
1284         (KJS::Window::getOwnPropertySlot):
1285         * bindings/js/kjs_window.h:
1286         (KJS::Window::):
1287         * bindings/scripts/CodeGeneratorJS.pm:
1288         * css/CSSPrimitiveValue.idl:
1289         * css/CSSRule.idl:
1290         * css/CSSStyleDeclaration.idl: Added.
1291         * css/CSSValue.idl:
1292         * dom/Document.idl:
1293         * dom/Element.idl:
1294         * dom/Event.idl:
1295         * dom/MutationEvent.idl:
1296         * dom/Node.idl:
1297         * dom/NodeFilter.idl:
1298         * dom/Range.idl:
1299         * page/DOMWindow.idl:
1300
1301 2006-04-27  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1302
1303         Reviewed by darin
1304         
1305         <http://bugzilla.opendarwin.org/show_bug.cgi?id=8607>
1306         Automate repaint tests
1307
1308         * manual-tests/backgroundSizeRepaint.html: Removed.
1309         * manual-tests/border-repaint-glitch.html: Removed.
1310         * manual-tests/bugzilla-3509.html: Removed.
1311         * manual-tests/bugzilla-5699.html: Removed.
1312         * manual-tests/bugzilla-6278.html: Removed.
1313         * manual-tests/bugzilla-6388.html: Removed.
1314         * manual-tests/bugzilla-6473.html: Removed.
1315         * manual-tests/bugzilla-7235.html: Removed.
1316         * manual-tests/inline-outline-repaint.html: Removed.
1317         * manual-tests/outline-repaint-glitch.html: Removed.
1318         * manual-tests/repaint-resized-overflow.html: Removed.
1319         * manual-tests/table-cell-move.html: Removed.
1320
1321 2006-04-27  Justin Garcia  <justin.garcia@apple.com>
1322
1323         Reviewed by darin
1324         
1325         <http://bugzilla.opendarwin.org/show_bug.cgi?id=8624>
1326         Placeholders aren't always removed during paste
1327         <rdar://problem/4059807>
1328         Seed: Mail: pasting quoted content sometimes adds a phantom newline
1329
1330         * editing/CompositeEditCommand.cpp: Added a FIXME.
1331         * editing/ReplaceSelectionCommand.cpp:
1332         (WebCore::ReplaceSelectionCommand::doApply):
1333         Removed two no-op setEndingSelection calls.
1334         Store away a br at the position where we'll start inserting content in case the 
1335         br a) is made unnecessary by the insertion (it's collapsed away) b) was acting 
1336         as a placeholder and should therefore be displaced by inserted content or c) was
1337         acting as a line break and, as a result of the insertion, is now acting as a 
1338         placeholder.  
1339         Don't only store away brs that have the webkit-block-placeholder class on them.
1340         Any br that does any of the three things just mentioned should be removed.
1341         The linePlaceholder removal was run after the code that makes sure to interpret 
1342         incoming brs strictly, and was negating that work in certain cases.
1343         
1344         (WebCore::ReplaceSelectionCommand::removeEndBRIfNeeded): Described above.
1345         * editing/ReplaceSelectionCommand.h:
1346         * editing/VisiblePosition.cpp:
1347         (WebCore::isEqualIgnoringAffinity): 
1348         Added a workaround for 8622.  We want this function to return true even if one of 
1349         the two visible positions has been incorrectly canonicalized.
1350
1351 2006-04-26  Tim Omernick  <timo@apple.com>
1352
1353         Reviewed by Hyatt.
1354
1355         <rdar://problem/4068375> Flash inserted via innerHTML Fails to Show when CSS Display
1356         Style is Toggled via Javascript
1357
1358         * html/html_objectimpl.cpp:
1359         (WebCore::HTMLObjectElement::setComplete):
1360         Set needWidgetUpdate when finished parsing, even if the object element is not in
1361         a document.  That way, when the element attaches to a document, it will update its
1362         widget (creating the plug-in view if necessary).  This is important when the object
1363         is being inserted via setInnerHTML, since the parsed nodes are not added to the
1364         document until the whole HTML string is parsed.
1365
1366 2006-04-26  Geoffrey Garen  <ggaren@apple.com>
1367
1368         Reviewed by Hyatt.
1369
1370         - Fixed http://bugzilla.opendarwin.org/post_bug.cgi
1371         REGRESSION (r14048): Google calendar not parsing
1372         
1373         * html/HTMLParser.cpp:
1374         (WebCore::HTMLParser::handleError): Rolling out grandparent NULL check
1375         because it caused this regression and there's no test case
1376         justifying it.
1377         
1378 2006-04-26  Justin Garcia  <justin.garcia@apple.com>
1379
1380         Reviewed by hyatt
1381         
1382         <http://bugzilla.opendarwin.org/show_bug.cgi?id=8459>
1383         REGRESSION: Content lost during a delete/merge of whitespace:pre text
1384
1385         * editing/CompositeEditCommand.cpp:
1386         (WebCore::CompositeEditCommand::prune): 
1387         The function would prune a rendered leaf because it assumed that the 
1388         first node passed to it would be a container.
1389         The old code ascended using the DOM tree, and would remove the <b> when
1390         pruning the <div> in <b><div></div>foo</b>.  Now ascends using the render tree.
1391
1392 2006-04-26  Geoffrey Garen  <ggaren@apple.com>
1393
1394         This time for sure. Fixed Windows build too.
1395         
1396         * WebCore.vcproj/WebCore/WebCore.vcproj:
1397         * WebCore.xcodeproj/project.pbxproj:
1398
1399 2006-04-26  Geoffrey Garen  <ggaren@apple.com>
1400
1401         Reviewed by TimO.
1402
1403         Build fix.
1404
1405         * bindings/js/kjs_dom.cpp:
1406         * bindings/js/kjs_domnode.h:
1407
1408 2006-04-26  Geoffrey Garen  <ggaren@apple.com>
1409
1410         Reviewed by OMG DETHBAKIN.
1411
1412         - Start autogenerating Node. This fixes many missing attributes in our
1413         DOM by making prototypes hold their relevant constants as properties.
1414
1415         * DerivedSources.make:
1416         * WebCore.xcodeproj/project.pbxproj:
1417         * bindings/js/kjs_dom.cpp:
1418         (KJS::DOMEventTargetNode::DOMEventTargetNode):
1419         (KJS::toJS):
1420         * bindings/js/kjs_dom.h:
1421         (KJS::DOMEventTargetNode::):
1422         * bindings/js/kjs_domnode.h: Had to break DOMNode into a separate
1423         header to avoid circular dependency in header includes. Gave it an
1424         old-school file name to keep distinguishing beteween old school and
1425         news school files easy.
1426         (KJS::DOMNode::impl):
1427         (KJS::DOMNode::classInfo):
1428         (KJS::DOMNode::):
1429         * bindings/js/kjs_window.cpp:
1430         (KJS::Window::getValueProperty):
1431         * bindings/scripts/CodeGeneratorJS.pm:
1432         * dom/DocumentType.idl:
1433         * dom/Entity.idl:
1434         * dom/Node.idl: Added.
1435         * dom/Notation.idl:
1436         * dom/ProcessingInstruction.idl:
1437
1438 2006-04-26  Geoffrey Garen  <ggaren@apple.com>
1439
1440         Reviewed by Darin.
1441
1442         Committing the project file change jhaygood suggesed in
1443         http://bugzilla.opendarwin.org/show_bug.cgi?id=8044
1444         WebKit Visual Studio 2005 project shouldn't use the SolutionDir
1445         
1446         Instead of his patch, I used the following commands:
1447
1448         sed -e 's/$(SolutionDir)/$(ProjectDir)\\../g' Image\ Viewer/Image\
1449         Viewer.vcproj > Image\ Viewer/Image\ Viewer.vcproj_ && mv Image\
1450         Viewer/Image\ Viewer.vcproj_ Image\ Viewer/Image\ Viewer.vcproj
1451
1452         sed -e 's/$(SolutionDir)/$(ProjectDir)\\../g'
1453         WebCore/WebCore.vcproj > WebCore/WebCore.vcproj_ && mv
1454         WebCore/WebCore.vcproj_ WebCore/WebCore.vcproj
1455
1456         * Viewer.vcproj:
1457         * WebCore.vcproj/WebCore/WebCore.vcproj:
1458
1459 2006-04-25  Justin Garcia  <justin.garcia@apple.com>
1460
1461         Reviewed by harrison
1462
1463         <http://bugzilla.opendarwin.org/show_bug.cgi?id=8583>
1464         Moving paste code around and some small fixes
1465         
1466         Moved code to make it easier to do the start merge after the fact, 
1467         with moveParagraph, instead of in the middle of the paste operation.
1468
1469         * editing/CompositeEditCommand.cpp:
1470         (WebCore::CompositeEditCommand::moveParagraph):
1471         * editing/ReplaceSelectionCommand.cpp:
1472         (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
1473         (WebCore::ReplaceSelectionCommand::shouldMergeStart):
1474         Moved code to make this decision to its own function.  Moved special case
1475         checks to the top.  Added m_forceMergeStart to override the special cases 
1476         because moveParagraph uses ReplaceSelectionCommand and expects a merge.
1477         
1478         (WebCore::ReplaceSelectionCommand::shouldMergeEnd): 
1479         No functional changes, just moved code here.
1480         (WebCore::ReplaceSelectionCommand::doApply):
1481         Do the end merge in the opposite direction.  Merging two paragraphs destroys
1482         the moved one's block level styles, and we prefer to use the styles of the 
1483         one that was in the document, not the one that's being pasted.
1484         
1485         * editing/ReplaceSelectionCommand.h:
1486         * editing/Selection.h:
1487         (WebCore::Selection::visibleStart): Added.
1488         (WebCore::Selection::visibleEnd): Added.
1489         * editing/htmlediting.cpp:
1490         (WebCore::enclosingList): Added.
1491         (WebCore::isMailBlockquote): 
1492         Don't require a renderer so that this can be used on nodes in fragments.
1493         
1494         * editing/htmlediting.h:
1495
1496 2006-04-25  Geoffrey Garen  <ggaren@apple.com>
1497
1498         Reviewed by Maciej.
1499
1500         - Removed special handling of attributes in the DOM. To match
1501         WinIE, we used to make all attributes available as properties of
1502         their elements in the DOM, but that has caused us more
1503         compatibility woes than it has solved, so, after talking with Darin
1504         and Maciej, I'm taking it out. (Firefox does not support it.)
1505
1506         A layout test regression caused by this change led me to do the
1507         following as well:
1508         
1509         - Implemented DOM properties missing on EMBED elements: align, height,
1510         name, width, src, type. Since align, height, name, and width are
1511         common to all plugin elements, I factored them and some other common
1512         functionality out into a new abstract base class, HTMLPlugInElement.
1513
1514         - Removed extraneous attribute-to-style mappings on EMBED elements:
1515         valign, border. Why they were there in the first place is a question
1516         for the ages. Neither FF nor IE supports them.
1517
1518         * bindings/js/kjs_dom.cpp:
1519         (KJS::getRuntimeObject):
1520         * bindings/js/kjs_html.cpp:
1521         (KJS::):
1522         (KJS::JSHTMLElement::classInfo):
1523         (KJS::JSHTMLElement::accessors):
1524         (KJS::JSHTMLElement::embedGetter):
1525         (KJS::JSHTMLElement::embedSetter):
1526         * bindings/js/kjs_html.h:
1527         (KJS::JSHTMLElement::):
1528         * bindings/scripts/CodeGeneratorJS.pm:
1529         * dom/Element.idl:
1530         * html/html_objectimpl.cpp:
1531         (WebCore::HTMLPlugInElement::HTMLPlugInElement):
1532         (WebCore::HTMLPlugInElement::align):
1533         (WebCore::HTMLPlugInElement::setAlign):
1534         (WebCore::HTMLPlugInElement::height):
1535         (WebCore::HTMLPlugInElement::setHeight):
1536         (WebCore::HTMLPlugInElement::name):
1537         (WebCore::HTMLPlugInElement::setName):
1538         (WebCore::HTMLPlugInElement::width):
1539         (WebCore::HTMLPlugInElement::setWidth):
1540         (WebCore::HTMLPlugInElement::mapToEntry):
1541         (WebCore::HTMLPlugInElement::parseMappedAttribute):
1542         (WebCore::HTMLPlugInElement::checkDTD):
1543         (WebCore::HTMLAppletElement::HTMLAppletElement):
1544         (WebCore::HTMLAppletElement::~HTMLAppletElement):
1545         (WebCore::HTMLAppletElement::parseMappedAttribute):
1546         (WebCore::HTMLAppletElement::insertedIntoDocument):
1547         (WebCore::HTMLAppletElement::removedFromDocument):
1548         (WebCore::HTMLAppletElement::getInstance):
1549         (WebCore::HTMLAppletElement::closeRenderer):
1550         (WebCore::HTMLAppletElement::detach):
1551         (WebCore::HTMLEmbedElement::HTMLEmbedElement):
1552         (WebCore::HTMLEmbedElement::~HTMLEmbedElement):
1553         (WebCore::HTMLEmbedElement::getInstance):
1554         (WebCore::HTMLEmbedElement::mapToEntry):
1555         (WebCore::HTMLEmbedElement::parseMappedAttribute):
1556         (WebCore::HTMLEmbedElement::attach):
1557         (WebCore::HTMLEmbedElement::detach):
1558         (WebCore::HTMLEmbedElement::insertedIntoDocument):
1559         (WebCore::HTMLEmbedElement::removedFromDocument):
1560         (WebCore::HTMLEmbedElement::src):
1561         (WebCore::HTMLEmbedElement::setSrc):
1562         (WebCore::HTMLEmbedElement::type):
1563         (WebCore::HTMLEmbedElement::setType):
1564         (WebCore::HTMLObjectElement::HTMLObjectElement):
1565         (WebCore::HTMLObjectElement::~HTMLObjectElement):
1566         (WebCore::HTMLObjectElement::getInstance):
1567         (WebCore::HTMLObjectElement::parseMappedAttribute):
1568         (WebCore::HTMLObjectElement::rendererIsNeeded):
1569         (WebCore::HTMLObjectElement::attach):
1570         (WebCore::HTMLObjectElement::closeRenderer):
1571         (WebCore::HTMLObjectElement::detach):
1572         (WebCore::HTMLObjectElement::insertedIntoDocument):
1573         (WebCore::HTMLObjectElement::removedFromDocument):
1574         (WebCore::HTMLObjectElement::recalcStyle):
1575         * html/html_objectimpl.h:
1576         (WebCore::HTMLPlugInElement::endTagRequirement):
1577         (WebCore::HTMLAppletElement::tagPriority):
1578         (WebCore::HTMLEmbedElement::tagPriority):
1579         (WebCore::HTMLObjectElement::tagPriority):
1580
1581 2006-04-25  Beth Dakin  <bdakin@apple.com>
1582
1583         Reviewed by Maciej.
1584
1585         Fix for <rdar://problem/4518632> getComputedStyle returns 'auto' 
1586         for dimensions like 'margin-left'
1587
1588         * css/CSSComputedStyleDeclaration.cpp:
1589         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): For 
1590         margin and padding, to match Firefox we now go to the renderer to 
1591         get the property value instead of calling valueForLength() on the 
1592         style attribute. valueForLength() will return the string 'auto' if 
1593         that was what was specified in the CSS, or a percentage if it was 
1594         specified as a percent. But to match Firefox, we always want to 
1595         return a pixel value for margin and padding.
1596
1597 2006-04-26  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1598
1599         Reviewed by darin.  Landed by eseidel.
1600
1601         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8452
1602           mangleme(0x58c22e11): Random crashes
1603
1604         Test: fast/frames/empty-cols-attribute.html
1605
1606         * platform/StringImpl.cpp:
1607         (WebCore::StringImpl::toLengthArray): If the string is empty, return 0
1608         but set len to 1. This gives the same behavior you get if you don't specify
1609         the attribute at all, matching WinIE and Firefox. Previously, the empty
1610         string resulted in len being set to 0 (and a memory smasher in
1611         RenderFrameSet::layout()).
1612         * rendering/render_frames.cpp:
1613         (WebCore::RenderFrameSet::layout): Added an assert.
1614
1615 2006-04-26  Oliver Hunt  <ojh16@student.canterbury.ac.nz>
1616
1617         Reviewed by eseidel.  Landed by eseidel.
1618
1619         * WebCore.xcodeproj/project.pbxproj:
1620         * kcanvas/KCanvasFilters.cpp:
1621         (WebCore::operator<<):
1622         * kcanvas/KCanvasFilters.h:
1623         (WebCore::KCComponentTransferFunction::KCComponentTransferFunction):
1624         * kcanvas/device/quartz/KCanvasFilterQuartz.h:
1625         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
1626         (WebCore::getVectorForChannel):
1627         (WebCore::genImageFromTable):
1628         (WebCore::filterForComponentFunc):
1629         (WebCore::setParametersForComponentFunc):
1630         (WebCore::getFilterForFunc):
1631         (WebCore::KCanvasFEComponentTransferQuartz::getFunctionFilter):
1632         (WebCore::KCanvasFEComponentTransferQuartz::getCIFilter):
1633         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
1634         (WebCore::KRenderingDeviceQuartz::createFilterEffect):
1635         * kcanvas/device/quartz/filters/WKComponentMergeFilter.cikernel: Added.
1636         * kcanvas/device/quartz/filters/WKComponentMergeFilter.h: Added.
1637         * kcanvas/device/quartz/filters/WKComponentMergeFilter.m: Added.
1638         (+[WKComponentMergeFilter initialize]):
1639         (+[WKComponentMergeFilter filterWithName:]):
1640         (-[WKComponentMergeFilter init]):
1641         (-[WKComponentMergeFilter outputImage]):
1642         * kcanvas/device/quartz/filters/WKDiscreteTransferFilter.cikernel: Added.
1643         * kcanvas/device/quartz/filters/WKDiscreteTransferFilter.h: Added.
1644         * kcanvas/device/quartz/filters/WKDiscreteTransferFilter.m: Added.
1645         (+[WKDiscreteTransferFilter initialize]):
1646         (+[WKDiscreteTransferFilter filterWithName:]):
1647         (-[WKDiscreteTransferFilter init]):
1648         (-[WKDiscreteTransferFilter outputImage]):
1649         * kcanvas/device/quartz/filters/WKGammaTransferFilter.cikernel: Added.
1650         * kcanvas/device/quartz/filters/WKGammaTransferFilter.h: Added.
1651         * kcanvas/device/quartz/filters/WKGammaTransferFilter.m: Added.
1652         (+[WKGammaTransferFilter initialize]):
1653         (+[WKGammaTransferFilter filterWithName:]):
1654         (-[WKGammaTransferFilter init]):
1655         (-[WKGammaTransferFilter outputImage]):
1656         * kcanvas/device/quartz/filters/WKIdentityTransferFilter.h: Added.
1657         * kcanvas/device/quartz/filters/WKIdentityTransferFilter.m: Added.
1658         (+[WKIdentityTransferFilter initialize]):
1659         (+[WKIdentityTransferFilter filterWithName:]):
1660         (-[WKIdentityTransferFilter init]):
1661         (-[WKIdentityTransferFilter outputImage]):
1662         * kcanvas/device/quartz/filters/WKLinearTransferFilter.cikernel: Added.
1663         * kcanvas/device/quartz/filters/WKLinearTransferFilter.h: Added.
1664         * kcanvas/device/quartz/filters/WKLinearTransferFilter.m: Added.
1665         (+[WKLinearTransferFilter initialize]):
1666         (+[WKLinearTransferFilter filterWithName:]):
1667         (-[WKLinearTransferFilter init]):
1668         (-[WKLinearTransferFilter outputImage]):
1669         * kcanvas/device/quartz/filters/WKTableTransferFilter.cikernel: Added.
1670         * kcanvas/device/quartz/filters/WKTableTransferFilter.h: Added.
1671         * kcanvas/device/quartz/filters/WKTableTransferFilter.m: Added.
1672         (+[WKTableTransferFilter initialize]):
1673         (+[WKTableTransferFilter filterWithName:]):
1674         (-[WKTableTransferFilter init]):
1675         (-[WKTableTransferFilter outputImage]):
1676         * ksvg2/svg/SVGComponentTransferFunctionElement.cpp:
1677         (SVGComponentTransferFunctionElement::parseMappedAttribute):
1678         (SVGComponentTransferFunctionElement::transferFunction):
1679
1680 2006-04-25  Eric Seidel  <eseidel@apple.com>
1681
1682         Reviewed by ggaren.
1683
1684         Make trunk match the branch.  Now nodes are fully removed
1685         from the tree before calling detach.  There is (thankfully) no
1686         good way to test this, as no one should depend on this behavior.
1687         This change was made are part of fixing:
1688         <rdar://problem/4427024> repro crash on www.formassembly.com in khtml::RenderBlock::addChildToFlow
1689         <rdar://problem/4233435> CrashTracer: 2698 crashes in Safari at com.apple.WebCore: khtml::RenderBlock::addChildToFlow + 156
1690         on the branch.
1691
1692         * dom/ContainerNode.cpp:
1693         (WebCore::ContainerNode::removeChildren):
1694
1695 2006-04-25  Maciej Stachowiak  <mjs@apple.com>
1696
1697         Reviewed by Adele.
1698
1699         - don't have a fini method, since trying to call it will actually call the subclass method
1700         and mess up the bridge count.
1701
1702         * bridge/mac/WebCoreFrameBridge.mm:
1703         (-[WebCoreFrameBridge dealloc]):
1704         (-[WebCoreFrameBridge finalize]):
1705
1706 2006-04-25  Steve Falkenburg  <sfalkenburg@apple.com>
1707
1708         Reviewed by eseidel.
1709
1710         No test case needed
1711
1712         * platform/win/TemporaryLinkStubs.cpp:
1713         (KWQFileButton::setFrameGeometry):
1714
1715 2006-04-25  Eric Seidel  <eseidel@apple.com>
1716
1717         Reviewed by mjs.
1718
1719         Fix reproducible crash in html parser code.
1720         http://bugzilla.opendarwin.org/show_bug.cgi?id=7137
1721
1722         Test: fast/parser/remove-current-node-parent.html
1723
1724         * html/HTMLParser.cpp:
1725         (WebCore::HTMLParser::handleError):
1726
1727 2006-04-25  Maciej Stachowiak  <mjs@apple.com>
1728
1729         Reviewed by Eric.
1730
1731         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=8575
1732         New KWQFileButton leaks reported by buildbot
1733
1734         * kwq/KWQFileButton.mm:
1735         (KWQFileButton::KWQFileButton): Add a missing release
1736
1737 2006-04-24  David Hyatt  <hyatt@apple.com>
1738
1739         Fix for 8336, focus ring redrawing on top of itself.  Make sure
1740         not to include empty rects when doing the focus ring drawing, since
1741         that results in a draw with no clip set.
1742
1743         Reviewed by adele
1744
1745         * platform/mac/GraphicsContextMac.mm:
1746         (WebCore::GraphicsContext::drawFocusRing):
1747
1748 2006-04-24  Eric Seidel  <eseidel@apple.com>
1749
1750         Reviewed by ggaren.
1751
1752         Fix for 5th worst unresolved crasher:
1753         <rdar://problem/4129744> [REGRESSION]CrashTracer: ..400 crashes at com.apple.WebCore: DOM::NodeImpl::createRendererIfNeeded + 44
1754
1755         Test: fast/dom/remove-style-element.html
1756
1757         * dom/ContainerNode.cpp:
1758         (WebCore::ContainerNode::removeChildren):
1759
1760 2006-04-24  Eric Seidel  <eseidel@apple.com>
1761
1762         Reviewed by mjs.
1763
1764         Speculative fix for our 7th worst crasher.
1765         Also added ASSERTs to help us better understand the issue.
1766         <rdar://problem/4153404> CrashTracer: 2412 crashes in Safari at com.apple.WebCore: khtml::RenderStyle::RenderStyle[unified] + 44
1767
1768         * dom/Document.cpp:
1769         (WebCore::Document::recalcStyle):
1770         (WebCore::Document::setInPageCache):
1771         * dom/Document.h:
1772         * dom/Element.cpp:
1773         (WebCore::Element::recalcStyle):
1774
1775 2006-04-24  Adele Peterson  <adele@apple.com>
1776
1777         Reviewed by Hyatt.
1778
1779         Fix for <rdar://problem/4503438> REGRESSION (NativeTextField): Can't insert caret when 
1780         selection is active in field (Business/Unit)
1781
1782         * css/html4.css: Added -webkit-user-select:text for input elements.
1783
1784 2006-04-24  Maciej Stachowiak  <mjs@apple.com>
1785
1786         Build fix:
1787         
1788         - move some prematurely moved code back
1789
1790         * bridge/mac/WebCoreFrameBridge.h:
1791         * bridge/mac/WebCoreFrameBridge.mm:
1792         (-[WebCoreFrameBridge fini]):
1793
1794 2006-04-24  Maciej Stachowiak  <mjs@apple.com>
1795
1796         Reviewed by Darin.
1797
1798         - move more code from WebFrameBridge to WebCoreFrameBridge
1799
1800         * bridge/mac/WebCoreFrameBridge.h:
1801         * bridge/mac/WebCoreFrameBridge.mm:
1802         (-[WebCoreFrameBridge domain]):
1803         (-[WebCoreFrameBridge canTargetLoadInFrame:]):
1804         (-[WebCoreFrameBridge fini]):
1805         (-[WebCoreFrameBridge dealloc]):
1806         (-[WebCoreFrameBridge finalize]):
1807         (_getPreSmartSet):
1808         (_getPostSmartSet):
1809         (-[WebCoreFrameBridge isCharacterSmartReplaceExempt:isPreviousCharacter:]):
1810         (-[WebCoreFrameBridge _retrieveKeyboardUIModeFromPreferences:]):
1811         (-[WebCoreFrameBridge keyboardUIMode]):
1812
1813 2006-04-24  Adele Peterson  <adele@apple.com>
1814
1815         Reviewed by Tim O.
1816
1817         Fix to send textFieldDidBeginEditing on the first editing change instead of on focus.
1818         This matches our old behavior.
1819
1820         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::dispatchFocusEvent):
1821         * rendering/RenderTextField.cpp: (WebCore::RenderTextField::subtreeHasChanged):
1822
1823 2006-04-24  Beth Dakin  <bdakin@apple.com>
1824
1825         Reviewed by Eric.
1826
1827         Fix for <rdar://problem/4513383> REGRESSION: Crash in 
1828         WebCore::shouldEmitTabBeforeNode() when iterating through document 
1829         text
1830
1831         * editing/TextIterator.cpp:
1832         (WebCore::shouldEmitTabBeforeNode): Need to nil-check the renderer.
1833
1834 2006-04-23  Geoffrey Garen  <ggaren@apple.com>
1835
1836         Reviewed by Maciej.
1837
1838         * bindings/scripts/CodeGeneratorJS.pm: Removed confusing 'JS' prefix
1839         from string descriptions of DOM prototypes, so the prototype for, e.g.,
1840         Document serializes as 'Document,' not 'JSDocument.'
1841
1842 2006-04-23  Geoffrey Garen  <ggaren@apple.com>
1843
1844         Reviewed by Darin.
1845
1846         - Took the larger snippets of C++ in the code generator and broke
1847         them into HERE documents in the hopes of improving readability.
1848         
1849         * bindings/scripts/CodeGeneratorJS.pm: I indented variable names
1850         level with their corresponding HERE documents to clearly
1851         "sandwich" the HERE documents between opening and closing EOF
1852         statements.
1853
1854 2006-04-23  Maciej Stachowiak  <mjs@apple.com>
1855
1856         Reviewed by Darin.
1857         
1858         - push WebFileButton and WebStringTruncator code down to WebCore
1859         http://bugzilla.opendarwin.org/show_bug.cgi?id=8552
1860
1861         * WebCore.exp:
1862         * WebCore.xcodeproj/project.pbxproj:
1863         * bridge/mac/WebCoreFrameBridge.h:
1864         * bridge/mac/WebCoreStringTruncator.h: Added.
1865         * bridge/mac/WebCoreStringTruncator.mm: Added.
1866         (stringWidth):
1867         (truncateString):
1868         (+[WebCoreStringTruncator widthOfString:font:]):
1869         * bridge/mac/WebCoreViewFactory.h:
1870         * kwq/KWQFileButton.h:
1871         * kwq/KWQFileButton.mm:
1872         (-[WebFileChooserButton initWithWidget::]):
1873         (-[WebCoreFileButton positionButton]):
1874         (-[WebCoreFileButton initWithWidget:]):
1875         (-[WebCoreFileButton initWithFrame:]):
1876         (-[WebCoreFileButton dealloc]):
1877         (-[WebCoreFileButton isFlipped]):
1878         (-[WebCoreFileButton drawRect:]):
1879         (-[WebCoreFileButton updateLabel]):
1880         (-[WebCoreFileButton setFilename:]):
1881         (-[WebCoreFileButton filename]):
1882         (-[WebCoreFileButton setFrameSize:]):
1883         (-[WebCoreFileButton bestVisualFrameSizeForCharacterCount:]):
1884         (-[WebCoreFileButton visualFrame]):
1885         (-[WebCoreFileButton setVisualFrame:]):
1886         (-[WebCoreFileButton baseline]):
1887         (-[WebCoreFileButton beginSheet]):
1888         (-[WebCoreFileButton chooseFilename:]):
1889         (-[WebCoreFileButton cancel]):
1890         (-[WebCoreFileButton chooseButtonPressed:]):
1891         (-[WebCoreFileButton mouseDown:]):
1892         (-[WebCoreFileButton acceptsFirstResponder]):
1893         (-[WebCoreFileButton becomeFirstResponder]):
1894         (-[WebCoreFileButton nextKeyView]):
1895         (-[WebCoreFileButton previousKeyView]):
1896         (-[WebCoreFileButton nextValidKeyView]):
1897         (-[WebCoreFileButton previousValidKeyView]):
1898         (-[WebCoreFileButton performClick]):
1899         (-[WebFileChooserButton initWithWidget:]):
1900         (-[WebFileChooserButton nextValidKeyView]):
1901         (-[WebFileChooserButton previousValidKeyView]):
1902         (-[WebFileChooserButton resignFirstResponder]):
1903         (KWQFileButton::KWQFileButton):
1904         (KWQFileButton::setFilename):
1905         (KWQFileButton::click):
1906         (KWQFileButton::sizeForCharacterWidth):
1907         (KWQFileButton::frameGeometry):
1908         (KWQFileButton::setFrameGeometry):
1909         (KWQFileButton::baselinePosition):
1910         (KWQFileButton::filenameChanged):
1911
1912 2006-04-23  Maciej Stachowiak  <mjs@apple.com>
1913
1914         Reviewed by Eric.
1915
1916         - remove WebCoreCookieAdapter, instead make mac implementation of
1917         CookieJar use Foundation directly.
1918
1919         * WebCore.exp:
1920         * WebCore.xcodeproj/project.pbxproj:
1921         * platform/mac/CookieJar.mm:
1922         (WebCore::cookies):
1923         (WebCore::setCookies):
1924         (WebCore::cookiesEnabled):
1925         * platform/mac/WebCoreCookieAdapter.h: Removed.
1926         * platform/mac/WebCoreCookieAdapter.m: Removed.
1927
1928 2006-04-21  Rob Buis  <buis@kde.org>
1929
1930         Reviewed by hyatt.  Landed by eseidel.
1931
1932         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8170:
1933         SVG CSS property values with extra items do not get treated
1934         as invalid (they should)
1935
1936         Fixes the handling of invalid svg css properties similar
1937         to how invalid html css properties are handled, ie. discard
1938         the property if there are more values in the value list than
1939         expected.
1940
1941         Test: svg/custom/invalid-css.svg
1942
1943         * ksvg2/css/SVGCSSParser.cpp:
1944         (WebCore::CSSParser::parseSVGValue):
1945
1946 2006-04-23  Michael Emmel  <mike.emmel@gmail.com>
1947
1948         Reviewed by mjs.  Landed by eseidel.
1949
1950         http://bugzilla.opendarwin.org/show_bug.cgi?id=8517
1951         No test necessary, no functional change.
1952
1953         * DerivedSources.make: use VPATH more consistently.
1954
1955 2006-04-23  Jon Shier  <jshier@iastate.edu>
1956         
1957         Reviewed by ggaren.  Landed by eseidel.
1958         
1959         - Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8511
1960         onerror JS property does not register listener properly
1961
1962         Test: fast/dom/onerror-img.html       
1963  
1964         * bindings/js/kjs_dom.cpp:  
1965         (KJS::DOMEventTargetNode::getValueProperty): changed khtmlErrorEvent to errorEvent.
1966         (KJS::DOMEventTargetNode::putValueProperty): ditto.
1967         * bindings/js/kjs_window.cpp:
1968         (KJS::Window::getValueProperty): ditto.
1969         (KJS::Window::put):
1970         * dom/EventNames.h: Removed khtmlError macro.
1971         
1972 2006-04-23  Eric Seidel  <eseidel@apple.com>
1973
1974         Reviewed by hyatt.
1975
1976         Reproducible crasher with <li value=1234567890 type=A>
1977         http://bugzilla.opendarwin.org/show_bug.cgi?id=8542
1978
1979         Fixed our alphabetical list generation to match WinIE (not FireFox)
1980         Previously our alphabetical lists were completely wrong past 26 items.
1981
1982         Tests:
1983         * fast/lists/alpha-list-wrap.html
1984         * fast/lists/li-style-alpha-huge-value-crash.html
1985
1986         * rendering/render_list.cpp:
1987         (WebCore::toLetterString):
1988         (WebCore::toHebrew):
1989         (WebCore::RenderListMarker::calcMinMaxWidth):
1990
1991 2006-04-22  Geoffrey Garen  <ggaren@apple.com>
1992
1993         Reviewed by Darin.
1994
1995         - Finished autogeneration of Element
1996
1997         * bindings/js/kjs_dom.cpp: Removed DOMElement class
1998         * bindings/js/kjs_dom.h: ditto
1999         * bindings/scripts/CodeGeneratorJS.pm: added support for special
2000         attribute lookup that elements do
2001         * dom/Element.idl: added new attribute, 
2002         "IncludeAttributesInPropertyLookup," which tells the code generator 
2003         to include HTML element attributes in property lookup
2004
2005 2006-04-22  Michael Emmel  <mike.emmel@gmail.com>
2006
2007         Reviewed by Maciej.
2008
2009         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8529
2010           Extra Qaulification in header
2011         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8530
2012           Missing assert.h include
2013
2014         * rendering/RenderObject.h: Removed erroneous RenderObject::
2015         prefix from a member function name.
2016         * rendering/RenderText.h: Removed erroneous RenderText::
2017         prefix from a member function name.
2018
2019         * platform/Arena.cpp: Added <assert.h> to list of includes.
2020         * platform/KURL.cpp: Ditto.
2021         * platform/StringImpl.cpp: Ditto.
2022         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: Ditto.
2023         * platform/image-decoders/png/PNGImageDecoder.cpp: Ditto.
2024
2025 2006-04-22  Darin Adler  <darin@apple.com>
2026
2027         * doc: Added.
2028
2029 2006-04-22  Maciej Stachowiak  <mjs@apple.com>
2030
2031         Reviewed by Eric.
2032
2033         - push down a bunch of WebCoreFrameBridge code to C++ (plus some reformatting)
2034
2035         * bridge/mac/WebCoreFrameBridge.mm:
2036         (-[WebCoreFrameBridge isDescendantOfFrame:]):
2037         (-[WebCoreFrameBridge traverseNextFrameStayWithin:]):
2038         (-[WebCoreFrameBridge nextFrameWithWrap:]):
2039         (-[WebCoreFrameBridge previousFrameWithWrap:]):
2040         (+[WebCoreFrameBridge bridgeForDOMDocument:]):
2041         (-[WebCoreFrameBridge parent]):
2042         (-[WebCoreFrameBridge addData:]):
2043         (-[WebCoreFrameBridge didNotOpenURL:pageCache:]):
2044         (-[WebCoreFrameBridge restoreDocumentState]):
2045         (-[WebCoreFrameBridge _stringWithDocumentTypeStringAndMarkupString:]):
2046         (-[WebCoreFrameBridge nodesFromList:]):
2047         (-[WebCoreFrameBridge markupStringFromNode:nodes:]):
2048         (-[WebCoreFrameBridge markupStringFromRange:nodes:]):
2049         (-[WebCoreFrameBridge rangeByExpandingSelectionWithGranularity:]):
2050         (-[WebCoreFrameBridge rangeByAlteringCurrentSelection:direction:granularity:]):
2051         (-[WebCoreFrameBridge alterCurrentSelection:direction:granularity:]):
2052         (-[WebCoreFrameBridge rangeByAlteringCurrentSelection:verticalDistance:]):
2053         (-[WebCoreFrameBridge alterCurrentSelection:verticalDistance:]):
2054         (-[WebCoreFrameBridge replaceMarkedTextWithText:]):
2055         (-[WebCoreFrameBridge replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]):
2056         (-[WebCoreFrameBridge increaseSelectionListLevel]):
2057         (-[WebCoreFrameBridge decreaseSelectionListLevel]):
2058         (-[WebCoreFrameBridge insertLineBreak]):
2059         (-[WebCoreFrameBridge insertParagraphSeparator]):
2060         (-[WebCoreFrameBridge insertParagraphSeparatorInQuotedContent]):
2061         (-[WebCoreFrameBridge insertText:selectInsertedText:]):
2062         (-[WebCoreFrameBridge deleteSelectionWithSmartDelete:]):
2063         (-[WebCoreFrameBridge ensureSelectionVisible]):
2064         (-[WebCoreFrameBridge RenderObject::nodeInfoAtPoint:allowShadowContent:]):
2065         * page/Frame.cpp:
2066         (WebCore::Frame::nodeInfoAtPoint):
2067         (WebCore::Frame::hasSelection):
2068         (WebCore::Frame::documentTypeString):
2069         * page/Frame.h:
2070         * page/FrameTree.cpp:
2071         (WebCore::FrameTree::traverseNextWithWrap):
2072         (WebCore::FrameTree::traversePreviousWithWrap):
2073         (WebCore::FrameTree::deepLastChild):
2074         * page/FrameTree.h:
2075
2076 2006-04-22  Beth Dakin  <bdakin@apple.com>
2077
2078         Reviewed by Hyatt.
2079
2080         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=6141 
2081         DOMCSSPrimitiveValue is always returning values in pixels when 
2082         using getComputedStyle:
2083
2084         getFloatValue() took a unit type as a parameter, ignored it, and 
2085         returned m_value.num. This patch writes a second version of the 
2086         function that actually converts m_value.num to the specified unites 
2087         before returning it. Where a conversion is not required, I removed 
2088         the unit type from the caller so that it would go directly to the 
2089         inline version of the function.
2090
2091         * css/css_valueimpl.cpp:
2092         (WebCore::CSSPrimitiveValue::computeLengthFloat): Remove type 
2093         parameter since a conversion is not needed.
2094         (WebCore::scaleFactorForConversion): Helper function for 
2095         conversion.
2096         (WebCore::CSSPrimitiveValue::getFloatValue): This version of 
2097         getFloatValue() takes a unit type parameter and converts 
2098         m_value.num.
2099         * css/css_valueimpl.h:
2100         (WebCore::CSSPrimitiveValue::getFloatValue): This version does not 
2101         take a parameter and just returns m_value.num.
2102         * css/cssparser.cpp:
2103         (WebCore::BorderImageParseContext::commitBorderImage): Remove type 
2104         parameter since a conversion is not needed.
2105         * css/cssstyleselector.cpp:
2106         (WebCore::convertToLength): Same.
2107         (WebCore::CSSStyleSelector::applyProperty): Same.
2108         (WebCore::CSSStyleSelector::mapBackgroundSize): Same.
2109         (WebCore::CSSStyleSelector::mapBackgroundXPosition): Same.
2110         (WebCore::CSSStyleSelector::mapBackgroundYPosition): Same.
2111         * editing/ApplyStyleCommand.cpp:
2112         (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange): Same.
2113         * ksvg2/css/SVGCSSStyleSelector.cpp:
2114         (WebCore::CSSStyleSelector::applySVGProperty): Same.
2115         * ksvg2/misc/KCanvasRenderingStyle.cpp:
2116         (WebCore::KSVGPainterFactory::cssPrimitiveToLength): Same.
2117
2118 2006-04-21  Geoffrey Garen  <ggaren@apple.com>
2119
2120         Reviewed by John.
2121
2122         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=8509
2123         javascript:document.importNode(null)
2124         
2125         * dom/Document.cpp:
2126         (WebCore::Document::importNode): Throw an error if the node is null.
2127         This happens when the object provided in the JavaScript call is not
2128         a node.
2129         (WebCore::Document::adoptNode): Set the DOM exception code in all error
2130         cases instead of just a few, because that's what the spec requires.
2131
2132 2006-04-21  Geoffrey Garen  <ggaren@apple.com>
2133
2134         Reviewed by John.
2135
2136         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=8510
2137         submit event doesn't bubble - it's supposed to.
2138
2139         * html/HTMLElement.cpp:
2140         (WebCore::HTMLElement::parseMappedAttribute): Added recognition for the
2141         onsubmit attribute, so elements can use it
2142         * html/HTMLFormElement.cpp:
2143         (WebCore::HTMLFormElement::prepareSubmit): Changed bubbling attribute
2144         to 'true'
2145
2146 2006-04-21  Geoffrey Garen  <ggaren@apple.com>
2147
2148         Reviewed by TimO.
2149
2150         - Fixed: error event does not bubble
2151
2152         I discovered this bug while working on the "submit event does not
2153         bubble" bug. The DOM spec says the event should bubble, and that's how
2154         it works in Firefox.
2155
2156         The DOM Spec also says that the error event is "valid for
2157         OBJECT elements, BODY elements, and FRAMESET element." But it doesn't
2158         say "valid ONLY." Firefox supports it on all elements and web
2159         developers tend to think it will work for things like <img> and
2160         <script>, so I went whole hog here.
2161
2162         * html/HTMLElement.cpp:
2163         (WebCore::HTMLElement::parseMappedAttribute): Make onerror a mapped
2164         attribute for all elements, so containing elements can register for
2165         the event.
2166         * html/HTMLTokenizer.cpp:
2167         (WebCore::HTMLTokenizer::notifyFinished): make onerror bubble
2168         * html/html_headimpl.cpp:
2169         (WebCore::HTMLScriptElement::parseMappedAttribute): Remove special
2170         case for onerror because HTMLElement will take care of it
2171         (WebCore::HTMLScriptElement::notifyFinished): make onerror bubble
2172         * html/html_imageimpl.cpp:
2173         (WebCore::HTMLImageElement::parseMappedAttribute): Remove special
2174         case for onerror because HTMLElement will take care of it
2175
2176 2006-04-21  Adele Peterson  <adele@apple.com>
2177
2178         Test for: http://bugzilla.opendarwin.org/show_bug.cgi?id=8181
2179         REGRESSION: After tabbing in page's field, attempting to tab from Google toolbar search to page fails on first try
2180
2181         * manual-tests/tabbing-input-google.html: Added.
2182
2183 2006-04-21  Kevin M. Ollivier  <kevino@theolliviers.com>
2184
2185         Reviewed by Darin.
2186
2187         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8507
2188           Compilation fixes for building on gcc 4.0.2, and without precomp headers
2189
2190         * platform/Cursor.h: Created a fallback case that typedefs PlatformCursor
2191         to void * if it isn't defined to anything else. (Useful to help get new ports
2192         initially compiling.)
2193         
2194         * bindings/js/kjs_window.cpp:
2195         * rendering/RenderTextField.cpp:
2196         * rendering/RenderBox.cpp:
2197         Add missing headers to resolve issues when compiling without precompiled
2198         headers.
2199         
2200         * rendering/RenderText.h: Declare the InlineTextBox class before 
2201         friend declaration to resolve compilation issues with gcc 4.0.2.
2202         
2203 2006-04-21  Adele Peterson  <adele@apple.com>
2204
2205         Reviewed by Darin.
2206
2207         Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=8213
2208         REGRESSION: Can't tab out of text field if iframe comes after it
2209
2210         Test: fast/forms/tabbing-input-iframe.html
2211
2212         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::nextKeyViewInFrame):
2213           If the next focusable node is a RenderWidget without a view, then continue in the loop.  We used to break out in this case. 
2214           I also made some formatting changes and reorganized the function to make it easier to read.
2215
2216 2006-04-21  Adele Peterson  <adele@apple.com>
2217
2218         Reviewed by Beth.
2219
2220         Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=8496
2221         REGRESSION: Dragging to select text around a text field causes the text field to scroll.
2222
2223         Test: manual-tests/text-field-autoscroll.html
2224
2225         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::handleMouseMoveEvent): Start the frame's autoscroll timer
2226         even when we're calling over the bridge to handle the autoscroll.
2227         * page/Frame.cpp: (WebCore::Frame::stopAutoscrollTimer): Clear out pointer to layer.
2228
2229 2006-04-21  Geoffrey Garen  <ggaren@apple.com>
2230
2231         - And again.
2232
2233         * WebCore.vcproj/WebCore/WebCore.vcproj:
2234
2235 2006-04-21  Geoffrey Garen  <ggaren@apple.com>
2236
2237         - Futile attempt to fix Windows build.
2238         
2239         * WebCore.vcproj/WebCore/WebCore.vcproj:
2240
2241 2006-04-20  Geoffrey Garen  <ggaren@apple.com>
2242
2243         Reviewed by Maciej.
2244
2245         - Added autogeneration of JS bindings for CSSRule, CSSValue,
2246         Event, and NodeFilter.  
2247
2248         - Made related prototype objects hold the relevant constants, to
2249         match Mozilla and the DOM 2 spec. (Previously, only the related
2250         constructor objects held those constants, in accordance with the
2251         DOM 3 spec.)
2252
2253         - Fixed up remaining Windows build issues.
2254
2255         * DerivedSources.make: Added new autogenerated files
2256         * WebCore.xcodeproj/project.pbxproj: ditto
2257         * bindings/js/kjs_css.cpp:
2258         (KJS::DOMCSSRule::classInfo):
2259         (KJS::DOMCSSRule::getOwnPropertySlot): scope call to classInfo()
2260         because it's virtual and DOMCSSRule has a derrived class now.
2261         (KJS::DOMCSSRule::put): ditto
2262         (KJS::DOMCSSRuleFunc::callAsFunction):
2263         (KJS::toJS):
2264         * bindings/js/kjs_css.h:
2265         * bindings/js/kjs_events.cpp:
2266         (KJS::toJS):
2267         * bindings/js/kjs_events.h:
2268         * bindings/js/kjs_html.cpp:
2269         (KJS::OptionConstructorImp::OptionConstructorImp):
2270         * bindings/js/kjs_traversal.cpp:
2271         (KJS::toJS):
2272         * bindings/js/kjs_traversal.h:
2273         * bindings/js/kjs_window.cpp: 
2274         (KJS::Window::getValueProperty): added CSSValue global object
2275         * bindings/js/kjs_window.h:
2276         (KJS::Window::):
2277         * bindings/scripts/CodeGeneratorJS.pm: Changed generator to write
2278         constants to prototype objects (previously only wrote constants to
2279         constructor objects)
2280         * css/CSSPrimitiveValue.idl: Removed LegacyParent since CSSValue now
2281         exists in IDL
2282         * css/CSSRule.idl: Added.
2283         * css/CSSValue.idl: Added.
2284         * css/css_ruleimpl.h:
2285         (WebCore::CSSRule::):
2286         * css/css_valueimpl.h:
2287         * dom/Event.idl: Added.
2288         * dom/MutationEvent.idl: Removed LegacyParent since Event now exists
2289         in IDL
2290         * dom/NodeFilter.idl: Added.
2291         * dom/UIEvent.idl: Removed LegacyParent since event now exists in IDL
2292         * dom/dom2_eventsimpl.h:
2293         (WebCore::Event::):
2294
2295 2006-04-21  Darin Adler  <darin@apple.com>
2296
2297         - one more attempt to fix Windows build
2298
2299         * platform/cairo/GraphicsContextCairo.cpp:
2300         (WebCore::GraphicsContext::fillRect): Update to use Color and match
2301         the similar function on GraphicsContextMac.
2302
2303 2006-04-21  Beth Dakin  <bdakin@apple.com>
2304
2305         Reviewed by Hyatt.
2306
2307         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8495 
2308         REGRESSION: Sidebar on cnn.com is hosed
2309
2310         * platform/mac/ImageMac.mm:
2311         (WebCore::Image::drawTiled): Use the size of the destination rect, 
2312         not the oneTileRect in the no-pattern case.
2313         * rendering/RenderBox.cpp:
2314         (WebCore::RenderBox::paintBackgroundExtended): Initialize 
2315         scaledWidth and scaledHeight to the appropriate value (was wrong in 
2316         scroll case), adjust position at appropriate times, and take out 
2317         no-repeat clause for now since we don't have enough test cases yet 
2318         to be sure we won't cause massive regressions. 
2319
2320 2006-04-21  Darin Adler  <darin@apple.com>
2321
2322         - attempt to fix Windows build after my last check-in
2323
2324         * WebCore.vcproj/Image Viewer/ImageView.cpp: Changed calls to use the
2325         new IntRect-based API.
2326
2327         * html/CanvasPattern.cpp: (WebCore::CanvasPattern::CanvasPattern):
2328         Put appropriate ifdefs around the m_platformImage initializer.
2329
2330         * page/Frame.cpp: Make Frame::adjustPageHeight Mac-OS-X-only for now
2331         since it's used for printing and we don't have printing going on any
2332         other platforms yet.
2333
2334         * platform/cairo/GraphicsContextCairo.cpp: Take out constructor that
2335         takes only the "for printing" boolean for now.
2336
2337         * platform/cairo/ImageCairo.cpp: Include the GraphicsContext.h header.
2338
2339         * platform/win/TemporaryLinkStubs.cpp: (GraphicsContext::setShadow):
2340         Fix up this stub and remove the GraphicsContext empty constructor stub.
2341
2342 2006-04-21  Darin Adler  <darin@apple.com>
2343
2344         - fix build
2345
2346         * WebCore.xcodeproj/project.pbxproj: Replaced absolute path on my system
2347         with a build-result-relative path; also removed some source files from the
2348         list of resources to install!
2349
2350 2006-04-20  Darin Adler  <darin@apple.com>
2351
2352         Reviewed by Hyatt.
2353
2354         - make <canvas> element and related API behave more like the draft of
2355           the WhatWG Web Application specification, checking parameter validity
2356           and raising exceptions
2357         - changed HTMLCanvasElement bindings to be auto-generated, fixing all
2358           issues so we can generate bindings for classes drived from HTMLElement
2359         - change GraphicsContext API to use IntRect/Point/Size in more cases
2360         - change GraphicsContext so it is closer to truly wrapping a graphics
2361           context rather than representing the current NSGraphicsContext; there
2362           are still some things like text and rectangle fills that are tied to
2363           NSGraphicsContext, but we're most of the way there
2364         - removed Brush class since it just amounted to a color, using an RGBA32
2365           instead where we used to use a Brush
2366
2367         * DerivedSources.make: Added JSHTMLCanvasElement.h.
2368         * WebCore.xcodeproj/project.pbxproj: Added new files.
2369
2370         * bindings/js/JSCanvasRenderingContext2DBase.h: Added toJS.
2371         * bindings/js/JSCanvasRenderingContext2DBase.cpp:
2372         (WebCore::JSCanvasRenderingContext2DBaseProtoFunc::callAsFunction):
2373         Added exception code handling for strokeRect, drawImage, and createPattern.
2374         Added version of createPattern that takes a canvas. Use TYPE_MISMATCH_ERR
2375         instead of JavaScript TypeError when parameter is neither an image or canvas
2376         element. Adapt for new HTMLCanvasElement binding.
2377         (WebCore::toJS): Added. Converts context object to JS wrapper.
2378
2379         * bindings/js/JSHTMLElementWrapperFactory.h: Added.
2380         * bindings/js/JSHTMLElementWrapperFactory.cpp: Added. Creates a JavaScript
2381         wrapper for an arbitrary HTML element. Better than putting this all in the
2382         DOM node class toJS function.
2383
2384         * bindings/js/JSXMLSerializer.cpp: Tweaked to make it build.
2385         * bindings/js/kjs_dom.cpp: (KJS::toJS): Changed to call the
2386         JSHTMLElementWrapperFactory function createJSWrapper, instead
2387         of always creating a JSHTMLElement.
2388
2389         * bindings/js/kjs_html.h: Removed canvas-related stuff. Added HTMLElement
2390         prototype.
2391         * bindings/js/kjs_html.cpp:
2392         (KJS::JSHTMLElement::classInfo): Removed canvas element.
2393         (KJS::JSHTMLElement::accessors): Ditto.
2394         (KJS::JSHTMLElementProtoFunc::callAsFunction): Added, to help the auto-binding
2395         machiner cope with HTMLElement.
2396         (KJS::HTMLElementFunction::callAsFunction): Removed canvas element.
2397
2398         * bindings/scripts/CodeGeneratorJS.pm: Added types needed for HTMLCanvasElement.
2399
2400         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::setDisplaysWithFocusAttributes):
2401         Changed to create a GraphicsContext with the new constructor that takes
2402         a CGContextRef.
2403         * bridge/mac/WebCoreFrameBridge.mm: (-[WebCoreFrameBridge drawRect:]):
2404         Changed to create a GraphicsContext with the new constructor that takes
2405         a NSGraphicsContext.
2406         * page/Frame.cpp: (WebCore::Frame::adjustPageHeight): Changed to create a
2407         GraphicsContext with the new constructor that takes a CGContextRef.
2408
2409         * editing/SelectionController.cpp: (WebCore::SelectionController::paintCaret):
2410         Eliminated a use of obsolete class Brush.
2411
2412         * html/CanvasPattern.h:
2413         * html/CanvasPattern.cpp:
2414         (WebCore::CanvasPattern::parseRepetitionType): Added. Parses a repetition
2415         type. Different from the old logic in that it is case-sensitive and rejects
2416         anything other than null, empty string, or the four repeat types.
2417         (WebCore::CanvasPattern::CanvasPattern): Added constructor that takes
2418         a CGImageRef. Changed constructor to take two booleans instead of the repetition
2419         type string. It's the caller's responsibility to parse the string.
2420         (WebCore::CanvasPattern::~CanvasPattern): Release the CGImage.
2421         (WebCore::patternCallback): Handle the CGImage case. Also changed the code
2422         to create a GraphicsContext as needed and call the image drawing code with that.
2423         (WebCore::CanvasPattern::createPattern): Handle both the image element case and
2424         the canvas element case.
2425         
2426         * html/CanvasRenderingContext2D.h:
2427         * html/CanvasRenderingContext2D.cpp:
2428         (WebCore::CanvasRenderingContext2D::State::State): Change line cap, line join,
2429         and global composite to store enum values instead of strings.
2430         (WebCore::CanvasRenderingContext2D::setLineWidth): Do nothing if width is NaN
2431         or <= 0.
2432         (WebCore::CanvasRenderingContext2D::lineCap): Return a string based on a
2433         stored enum, rather than returning a stored string.
2434         (WebCore::CanvasRenderingContext2D::setLineCap): Do nothing if the string is
2435         not one of the standard line cap types. Also case sensitive and stores enum
2436         rather than the string.
2437         (WebCore::CanvasRenderingContext2D::lineJoin): Return a string based on a
2438         stored enum, rather than returning a stored string.
2439         (WebCore::CanvasRenderingContext2D::setLineJoin): Do nothing if the string is
2440         not one of the standard line join types. Also case sensitive and stores enum
2441         rather than the string.
2442         (WebCore::CanvasRenderingContext2D::setMiterLimit): Do nothing if limit is NaN
2443         or <= 0.
2444         (WebCore::CanvasRenderingContext2D::setGlobalAlpha): Do nothing if alpha is NaN
2445         or < 0 or > 1.
2446         (WebCore::CanvasRenderingContext2D::globalCompositeOperation): Return a string
2447         based on a stored enum, rather than returning a stored string.
2448         (WebCore::CanvasRenderingContext2D::setGlobalCompositeOperation): Do nothing if
2449         the string is not one of the standard compositing modes. Also case sensitive and
2450         stores enum rather than the string.
2451         (WebCore::CanvasRenderingContext2D::arcTo): Generate INDEX_SIZE_ERR exception
2452         if radius is NaN or <= 0.
2453         (WebCore::CanvasRenderingContext2D::arc): Ditto.
2454         (WebCore::CanvasRenderingContext2D::rect): Generate INDEX_SIZE_ERR exception
2455         if width or height is NaN or <= 0.
2456         (WebCore::CanvasRenderingContext2D::clearRect): Ditto.
2457         (WebCore::CanvasRenderingContext2D::fillRect): Ditto.
2458         (WebCore::CanvasRenderingContext2D::strokeRect): Ditto, same for line width.
2459         Changed the case where the line width is not specified to share code with the
2460         case where it is.
2461         (WebCore::size): Renamed from imageSize, since C++ overloads based on parameter
2462         types anyway.
2463         (WebCore::CanvasRenderingContext2D::drawImage): Generate INDEX_SIZE_ERR exception
2464         if the source rect is not entirely inside the image rect, or if the width or height
2465         of either the source or destination rect is NaN or <= 0. Changed image drawing
2466         code to be platform-independent for the image element case, but not yet for the
2467         canvas case.
2468         (WebCore::CanvasRenderingContext2D::drawImageFromRect): Change code to parse the
2469         composite operation to use the new code shared with Image.
2470         (WebCore::CanvasRenderingContext2D::createPattern): Added code to parse the
2471         repetition type separately before creating the pattern. Added an overload for
2472         canvas elements.
2473         (WebCore::CanvasRenderingContext2D::drawingContext): Changed to return a
2474         GraphicsContext*.
2475         (WebCore::CanvasRenderingContext2D::platformContext): Added. Now does what
2476         drawingContext used to do.
2477
2478         * html/CanvasRenderingContext2D.idl: Added exception declarations as needed
2479         for changes above.
2480
2481         * html/HTMLCanvasElement.h:
2482         * html/HTMLCanvasElement.cpp:
2483         (WebCore::HTMLCanvasElement::HTMLCanvasElement): Changed m_drawingContext
2484         to be a GraphicsContext instead of a CGContextRef.
2485         (WebCore::HTMLCanvasElement::~HTMLCanvasElement): Ditto.
2486         (WebCore::HTMLCanvasElement::getContext): Removed special cases for null
2487         and empty string. Only give a 2D graphics context if the string is "2d".
2488         (WebCore::HTMLCanvasElement::reset): Updated for change to GraphicsContext
2489         from CGContextRef.
2490         (WebCore::HTMLCanvasElement::paint): Ditto.
2491         (WebCore::HTMLCanvasElement::createDrawingContext): Changed to create a
2492         GraphicsContext* instead of a CGContextRef.
2493         (WebCore::HTMLCanvasElement::drawingContext): Changed to return a
2494         GraphicsContext* instead of a CGContextRef.
2495         (WebCore::HTMLCanvasElement::createPlatformImage): Updated for changes above.
2496
2497         * html/HTMLCanvasElement.idl: Added.
2498
2499         * html/HTMLParser.h:
2500         * html/HTMLParser.cpp:
2501         (WebCore::HTMLParser::canvasCreateErrorCheck): Added. An attempt to implement the
2502         fallback behavior for canvas elements when JavaScript is off.
2503         (WebCore::HTMLParser::getNode): Sorted list of functions. Added case for canvas.
2504
2505         * html/html_imageimpl.h:
2506         * html/html_imageimpl.cpp:
2507         (WebCore::HTMLImageElement::HTMLImageElement): Changed m_compositeOperator to be
2508         an enum instead of a string.
2509         (WebCore::HTMLImageElement::parseMappedAttribute): Parse the enum here.
2510
2511         * kcanvas/KCanvasResources.h:
2512         * kcanvas/KCanvasResources.cpp: (WebCore::KCanvasMarker::draw): Changed to take a
2513         GraphicsContext parameter.
2514
2515         * kcanvas/RenderPath.h: Added GraphicsContext parameter to drawMarkersIfNeeded.
2516
2517         * kcanvas/RenderPath.cpp: (WebCore::RenderPath::paint):
2518         * kcanvas/RenderSVGImage.cpp: (WebCore::RenderSVGImage::paint):
2519         * kcanvas/RenderSVGText.cpp: (WebCore::RenderSVGText::paint):
2520         Changed to generate and use an appropriate GraphicsContext.
2521
2522         * kcanvas/device/quartz/KCanvasItemQuartz.h: Added GraphicsContext parameter to
2523         drawMarkersIfNeeded.
2524         * kcanvas/device/quartz/KCanvasItemQuartz.mm:
2525         (WebCore::DrawMarkersData::DrawMarkersData): Added GraphicsContext*.
2526         (WebCore::drawMarkerWithData): Pass along a GraphicsContext*.
2527         (WebCore::drawStartAndMidMarkers): Ditto.
2528         (WebCore::KCanvasItemQuartz::drawMarkersIfNeeded): Pass a long a GraphicsContext*.
2529
2530         * kcanvas/device/KRenderingDevice.h: Added a pure virtual createGraphicsContext
2531         to bridge back to a GraphicsContext. Long term that class will replace this one.
2532         * kcanvas/device/quartz/KRenderingDeviceQuartz.h:
2533         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
2534         (WebCore::KRenderingDeviceContextQuartz::createGraphicsContext): Added.
2535
2536         * ksvg2/svg/SVGMaskElement.cpp: (WebCore::SVGMaskElement::drawMaskerContent):
2537         Create and pass a GraphicsContext -- old code used the default constructor for
2538         GraphicsContext which meant "current context", and that no longer exists.
2539         * ksvg2/svg/SVGPatternElement.cpp:
2540         (WebCore::SVGPatternElement::drawPatternContentIntoTile): Ditto.
2541
2542         * platform/Brush.h: Removed.
2543         * platform/CompositeOperator.h: Added.
2544         * platform/CompositeOperator.cpp: Added.
2545
2546         * platform/Font.h: Changed calls to use IntPoint instead of pairs of ints.
2547         Also removed the const from all the uses of GraphicsContext*.
2548
2549         * platform/GraphicsContext.h: Eliminated default constructor and constructor
2550         that takes only a boolean. Replaced with constructors that take platform
2551         graphics contexts only. Replaced brush-related calls with fill color calls.
2552         Replaced use of Brush with use of Color. Changed Image::CompositeOperator to
2553         just plain CompositeOperator. Changed tuples of ints into IntRect and IntPoint.
2554         Moved setFocusRingClip and clearFocusRingClip out of ifdefs. Removed unused
2555         getCompositeOperation and string-based setCompositeOperation. Moved
2556         currentCGContext and the other setCompositeOperation out of the GraphicsContext
2557         class and made them global functions. Fixed platformContext so it won't always
2558         return the CGContextRef of the current NSGraphicsContext. Instead, it will
2559         return the appropriate CGContextRef for the GraphicsContext. This eliminates
2560         the need to use void* for the image-drawing functions.
2561
2562         * platform/GraphicsContext.cpp:
2563         (WebCore::GraphicsContextState::GraphicsContextState): Replaced Brush with
2564         an RGBA fill color.
2565         (WebCore::GraphicsContext::setFillColor): Renamed from setBrush.
2566         (WebCore::GraphicsContext::fillColor): Renamed from brush.
2567         (WebCore::GraphicsContext::drawImage): Changed to use IntRect.
2568         (WebCore::GraphicsContext::drawTiledImage): Moved here from GraphicsContextMac.mm.
2569         (WebCore::GraphicsContext::drawText): Changed to use IntPoint.
2570         (WebCore::GraphicsContext::drawHighlightForText): Ditto.
2571         (WebCore::GraphicsContext::drawLineForText): Ditto.
2572         (WebCore::GraphicsContext::drawLineForMisspelling): Ditto.
2573
2574         * platform/Image.h: Removed CompositeOperator and related functions.
2575         Removed void* context parameters from draw functions.
2576
2577         * platform/Image.cpp: Removed compositeOperatorFromString.
2578
2579         * platform/Widget.h: Added a GraphicsContext* return value from lockDrawingFocus
2580         that you pass back to unlockDrawingFocus (for deletion).
2581
2582         * platform/mac/FontMac.mm:
2583         (WebCore::Font::selectionRectForText): Changed parameter to point and removed
2584         const on GraphicsContext* parameter.
2585         (WebCore::Font::drawText): Ditto.
2586         (WebCore::Font::drawHighlightForText): Ditto.
2587         (WebCore::Font::drawLineForText): Ditto.
2588         (WebCore::Font::drawLineForMisspelling): Ditto.
2589         (WebCore::Font::misspellingLineThickness): Removed const.
2590
2591         * platform/mac/GraphicsContextMac.mm:
2592         (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
2593         Added fields to store a CGContextRef and an NSGraphicsContext.
2594         (WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate):
2595         Release both the CGContextRef and the NSGraphicsContext.
2596         (WebCore::GraphicsContext::GraphicsContext): Implement to set up both the
2597         CGContextRef and the NSGraphicsContext in one case, and only the CGContextRef
2598         in the other.
2599         (WebCore::GraphicsContext::savePlatformState): Implement for the CGContext-only
2600         case.
2601         (WebCore::GraphicsContext::restorePlatformState): Ditto.
2602         (WebCore::GraphicsContext::drawRect): Assert that the NS context is present
2603         and 
2604         (WebCore::GraphicsContext::setColorFromFillColor): Renamed from
2605         setColorFromBrush.
2606         (WebCore::GraphicsContext::setColorFromPen): Added assertion.
2607         (WebCore::GraphicsContext::drawLine): Added assertion.
2608         (WebCore::GraphicsContext::drawEllipse): Get CGContext from the platformContext
2609         function instead of currentCGContext, and changed to use fillColor.
2610         (WebCore::GraphicsContext::drawArc): Ditto.
2611         (WebCore::GraphicsContext::drawConvexPolygon): Ditto.
2612         (WebCore::setCompositeOperation): Changed to global function and also changed
2613         to do the work here -- no need to use WebCoreImageRendererFactory.
2614         (WebCore::GraphicsContext::drawImage): Move most of this into GraphicsContext.cpp.
2615         Remove the void* context parameter. Changed to take rects instead of separate coordinates.
2616         (WebCore::GraphicsContext::fillRect): Changed to take color instead of Brush.
2617         (WebCore::GraphicsContext::addClip): Added assertion.
2618         (WebCore::GraphicsContext::addRoundedRectClip): Get CGContextRef from the platformContext
2619         function instead of currentCGContext.
2620         (WebCore::GraphicsContext::createRenderingDeviceContext): Ditto.
2621         (WebCore::GraphicsContext::beginTransparencyLayer): Ditto.
2622         (WebCore::GraphicsContext::endTransparencyLayer): Ditto.
2623         (WebCore::GraphicsContext::setShadow): Change to take size instead of x,y. Also get
2624         CGCOntextRef from the platformContext function instead of currentCGContext.
2625         (WebCore::GraphicsContext::clearShadow): Get CGContextRef from the platformContext
2626         function instead of currentCGContext.
2627         (WebCore::GraphicsContext::platformContext): Added. Returns m_data->m_cgContext.
2628
2629         * platform/mac/ImageMac.mm:
2630         (WebCore::fillSolidColorInRect): Updated for change in CompositeOperator type.
2631         (WebCore::Image::checkForSolidColor): Ditto.
2632         (WebCore::Image::draw): Removed void* context parameter and replaced it with
2633         a GraphicsContext* parameter. Renamed from drawInRect.
2634         (WebCore::Image::drawTiled): Ditto. Renamed from tileInRect and scaleAndTileInRect.
2635
2636         * platform/mac/PDFDocumentImage.h: Updated for change in CompositeOperator type.
2637         * platform/mac/PDFDocumentImage.mm: (WebCore::PDFDocumentImage::draw): Ditto.
2638
2639         * platform/mac/WidgetMac.mm:
2640         (WebCore::Widget::lockDrawingFocus): Changed to return a GraphicsContext*.
2641         (WebCore::Widget::unlockDrawingFocus): Changed to take a GraphicsContext*.
2642
2643         * rendering/InlineTextBox.cpp:
2644         (WebCore::InlineTextBox::selectionRect): Changed to pass IntPoint.
2645         (WebCore::InlineTextBox::paint): Changed to pass IntSize.
2646         (WebCore::InlineTextBox::paintSelection): More of the same.
2647         (WebCore::InlineTextBox::paintMarkedTextBackground): Ditto.
2648         (WebCore::InlineTextBox::paintDecoration): Ditto.
2649         (WebCore::InlineTextBox::paintSpellingMarker): Ditto.
2650         (WebCore::InlineTextBox::paintTextMatchMarker): Ditto.
2651         (WebCore::InlineTextBox::paintMarkedTextUnderline): Ditto.
2652         (WebCore::InlineTextBox::positionForOffset): Ditto.
2653         * rendering/RenderBlock.cpp:
2654         (WebCore::RenderBlock::fillHorizontalSelectionGap): Ditto.
2655         (WebCore::RenderBlock::fillVerticalSelectionGap): Ditto.
2656         (WebCore::RenderBlock::fillLeftSelectionGap): Ditto.
2657         (WebCore::RenderBlock::fillRightSelectionGap): Ditto.
2658         * rendering/RenderBox.cpp:
2659         (WebCore::RenderBox::paintBackgroundExtended): Ditto.
2660         (WebCore::RenderBox::outlineBox): Ditto.
2661         * rendering/RenderImage.cpp:
2662         (WebCore::RenderImage::paint): Ditto.
2663         * rendering/RenderLayer.cpp:
2664         (WebCore::setClip): Take out ifdefs. We'll do that inside GraphicsContext instead.
2665         (WebCore::restoreClip): Ditto.
2666         * rendering/RenderObject.cpp:
2667         (WebCore::RenderObject::drawBorder): More of the same.
2668         (WebCore::RenderObject::paintBorderImage): Ditto.
2669         * rendering/render_line.cpp:
2670         (WebCore::InlineFlowBox::paintDecorations): Ditto.
2671         (WebCore::EllipsisBox::paint): Ditto.
2672         * rendering/render_list.cpp:
2673         (WebCore::RenderListMarker::paint): Ditto.
2674
2675         * rendering/render_frames.cpp: (WebCore::RenderFrameSet::userResize): Set up a graphics
2676         context by calling lockDrawingFocus. Also changed a color here to be a constant.
2677
2678         * platform/cairo/GraphicsContextCairo.cpp:
2679         (WebCore::GraphicsContext::drawImage): Update for parameter type changes.
2680         (WebCore::GraphicsContext::drawScaledAndTiledImage):
2681         (WebCore::GraphicsContext::setFocusRingClip):
2682         (WebCore::GraphicsContext::clearFocusRingClip):
2683         * platform/cairo/ImageCairo.cpp:
2684         (WebCore::setCompositingOperation):
2685         (WebCore::Image::tileInRect):
2686         (WebCore::Image::scaleAndTileInRect):
2687
2688 2006-04-20  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2689
2690         Reviewed by Darin.
2691
2692         WebCore part of:
2693         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8276
2694           REGRESSION (NativeTextField): Pasting a Finder item into a text field results in
2695             a file: URL being pasted instead of just the file name
2696         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8283
2697           REGRESSION: File's path doesn't appear after dragging file into input field
2698
2699         * bridge/mac/WebCoreFrameBridge.h:
2700         * bridge/mac/WebCoreFrameBridge.mm:
2701         (-[WebCoreFrameBridge isDragCaretRichlyEditable]): Added.
2702         * manual-tests/plain-text-paste.html: Added.
2703         * manual-tests/resources/plain-text-paste: Added.
2704         * manual-tests/resources/plain-text-paste/1.textClipping: Added.
2705         * manual-tests/resources/plain-text-paste/2.textClipping: Added.
2706         * manual-tests/resources/plain-text-paste/3.gif: Added.
2707         * manual-tests/resources/plain-text-paste/4.txt: Added.
2708         * manual-tests/resources/plain-text-paste/5.webloc: Added.
2709
2710 2006-04-20  Darin Adler  <darin@apple.com>
2711
2712         Reviewed by Adele.
2713
2714         - WebCore part of http://bugzilla.opendarwin.org/show_bug.cgi?id=8505
2715           eliminate WebCoreGraphics bridge, demonstrate new SystemInterface technique
2716
2717         * platform/mac/WebCoreGraphicsBridge.h: Removed.
2718         * platform/mac/WebCoreGraphicsBridge.m: Removed.
2719         * platform/mac/WebCoreSystemInterface.h: Added.
2720         * platform/mac/WebCoreSystemInterface.mm: Added.
2721
2722         * WebCore.exp: Add new SystemInterface globals, remove WebCoreGraphicsBridge.
2723
2724         * WebCore.xcodeproj/project.pbxproj: Updated for removed and added files.
2725         Sorted files.
2726
2727         * bridge/mac/FrameMac.mm: Removed unneeded include of WebCoreGraphicsBridge.h.
2728
2729         * platform/mac/ClipboardMac.mm: (WebCore::ClipboardMac::setDragImage):
2730         Moved code from WebGraphicsBridge here, using WebCoreSystemInterface so we can
2731         call wkSetDragImage.
2732
2733         * platform/mac/GraphicsContextMac.mm: (WebCore::GraphicsContext::drawFocusRing):
2734         Moved code from WebGraphicsBridge here, using WebCoreSystemInterface so we can
2735         call wkDrawFocusRing.
2736
2737         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintTextField):
2738         Call wkDrawBezeledTextFieldCell from WebCoreSystemInterface instead of using
2739         WebGraphicsBridge to do the same thing.
2740
2741 2006-04-20  Adele Peterson  <adele@apple.com>
2742
2743         Reviewed by Hyatt.
2744
2745         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8273
2746         REGRESSION: Read only input text field renders at the wrong height when value attribute is not present
2747
2748         Test: fast/forms/input-readonly-empty.html
2749
2750         * rendering/RenderBlock.h: Added hasLineIfEmpty.
2751         * rendering/RenderBlock.cpp:
2752         (WebCore::RenderBlock::hasLineIfEmpty): Added.  Checks for rootEditableElement as well as 
2753          a shadowNode who has an input element as a parent.
2754         (WebCore::RenderBlock::getBaselineOfLastLineBox): Calls hasLineIfEmpty instead of just checking for the rootEditableElement.
2755         * rendering/bidi.cpp: (WebCore::RenderBlock::layoutInlineChildren): ditto.
2756
2757 2006-04-20  Darin Adler  <darin@apple.com>
2758
2759         Reviewed by Timothy.
2760
2761         Removed TO_NODE_OFFSET and TO_NODE_ADDRESS macros. These can just be done inline with pointer math.
2762
2763         * platform/DeprecatedString.cpp:
2764         (allocateNode):
2765         (freeHandle):
2766
2767 2006-04-19  Adele Peterson  <adele@apple.com>
2768
2769         Rubber-stamped by Darin.
2770
2771         Removed optimizations recently added in setInnerHTML and setInnerText.  The setInnerHTML change broke a first-letter style test.
2772         The setInnerText change caused an empty text node to get added when setting inner text to an empty string.  The bug that this
2773         change went in with remains fixed.
2774
2775         * html/HTMLElement.cpp:
2776         (WebCore::HTMLElement::setInnerHTML):
2777         (WebCore::HTMLElement::setInnerText):
2778
2779 2006-04-19  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2780
2781         Reviewed by Haytt.
2782
2783         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6770
2784           REGRESSION: Incomplete repaint when block with clipping grows
2785
2786         * manual-tests/repaint-resized-overflow.html: Added.
2787         * rendering/RenderLayer.cpp:
2788         (WebCore::RenderLayer::RenderLayer):
2789         (WebCore::RenderLayer::computeRepaintRects): Set the m_repaintOverflowOnResize
2790         flag to true if our object itself needs layout or if we're an overflow
2791         and have a normal child that needs layout, in which case if we end up
2792         resizing it will be because of the child, and that child might have not repainted
2793         itself correctly during its own layout.
2794         (WebCore::RenderLayer::updateLayerPositions): Do a full repaint if
2795         m_repaintOverflowOnResize is set and we resized but didn't move.
2796         * rendering/RenderLayer.h:
2797
2798 2006-04-19  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2799
2800         Reviewed by Hyatt.
2801
2802         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8352
2803           CSS text-shadow does not repaint completely when changed
2804
2805         * manual-tests/dynamic-shadow.html: Added.
2806         * rendering/render_style.cpp:
2807         (WebCore::RenderStyle::diff): Changed to return Layout when text-shadow
2808         changes.
2809
2810 2006-04-19  Adele Peterson  <adele@apple.com>
2811
2812         Reviewed by Darin.
2813
2814         Added readOnly methods for HTMLInputElement and HTMLTextAreaElement so the DOM bindings can call
2815         a method with the same name.  This will make it easier to autogenerate the DOM bindings in the future.
2816  
2817         * html/HTMLInputElement.h: (WebCore::HTMLInputElement::readOnly): Added. Calls isReadOnlyControl.
2818         * html/HTMLTextAreaElement.h: (WebCore::HTMLTextAreaElement::readOnly): ditto.
2819         * bindings/js/kjs_html.cpp:
2820         (KJS::JSHTMLElement::inputGetter): Calls readOnly instead of isReadOnlyControl.
2821         (KJS::JSHTMLElement::textAreaGetter): ditto.
2822         * bindings/objc/DOMHTML.mm:
2823         (-[DOMHTMLInputElement readOnly]): ditto.
2824         (-[DOMHTMLTextAreaElement readOnly]): Calls readOnly instead of getting the attribute directly.
2825         (-[DOMHTMLTextAreaElement setReadOnly:]): Calls setReadOnly instead of setting the attribute directly.
2826
2827 2006-04-19  Adele Peterson  <adele@apple.com>
2828
2829         Reviewed by Hyatt.
2830
2831         Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=8297
2832         REGRESSION: Input element extends outside of DIV element at http://www.macdock.com/
2833
2834         * platform/Font.h: Added runRounding parameter to floatWidth.
2835         * platform/mac/FontMac.mm: (WebCore::Font::floatWidth): ditto.
2836         * platform/win/FontWin.cpp: (WebCore::Font::floatWidth): ditto.
2837         * rendering/RenderTextField.cpp: (WebCore::RenderTextField::calcMinMaxWidth):
2838           Use new floatWidth parameter to turn off run rounding.
2839
2840 2006-04-19  Adele Peterson  <adele@apple.com>
2841
2842         Reviewed by Beth.
2843
2844         Fix for Windows build.
2845
2846         * rendering/RenderThemeWin.cpp: (WebCore::RenderThemeWin::determineState):
2847         Use isReadOnlyControl instead of isReadOnly.
2848
2849  2006-04-19  Adele Peterson  <adele@apple.com>
2850  
2851          Reviewed by Beth.
2852  
2853          Fix to make readonly text fields have dimmed borders to match AppKit behavior.
2854  
2855          Test: fast/forms/input-readonly-dimmed.html
2856  
2857          * dom/Node.h: (WebCore::Node::isReadOnlyControl): Changed from const version of isReadOnly.
2858          * dom/Node.cpp:
2859          (WebCore::Node::isReadOnlyNode): Changed from isReadOnly.
2860          (WebCore::Node::setNodeValue): Uses isReadOnlyNode instead of isReadOnly.
2861          (WebCore::Node::checkSetPrefix): ditto.
2862          (WebCore::Node::checkAddChild): ditto.
2863          * dom/Attr.cpp: (WebCore::Attr::setValue): ditto.
2864          * dom/CharacterData.cpp:
2865          (WebCore::CharacterData::setData): ditto.
2866          (WebCore::CharacterData::appendData): ditto.
2867          (WebCore::CharacterData::checkCharDataOperation): ditto.
2868          * dom/ContainerNode.cpp: (WebCore::ContainerNode::removeChild): ditto.
2869          * dom/Element.cpp: (WebCore::Element::setAttribute): ditto.
2870          * dom/NamedAttrMap.cpp:
2871          (WebCore::NamedAttrMap::setNamedItem): ditto.
2872          (WebCore::NamedAttrMap::removeNamedItem): ditto.
2873          * dom/NamedAttrMap.h: (WebCore::NamedAttrMap::isReadOnlyNode): ditto.
2874          * dom/NamedNodeMap.h: (WebCore::NamedNodeMap::isReadOnlyNode): ditto.
2875          * dom/Range.cpp:
2876          (WebCore::Range::checkDeleteExtract): ditto.
2877          (WebCore::Range::containedByReadOnly): ditto.
2878          * dom/Text.cpp: (WebCore::Text::splitText): ditto.
2879          * dom/dom_xmlimpl.cpp: (WebCore::ProcessingInstruction::setData): ditto.
2880  
2881          * bindings/js/kjs_html.cpp:
2882          (KJS::JSHTMLElement::inputGetter): Uses isReadOnlyControl instead of isReadOnly.
2883          (KJS::JSHTMLElement::textAreaGetter): ditto.
2884          * bindings/objc/DOMHTML.mm: (-[DOMHTMLInputElement readOnly]): ditto.
2885          * rendering/render_form.cpp:
2886          (WebCore::RenderLineEdit::updateFromElement): ditto.
2887          (WebCore::RenderTextArea::updateFromElement): ditto.
2888          * rendering/RenderTextField.cpp:
2889          (WebCore::RenderTextField::createDivStyle): ditto.
2890          (WebCore::RenderTextField::updateFromElement): ditto.
2891  
2892          * html/HTMLGenericFormElement.cpp: (WebCore::HTMLGenericFormElement::parseMappedAttribute): 
2893            When readonly attribute changes, update the theme so the control will repaint.
2894          * html/HTMLGenericFormElement.h: (WebCore::HTMLGenericFormElement::isReadOnlyControl): Renamed from readOnly.
2895          * html/HTMLInputElement.h: Removed isReadOnly, since isReadOnlyControl now exists on HTMLGenericFormElement.
2896          * rendering/RenderTheme.cpp: (WebCore::RenderTheme::isReadOnlyControl): Renamed from isReadOnly.
2897          * rendering/RenderTheme.h: (WebCore::): Added ReadOnlyState to ControlState enum.
2898          * rendering/RenderThemeMac.h: Removed NSTextFieldCell since it was only being used to store the enabled state.
2899            Removed setTextFieldState since it was updating the enabled state of the cell, which is only used in one place.
2900          * rendering/RenderThemeMac.mm:
2901          (WebCore::RenderThemeMac::RenderThemeMac): No longer initialized the NSTextFieldCell.
2902          (WebCore::RenderThemeMac::adjustRepaintRect): No longer calls setTextFieldState.
2903          (WebCore::RenderThemeMac::paintTextField): Uses the enabled state and the readonly state to determine whether to draw
2904           a dimmed version of the aqua border.
2905  
2906 2006-04-19  Beth Dakin  <bdakin@apple.com>
2907
2908         Reviewed by Hyatt.
2909
2910         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8467 Block 
2911         with percentage background-size doesn't repaint properly when it 
2912         grows
2913
2914         * manual-tests/backgroundSizeRepaint.html: Added.
2915         * manual-tests/resources/apple.jpg: Added.
2916         * rendering/RenderObject.cpp:
2917         (WebCore::RenderObject::mustRepaintBackgroundOrBorder): We must 
2918         return true if we have a percentage background-size.
2919
2920 2006-04-19  David Hyatt  <hyatt@apple.com>
2921
2922         Fix for a regression in the new text fields.  Don't allow the repaint
2923         rect created by dynamic line layout changes to spill out of an overflow
2924         area's clip region.
2925
2926         (There is no test, since we have no way of testing cases where we repaint
2927          too much rather than too little.)
2928
2929         Reviewed by darin
2930
2931         * rendering/bidi.cpp:
2932         (WebCore::RenderBlock::layoutInlineChildren):
2933
2934 2006-04-19  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2935
2936         Fix for bug 8449, incomplete repaint of table cell that moved.  This
2937         fix also solves some of the textfield repainting problems (e.g., on
2938         google.com and lxr.mozilla.org).
2939
2940         Reviewed by hyatt
2941
2942         * manual-tests/table-cell-move.html: Added.
2943         * rendering/RenderCanvas.cpp:
2944         (WebCore::RenderCanvas::repaintViewRectangle):
2945         * rendering/RenderTableSection.cpp:
2946         (WebCore::RenderTableSection::layoutRows):
2947
2948 2006-04-19  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2949
2950         Reviewed by Eric, landed by ap.
2951
2952         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8469
2953           CRASH: WebCore::CSSParser::parseDashboardRegions when attr() is passed
2954
2955         Test: fast/css/dashboard-regions-attr-crash.html
2956
2957         * css/cssparser.cpp:
2958         (WebCore::CSSParser::parseDashboardRegions): Added null check for args.
2959
2960 2006-04-18  Rob Buis  <buis@kde.org>
2961
2962         Reviewed by eseidel & darin.  Landed by eseidel.
2963
2964         No automated tests possible (from javascript).
2965
2966         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=6664:
2967         Inspector does not highlight SVG elements properly
2968
2969         Make sure RenderObject::absoluteBoundingBoxRect works for
2970         svg specific render objects by overriding absoluteRects.
2971         This fixes highlighting in the Inspector of svg shapes, paths,
2972         images and text.
2973
2974         * kcanvas/RenderPath.cpp:
2975         (WebCore::RenderPath::absoluteRects):
2976         * kcanvas/RenderPath.h:
2977         * kcanvas/RenderSVGImage.cpp:
2978         (WebCore::RenderSVGImage::getAbsoluteRepaintRect):
2979         (WebCore::RenderSVGImage::absoluteRects):
2980         * kcanvas/RenderSVGImage.h:
2981         * kcanvas/RenderSVGText.cpp:
2982         (WebCore::RenderSVGText::absoluteRects):
2983         * kcanvas/RenderSVGText.h:
2984
2985 2006-04-17  Rob Buis  <buis@kde.org>
2986
2987         Reviewed by eseidel.  Landed by eseidel.
2988
2989         Test: svg/custom/tref-update.svg
2990
2991         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=6427:
2992         <tref> element not implemented
2993
2994         Implementation of <tref> element.
2995
2996         * WebCore.xcodeproj/project.pbxproj:
2997         * ksvg2/svg/SVGTRefElement.cpp: Added.
2998         (SVGTRefElement::SVGTRefElement):
2999         (SVGTRefElement::~SVGTRefElement):
3000         (SVGTRefElement::parseMappedAttribute):
3001         (SVGTRefElement::closeRenderer):
3002         (SVGTRefElement::childShouldCreateRenderer):
3003         (SVGTRefElement::createRenderer):
3004         * ksvg2/svg/SVGTRefElement.h: Added.
3005         (WebCore::SVGTRefElement::rendererIsNeeded):
3006         * ksvg2/svg/SVGTSpanElement.cpp:
3007         (SVGTSpanElement::childShouldCreateRenderer):
3008         * ksvg2/svg/SVGTextElement.cpp:
3009         (WebCore::SVGTextElement::childShouldCreateRenderer):
3010         * ksvg2/svg/svgtags.in:
3011
3012 2006-04-18  Darin Adler  <darin@apple.com>
3013
3014         * rendering/render_form.cpp: (WebCore::RenderSelect::updateFromElement):
3015         Roll out accidentally-landed change for bug 8398.
3016
3017 2006-04-18  Beth Dakin  <bdakin@apple.com>
3018
3019         Reviewed by Darin.
3020
3021         Fix for a leak exposed by background-size and detected by the 
3022         layout tests.
3023
3024         * css/css_valueimpl.cpp:
3025         (WebCore::CSSPrimitiveValue::cleanup): We must deref pairs.
3026
3027 2006-04-18  Beth Dakin  <bdakin@apple.com>
3028
3029         Reviewed by Eric.
3030
3031         Build fix for Windows. Just a few typos from background-size patch.
3032
3033         * platform/cairo/GraphicsContextCairo.cpp:
3034         (WebCore::GraphicsContext::drawTiledImage):
3035         * platform/cairo/ImageCairo.cpp:
3036         (WebCore::Image::tileInRect):
3037
3038 2006-04-18  Beth Dakin  <bdakin@apple.com>
3039
3040         Reviewed by Hyatt.
3041
3042         Implementation of CSS3 background-size property. See 
3043         http://bugzilla.opendarwin.org/show_bug.cgi?id=8353 for details.
3044
3045         * Viewer/ImageView.cpp: Adjust parameters to drawTiledImage()
3046         * css/CSSComputedStyleDeclaration.cpp: Add background-size
3047         * css/CSSPropertyNames.in: Same.
3048         * css/css_valueimpl.h: Add a constructor for Pair that takes the 
3049         two halves of the pair.
3050         * css/cssparser.cpp: Parse background-size. Still need to take care 
3051         of parsing the shorthand.
3052         * css/cssparser.h: Same.
3053         * css/cssstyleselector.cpp: Address background-size.
3054         * css/cssstyleselector.h: Same.
3055         * platform/GraphicsContext.h: drawTiledImage() now takes the 
3056         tileSize so that it can appropriately scale.
3057         * platform/Image.h: Same as above, but for tileInRect()
3058         * platform/cairo/GraphicsContextCairo.cpp:
3059         (WebCore::GraphicsContext::drawTiledImage):
3060         * platform/cairo/ImageCairo.cpp:
3061         (WebCore::Image::tileInRect): Take care of scaling image in 
3062         necessary in Cairo.
3063         * platform/mac/GraphicsContextMac.mm:
3064         (WebCore::GraphicsContext::drawTiledImage): 
3065         * platform/mac/ImageMac.mm:
3066         (WebCore::Image::tileInRect): Take care of scaling image if 
3067         necessary in CG.
3068         * rendering/RenderBox.cpp:
3069         (WebCore::RenderBox::paintBackgroundExtended): Compute appropriate 
3070         scale if background-size is set. If no-repeat is set, just call 
3071         drawImage() directly.
3072         * rendering/render_style.cpp: Add background-size to the style.
3073         (WebCore::m_next):
3074         (WebCore::BackgroundLayer::BackgroundLayer):
3075         (WebCore::BackgroundLayer::operator=):
3076         (WebCore::BackgroundLayer::operator==):
3077         (WebCore::BackgroundLayer::fillUnsetProperties):
3078         (WebCore::BackgroundLayer::cullEmptyLayers):
3079         * rendering/render_style.h: Same.
3080         (WebCore::BackgroundLayer::backgroundSize):
3081         (WebCore::BackgroundLayer::isBackgroundSizeSet):
3082         (WebCore::BackgroundLayer::setBackgroundSize):
3083         (WebCore::BackgroundLayer::clearBackgroundSize):
3084         (WebCore::RenderStyle::backgroundSize):
3085         (WebCore::RenderStyle::initialBackgroundSize):
3086
3087 2006-04-17  Justin Garcia  <justin.garcia@apple.com>
3088
3089         Reviewed by harrison
3090
3091         * editing/CompositeEditCommand.cpp:
3092         (WebCore::CompositeEditCommand::moveParagraph): The placeholder that's inserted 
3093         to keep content from collapsing due to pruning was inserted at the position after 
3094         the moved paragraph.  That's only appropriate when moving the paragraph backward 
3095         into the previous paragraph.
3096         
3097         * editing/ReplaceSelectionCommand.cpp:
3098         (WebCore::ReplaceSelectionCommand::doApply): The last paragraph of the incoming
3099         fragment should be merged with the paragraph after the end of the selection being pasted
3100         into even if the incoming fragment has only one block.   This fixes a bug and gets
3101         rid of a use of the info gathered during the test insertion.
3102
3103 2006-04-17  Adele Peterson  <adele@apple.com>
3104
3105         Reviewed by Darin.
3106
3107         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8407
3108         REGRESSION (NativeTextField): Leading and trailing spaces trimmed from text field value attribute
3109
3110         Test: fast/forms/input-spaces.html
3111
3112         * rendering/RenderTextField.cpp: (WebCore::RenderTextField::createDivStyle): 
3113         Use white-space:pre for the inner div to avoid collapsing spaces in the text field.
3114
3115 2006-04-18  Mitz Pettel  <opendarwin.org@mitzpettel.com>
3116
3117         Reviewed by Darin.
3118
3119         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8437
3120           iExploder(#293): Crash in StringImpl::hash()
3121
3122         * manual-tests/applet-param-no-name.html: Added.
3123         * rendering/RenderApplet.cpp:
3124         (WebCore::RenderApplet::createWidgetIfNecessary): Skip param elements with
3125         empty name.
3126
3127 2006-04-18  Darin Adler  <darin@apple.com>
3128
3129         - try to fix the Windows build
3130
3131         * platform/cairo/GraphicsContextCairo.cpp: (WebCore::setColor):
3132         Update for changes to getRGBA.
3133
3134 2006-04-17  Alexey Proskuryakov  <ap@nypop.com>
3135
3136         Reviewed by Darin.
3137
3138         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8440
3139         iExploder(#3327): Crash in StringImpl::initWithQChar()
3140
3141         Test: fast/parser/number-sign-in-map-name.html
3142
3143         * html/html_imageimpl.cpp:
3144         (WebCore::HTMLMapElement::parseMappedAttribute): Fixed handling of names starting with a '#'.
3145
3146 2006-04-17  Adele Peterson  <adele@apple.com>
3147
3148         Reviewed by Darin.
3149
3150         Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=8269
3151         REGRESSION: disabled text field does not display greyed-out text
3152
3153         * rendering/RenderTextField.cpp: (WebCore::RenderTextField::createDivStyle): 
3154         For disabled text fields, lighten or darken text color based on background color.
3155         Tries to get as close as possible to logic in AppKit for old text fields.
3156         * platform/Color.h: Removed hsv and setHsv since they were just used within Color.cpp.
3157         * platform/Color.cpp:
3158         (WebCore::parseHexColor): Cleanup.
3159         (WebCore::differenceSquared): Added. Returns the difference squared of two colors.
3160         (WebCore::convertRGBToHSV): Added static function. Replaces hsv and setHSV, and fixes bug in old implementation of the algorithm.
3161         (WebCore::convertHSVToRGB): ditto.
3162         (WebCore::Color::light): No longer takes in a factor, since all callers use the same factor.  Uses new conversion functions.
3163         (WebCore::Color::dark): ditto.
3164         * rendering/InlineTextBox.cpp: Removed simpleDifferenceBetweenColors.
3165         (WebCore::correctedTextColor):  Uses differenceSquared instead of simpleDifferenceBetweenColors.
3166
3167 2006-04-17  David Hyatt  <hyatt@apple.com>
3168
3169         Fix for bug 8270, text highlights outside of textfield when it shouldn't.
3170
3171         Reviewed by darin
3172
3173         Added fast/forms/input-double-click-selection-gap-bug.html
3174
3175         * rendering/RenderBlock.cpp:
3176         (WebCore::RenderBlock::fillInlineSelectionGaps):
3177
3178 2006-04-17  David Hyatt  <hyatt@apple.com>
3179
3180         Fix for bug 8848, caret off by 1 pixel on numerous pixel tests.
3181
3182         Reviewed by darin
3183
3184         * rendering/InlineTextBox.cpp:
3185         (WebCore::InlineTextBox::positionForOffset):
3186         * rendering/RenderText.cpp:
3187         (WebCore::RenderText::caretRect):
3188
3189 2006-04-17  Timothy Hatcher  <timothy@apple.com>
3190
3191         Reviewed by Darin.
3192
3193         <rdar://problem/4506601> TOT WebCore fails to build ppc64
3194
3195         Switch many CG calls to use CGFloat for colors and gradients
3196
3197         * bindings/objc/DOMCSS.mm:
3198         (-[DOMRGBColor dealloc]): cast _internal to uintptr_t
3199         (-[DOMRGBColor finalize]): cast _internal to uintptr_t
3200         (-[DOMRGBColor red]): cast _internal to uintptr_t
3201         (-[DOMRGBColor green]): cast _internal to uintptr_t
3202         (-[DOMRGBColor blue]): cast _internal to uintptr_t
3203         (-[DOMRGBColor alpha]): cast _internal to uintptr_t
3204         (-[DOMRGBColor _color]): cast _internal to uintptr_t
3205         * bridge/mac/FrameMac.mm:
3206         (WebCore::regExpForLabels): use CFIndex as the type returned from indexOfObject:
3207         * bridge/mac/WebCoreFrameBridge.mm:
3208         (-[WebCoreFrameBridge baseWritingDirectionForSelectionStart]): workaround for <rdar://problem/4509035>
3209         * config.h: define CGFloat if it isn't defined already
3210         * html/CanvasGradient.cpp:
3211         (WebCore::CanvasGradient::addColorStop):
3212         (WebCore::gradientCallback):
3213         (WebCore::CanvasGradient::platformShading):
3214         * html/CanvasRenderingContext2D.cpp:
3215         (WebCore::CanvasRenderingContext2D::setShadow):
3216         (WebCore::CanvasRenderingContext2D::applyShadow):
3217         (WebCore::CanvasRenderingContext2D::applyStrokePattern):
3218         (WebCore::CanvasRenderingContext2D::applyFillPattern):
3219         * html/CanvasStyle.cpp:
3220         (WebCore::CanvasStyle::applyStrokeColor):
3221         (WebCore::CanvasStyle::applyFillColor):
3222         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
3223         (WebCore::alphaImageForImage):
3224         (WebCore::KCanvasFEColorMatrixQuartz::getCIFilter):
3225         * kcanvas/device/quartz/KCanvasMaskerQuartz.mm:
3226         (WebCore::applyLuminanceToAlphaFilter):
3227         (WebCore::applyExpandAlphatoGrayscaleFilter):
3228         (WebCore::transformImageIntoGrayscaleMask):
3229         * kcanvas/device/quartz/KCanvasPathQuartz.mm:
3230         (WebCore::scratchContext):
3231         * kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm:
3232         (WebCore::cgGradientCallback):
3233         (WebCore::CGShadingRefForLinearGradient):
3234         (WebCore::CGShadingRefForRadialGradient):
3235         (WebCore::KRenderingPaintServerGradientQuartz::updateQuartzGradientStopsCache):
3236         * kcanvas/device/quartz/KRenderingPaintServerQuartz.h:
3237         (WebCore::):
3238         * kcanvas/device/quartz/KRenderingPaintServerQuartz.mm:
3239         (WebCore::KRenderingPaintServerPatternQuartz::setup):
3240         * kcanvas/device/quartz/QuartzSupport.mm:
3241         (WebCore::applyStrokeStyleToContext):
3242         * kwq/WebCoreAXObject.mm:
3243         (CreateCGColorIfDifferent):
3244         * platform/Color.cpp:
3245         (WebCore::Color::getRGBA): new name, was getRgbaF. getRGBA uses float and has a double overload
3246         * platform/Color.h:
3247         * platform/mac/ClipboardMac.h: no need to define NSDragOperation
3248         * platform/mac/ColorMac.mm:
3249         (+[WebCoreControlTintObserver WebCore]):
3250         * platform/mac/GraphicsContextMac.mm:
3251         (WebCore::GraphicsContext::drawLine):
3252         * platform/mac/ImageMac.mm:
3253         (WebCore::Image::checkForSolidColor):
3254         (WebCore::Image::tileInRect):
3255         (WebCore::Image::scaleAndTileInRect):
3256         * platform/mac/TextEncodingMac.cpp:
3257         (WebCore::TextEncoding::fromUnicode):
3258
3259 2006-04-17  Justin Garcia  <justin.garcia@apple.com>
3260
3261         Reviewed by darin
3262         
3263         <http://bugzilla.opendarwin.org/show_bug.cgi?id=8402>
3264         Fix interchange newline handling and avoid use of test rendering info
3265
3266         * editing/ReplaceSelectionCommand.cpp:
3267         (WebCore::ReplaceSelectionCommand::doApply):
3268         Fixed bugs in handling of interchange newlines at the end of incoming 
3269         fragments.  Removed the use of !fragment.isBlockFlow since it isn't 
3270         correct and relies on information gathered during the test insertion, which 
3271         we're trying to get rid of. 
3272         * editing/VisiblePosition.h:
3273         (WebCore::VisiblePosition::rootEditableElement): Added for convenience.
3274
3275 2006-04-16  Mitz Pettel  <opendarwin.org@mitzpettel.com>
3276
3277         Reviewed by Darin.
3278
3279         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8408
3280           Paint the highlight behind selected list markers
3281
3282         Test: fast/lists/markers-in-selection.html
3283
3284         * rendering/RenderObject.h: Added selectionColorImageOverlayAlpha constant -
3285         the maximum opacity of the selection color when painted over images.
3286         * rendering/render_list.cpp:
3287         (WebCore::RenderListMarker::RenderListMarker):
3288         (WebCore::RenderListMarker::paint): Paint the selection highlight
3289         if selected: over the marker for image markers, under the marker for all other
3290         markers.
3291         (WebCore::RenderListMarker::setSelectionState): Added.
3292         (WebCore::RenderListMarker::selectionRect): Added.
3293         (WebCore::RenderListMarker::selectionColor): Added. Ensures that the selection
3294         color is transparent for image markers.
3295         * rendering/render_list.h:
3296         (WebCore::RenderListMarker::selectionState):
3297         (WebCore::RenderListMarker::canBeSelectionLeaf):
3298         * rendering/render_replaced.cpp
3299         (WebCore::RenderReplaced::selectionColor): Changed to use the selectionColorImageOverlayAlpha
3300         constant.
3301
3302 2006-04-16  Mitz Pettel  <opendarwin.org@mitzpettel.com>
3303
3304         Reviewed by Darin.
3305
3306         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8420
3307           iExploder(#12): Assertion failure in RenderContainer::removeChildNode
3308
3309         Test: fast/forms/button-inner-block-reuse.html
3310
3311         Buttons have a distinguished anonymous child that holds all their other
3312         descendants. Descendants ended up in a sibling anonymous block as the
3313         initial anonymous child was being reused to hold the initial part of an
3314         inline that got split.
3315
3316         * rendering/RenderInline.cpp:
3317         (WebCore::RenderInline::splitFlow): Check if the anonymous block's parent
3318         allows us to reuse it.
3319         * rendering/RenderObject.h:
3320         (WebCore::RenderObject::allowsReusingAnonymousChild): Added. Returns true.
3321         * rendering/render_button.h:
3322         (WebCore::RenderButton::allowsReusingAnonymousChild): Added. Returns false.
3323
3324 2006-04-16  Mitz Pettel  <opendarwin.org@mitzpettel.com>
3325
3326         Reviewed by Justin.
3327
3328         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8394
3329           Editable region does not accept dropped text if there is no selection
3330
3331         Test: editing/pasteboard/drop-text-without-selection.html
3332
3333         * bridge/mac/WebCoreFrameBridge.mm:
3334         (-[WebCoreFrameBridge documentFragmentWithText:]): Changed to allow
3335         creating a fragment regardless of the selection.
3336
3337 2006-04-16  Mitz Pettel  <opendarwin.org@mitzpettel.com>
3338
3339         Reviewed by Darin.
3340
3341         - WebCore part of fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8324
3342           REGRESSION: textarea :focus not applied immediately
3343
3344         * bridge/mac/WebCoreFrameBridge.h:
3345         * kwq/KWQComboBox.mm:
3346         (-[KWQPopUpButton becomeFirstResponder]): Added call to formControlIsBecomingFirstResponder:.
3347         (-[KWQPopUpButton resignFirstResponder]): Cleaned up.
3348         * kwq/KWQListBox.mm: Ditto.
3349         (-[KWQTableView becomeFirstResponder]):
3350         (-[KWQTableView resignFirstResponder]):
3351         * kwq/KWQSlider.mm:
3352         (-[KWQSlider becomeFirstResponder]): Added call to formControlIsBecomingFirstResponder: and
3353         cleaned up.
3354         (-[KWQSlider resignFirstResponder]): Cleaned up.
3355         * platform/mac/WebCoreTextArea.mm:
3356         (-[WebCoreTextView becomeFirstResponder]): Added call to formControlIsBecomingFirstResponder:.
3357         (-[WebCoreTextView resignFirstResponder]): Cleaned up.
3358         * platform/mac/WebCoreTextField.mm:
3359         (-[KWQTextFieldController setHasFocus:]): Added call to formControlIsBecomingFirstResponder:.
3360         * manual-tests/textarea-focus.html: Added.
3361
3362 2006-04-16  Darin Adler  <darin@apple.com>
3363
3364         Reviewed by Adele and Justin.
3365
3366         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8298
3367           REGRESSION: Crash occurs when attempting to drag selection into
3368           Depart/Return input fields at http://www.travelocity.com/
3369         - remove the mutation event listener that's installed all the time,
3370           since it slows things down a bit
3371
3372         Calling SelectionController::nodeWillBeRemoved from Document::notifyBeforeNodeRemoval
3373         fixes the crash, which was happening because the call that was removing the text
3374         node, removeChildren, does not send a "node removed" mutation event (it sends a
3375         "subtree modified" mutation event instead). So this change alone fixes the crash.
3376
3377         But I also changed setInnerText to not blow away the text node each time the value
3378         is changed, and that makes the test case behave even better -- you don't even lose
3379         the selection; it works as it did with the NSTextField-based text field.
3380
3381         * manual-tests/input-empty-on-focus.html: Added.
3382
3383         * page/Frame.h: Tweaked a few comments and functions related to selection.
3384         * page/Frame.cpp: (WebCore::Frame::dragCaret): Made non-const.
3385
3386         * dom/Document.cpp: (WebCore::Document::notifyBeforeNodeRemoval):
3387         Call nodeWillBeRemoved on the two selection controllers before removing
3388         a node from the document.
3389
3390         * editing/SelectionController.h: Tweak formatting. Remove MutationListener
3391         class and m_mutationListener field.
3392         * editing/SelectionController.cpp:
3393         (WebCore::SelectionController::SelectionController): Remove code to set up
3394         the mutation event listener.
3395         (WebCore::SelectionController::setSelection): Remove code to maintain the
3396         mutation event listener.
3397
3398         * html/HTMLElement.cpp:
3399         (WebCore::HTMLElement::setInnerHTML): In cases where the container has only a
3400         single child use replaceChild, and in cases where the HTML being inserted
3401         also has only a single child and both are text nodes use setData. It's common
3402         to use setInnerHTML to set something that's just text.
3403         (WebCore::HTMLElement::setInnerText): Same as above, but simpler since the
3404         thing we're replacing with is always text.
3405
3406 2006-04-16  Kevin Ollivier  <kevino@theolliviers.com>
3407
3408         Reviewed by Darin.
3409
3410         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8417
3411           make-css-file-arrays.pl hangs when run on Linux
3412
3413         * css/make-css-file-arrays.pl: Remove the "-" parameter from the invocation of cpp,
3414         which means "send output to stdout". It's optional on Mac OS X, and is causing a
3415         hang on Linux.
3416         * rendering/RenderArena.cpp: Added a missing include of <assert.h>.
3417
3418 2006-04-15  Darin Adler  <darin@apple.com>
3419
3420         - removed references to a couple files that are obsolete
3421           but were still in the Windows project file
3422
3423         * WebCore.vcproj/WebCore/WebCore.vcproj: Remove kjs_views.h and .cpp.
3424
3425 2006-04-15  Mitz Pettel  <opendarwin.org@mitzpettel.com>
3426
3427         Reviewed by Maciej.
3428
3429         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8405
3430           REGRESSION: Web Inspector's Style pane is blank
3431
3432         * bindings/js/kjs_window.cpp:
3433         (KJS::Window::isSafeScript): Use isEmpty() instead of isNull() for checking
3434         the domain to determine if the document in a local file. 
3435
3436 2006-04-14  David Hyatt  <hyatt@apple.com>
3437
3438         CSS vendor-specific property/value cleanup.  Properly qualify background-clip,
3439         background-origin, border-image and the border-radius properties.  Make sure
3440         our overflow extensions of marquee and overlay are qualified as well.  Rename
3441         the -khtml- extension to -webkit.
3442
3443         Reviewed by beth
3444
3445         * bindings/js/kjs_css.cpp:
3446         (KJS::cssPropertyName):
3447         * bindings/objc/DOMCSS.mm:
3448         (-[DOMCSSStyleDeclaration _fontSizeDelta]):
3449         (-[DOMCSSStyleDeclaration _setFontSizeDelta:]):
3450         * bindings/objc/DOMHTML.mm:
3451         (-[DOMHTMLInputElement _setAutofilled:]):
3452         * bridge/mac/FrameMac.h:
3453         * bridge/mac/FrameMac.mm:
3454         * css/CSSComputedStyleDeclaration.cpp:
3455         (WebCore::):
3456         (WebCore::valueForTextAlign):
3457         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
3458         * css/CSSGrammar.y:
3459         * css/CSSPropertyNames.in:
3460         * css/CSSValueKeywords.in:
3461         * css/css_base.cpp:
3462         (WebCore::CSSSelector::extractPseudoType):
3463         * css/css_valueimpl.cpp:
3464         (WebCore::):
3465         * css/css_valueimpl.h:
3466         * css/cssparser.cpp:
3467         (WebCore::CSSParser::parseRule):
3468         (WebCore::CSSParser::parseValue):
3469         (WebCore::CSSParser::parseColor):