Bug 186348

Summary: Use the default label for snapshotted plug-ins if no mime-type is available
Product: WebKit Reporter: Antoine Quint <graouts>
Component: Plug-insAssignee: Antoine Quint <graouts>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, dino, esprehn+autocc, ews-watchlist, gyuyoung.kim, jonlee, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Antoine Quint 2018-06-06 06:31:52 PDT
We currently crash in titleText() or subtitleText() in HTMLPlugInImageElement.cpp if there is no mime-type specified.
Comment 1 Antoine Quint 2018-06-06 06:32:10 PDT
<rdar://problem/38278978>
Comment 2 Antoine Quint 2018-06-06 06:34:20 PDT
Created attachment 342045 [details]
Patch
Comment 3 Alexey Proskuryakov 2018-06-06 10:16:52 PDT
Comment on attachment 342045 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=342045&action=review

> Source/WebCore/ChangeLog:8
> +        In case the mime-type is not available, use the default labels otherwise we'd crash trying to look up the empty string in the HashMap.

Is it feasible to have a test for this?
Comment 4 Jon Lee 2018-06-06 11:09:56 PDT
To answer ap's question, there is a test, but it hits RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(isSafeToUpdateStyleOrLayout(*this)) in Document::updateLayout()

See rdar://40849498.
Comment 5 WebKit Commit Bot 2018-06-06 11:24:44 PDT
Comment on attachment 342045 [details]
Patch

Clearing flags on attachment: 342045

Committed r232551: <https://trac.webkit.org/changeset/232551>
Comment 6 WebKit Commit Bot 2018-06-06 11:24:46 PDT
All reviewed patches have been landed.  Closing bug.