<attachment> should allow the title property to override its title
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Mar 2015 00:46:25 +0000 (00:46 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Mar 2015 00:46:25 +0000 (00:46 +0000)
commitc3ff9795a60b275ee28608c543ee8d548a1f476e
tree94026285477f9ca3754a0aafc17f6b5dd55482a5
parent9ccc98b6e7ddf49f3e0d0f68957591bba80b3728
<attachment> should allow the title property to override its title
https://bugs.webkit.org/show_bug.cgi?id=142369

Reviewed by Anders Carlsson.

Test: fast/attachment/attachment-title.html

* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::parseAttribute):
Invalidate the attachment if the title changes.

(WebCore::HTMLAttachmentElement::attachmentTitle):
Use the title attribute for the title, unless it's empty, in which
case we'll use the file's name.

* html/HTMLAttachmentElement.h:
* rendering/RenderThemeMac.mm:
(WebCore::AttachmentLayout::layOutTitle):
Use attachmentTitle() instead of reaching into the file. Also rename
some things from filename to title.

* fast/attachment/attachment-title.html: Added.
* platform/mac/fast/attachment/attachment-title-expected.png: Added.
* platform/mac/fast/attachment/attachment-title-expected.txt: Added.
Add a test for the title property.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/attachment/attachment-title.html [new file with mode: 0644]
LayoutTests/platform/mac-mavericks/fast/attachment/attachment-title-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/attachment/attachment-title-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/attachment/attachment-title-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLAttachmentElement.cpp
Source/WebCore/html/HTMLAttachmentElement.h
Source/WebCore/rendering/RenderThemeMac.mm