Changeset 238122 in webkit


Ignore:
Timestamp:
Nov 12, 2018 11:07:21 PM (5 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Network: show secure certificate details per-request
https://bugs.webkit.org/show_bug.cgi?id=191447
<rdar://problem/30019476>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

Add Security domain to hold security related protocol types.

  • CMakeLists.txt:
  • DerivedSources.make:
  • inspector/protocol/Network.json:
  • inspector/protocol/Security.json: Added.
  • inspector/scripts/codegen/objc_generator.py:

(ObjCGenerator):

Source/WebCore:

Test: http/tests/inspector/network/resource-response-security.html

  • loader/ResourceLoader.h:

(WebCore::ResourceLoader::shouldIncludeCertificateInfo const):

  • loader/ResourceLoader.cpp:

(WebCore::ResourceLoader::shouldIncludeCertificateInfo const): Added.
Always save certificate information when WebInspector is open.

  • platform/network/CertificateInfoBase.h: Added.

(WebCore::CertificateInfoBase::containsNonRootSHA1SignedCertificate const):
(WebCore::CertificateInfoBase::summaryInfo const):
(WebCore::CertificateInfoBase::isEmpty const):

  • platform/network/cf/CertificateInfo.h:

(WebCore::CertificateInfo::summaryInfo const): Added.

  • platform/network/cf/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm.

(WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
(WebCore::CertificateInfo::summaryInfo const): Added.

  • platform/network/curl/CertificateInfo.h:

(WebCore::CertificateInfo::summaryInfo const): Added.
(WebCore::CertificateInfo::isEmpty const): Added.

  • platform/network/soup/CertificateInfo.h:

(WebCore::CertificateInfo::summaryInfo const): Added.
(WebCore::CertificateInfo::isEmpty const): Added.
Create base class for CertificateInfo so that InspectorNetworkAgent doesn't need to have
platform-specific code in its implementation.

  • platform/network/cocoa/CertificateInfoCocoa.mm: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm.
  • platform/network/curl/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/curl/CertificateInfo.cpp.
  • platform/network/soup/CertificateInfoSoup.cpp: Renamed from Source/WebCore/platform/network/soup/CertificateInfo.cpp.
  • inspector/NetworkResourcesData.h:

(WebCore::NetworkResourcesData::ResourceData::certificateInfo const): Added.
(WebCore::NetworkResourcesData::ResourceData::setCertificateInfo): Added.

  • inspector/NetworkResourcesData.cpp:

(WebCore::NetworkResourcesData::responseReceived):

  • inspector/agents/InspectorNetworkAgent.cpp:

(WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):

  • PlatformAppleWin.cmake:
  • PlatformMac.cmake:
  • SourcesCocoa.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • platform/Curl.cmake:
  • platform/SourcesSoup.txt:

Source/WebInspectorUI:

  • UserInterface/Controllers/NetworkManager.js:

(WI.NetworkManager.prototype.resourceRequestWasServedFromMemoryCache):
(WI.NetworkManager.prototype.resourceRequestDidReceiveResponse):

  • UserInterface/Models/Resource.js:

(WI.Resource.prototype.get responseSecurity): Added.
(WI.Resource.prototype.get loadedSecurely): Added.
(WI.Resource.prototype.updateForResponse):

  • UserInterface/Views/NetworkResourceDetailView.js:

(WI.NetworkResourceDetailView):
(WI.NetworkResourceDetailView.prototype.initialLayout):
(WI.NetworkResourceDetailView.prototype.showContentViewForIdentifier):

  • UserInterface/Views/NetworkResourceDetailView.css:

(.content-view.resource-details .go-to-arrow): Added.
(.content-view.resource-details.showing-find-banner .search-highlight): Added.

  • UserInterface/Views/ResourceSecurityContentView.js: Added.

(WI.ResourceSecurityContentView):
(WI.ResourceSecurityContentView.prototype.initialLayout):
(WI.ResourceSecurityContentView.prototype.layout):
(WI.ResourceSecurityContentView.prototype.closed):
(WI.ResourceSecurityContentView.prototype.get supportsSearch):
(WI.ResourceSecurityContentView.prototype.get numberOfSearchResults):
(WI.ResourceSecurityContentView.prototype.get hasPerformedSearch):
(WI.ResourceSecurityContentView.prototype.set automaticallyRevealFirstSearchResult):
(WI.ResourceSecurityContentView.prototype.performSearch):
(WI.ResourceSecurityContentView.prototype.searchCleared):
(WI.ResourceSecurityContentView.prototype.revealPreviousSearchResult):
(WI.ResourceSecurityContentView.prototype.revealNextSearchResult):
(WI.ResourceSecurityContentView.prototype._refreshCetificateSection):
(WI.ResourceSecurityContentView.prototype._perfomSearchOnKeyValuePairs):
(WI.ResourceSecurityContentView.prototype._revealSearchResult):
(WI.ResourceSecurityContentView.prototype._handleResourceResponseReceived):

  • UserInterface/Views/ResourceSecurityContentView.css: Added.

(body[dir] .resource-security > section.certificate > .details):
(.resource-security .details .key):
(.resource-security .dns-name + .dns-name > .key,):
(.resource-security .show-more):
(@media (prefers-dark-interface) body[dir] .resource-security > section.certificate > .details):
(@media (prefers-dark-interface) .resource-security .details .key):

  • UserInterface/Views/ResourceCookiesContentView.js:

(WI.ResourceCookiesContentView.prototype._refreshRequestCookiesSection):
(WI.ResourceCookiesContentView.prototype._refreshResponseCookiesSection):
(WI.ResourceCookiesContentView.prototype._markIncompleteSectionWithMessage): Deleted.
(WI.ResourceCookiesContentView.prototype._markIncompleteSectionWithLoadingIndicator): Deleted.

  • UserInterface/Views/ResourceHeadersContentView.js:

(WI.ResourceHeadersContentView.prototype._refreshSummarySection):
(WI.ResourceHeadersContentView.prototype._refreshRedirectHeadersSections):
(WI.ResourceHeadersContentView.prototype._refreshRequestHeadersSection):
(WI.ResourceHeadersContentView.prototype._refreshResponseHeadersSection):
(WI.ResourceHeadersContentView.prototype._refreshQueryStringSection):
(WI.ResourceHeadersContentView.prototype._refreshRequestDataSection):
(WI.ResourceHeadersContentView.prototype._markIncompleteSectionWithMessage): Deleted.
(WI.ResourceHeadersContentView.prototype._markIncompleteSectionWithLoadingIndicator): Deleted.
(WI.ResourceHeadersContentView.prototype._appendKeyValuePair): Deleted.

  • UserInterface/Views/ResourceHeadersContentView.css:

(.resource-headers .h1-status > .key,):
(body[dir] .resource-headers > section.error > .details): Deleted.
(.resource-headers > section.error .key): Deleted.
(.resource-headers .details): Deleted.
(.resource-headers .details .pair): Deleted.
(body[dir=rtl] .resource-headers .details .pair): Deleted.
(.resource-headers .details .key): Deleted.
(.resource-headers .value): Deleted.
(.resource-headers .go-to-arrow): Deleted.
(.resource-headers.showing-find-banner .search-highlight): Deleted.

  • UserInterface/Views/ResourceDetailsSection.js:

(WI.ResourceDetailsSection.prototype.markIncompleteSectionWithMessage): Added.
(WI.ResourceDetailsSection.prototype.markIncompleteSectionWithLoadingIndicator): Added.
(WI.ResourceDetailsSection.prototype.appendKeyValuePair): Added.

  • UserInterface/Views/ResourceDetailsSection.css:

(.resource-details > section > .details): Added.
(.resource-details > section > .details > .pair): Added.
(body[dir=rtl] .resource-details > section > .details > .pair): Added.
(.resource-details > section > .details > .pair > .key): Added.
(.resource-details > section > .details > .pair > .value): Added.
(body[dir] .resource-details > section.error > .details): Added.
(.resource-details > section.error > .details > .pair > .key): Added.
Move commonly used functions/styles from container classes onto this object.

  • UserInterface/Main.html:
  • Localizations/en.lproj/localizedStrings.js:

LayoutTests:

  • http/tests/inspector/network/resource-response-security-expected.txt: Added.
  • http/tests/inspector/network/resource-response-security.html: Added.
  • platform/gtk/TestExpectations:
  • platform/wincairo/TestExpectations:
  • platform/wpe/TestExpectations:
Location:
trunk
Files:
4 added
36 edited
3 copied
3 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r238121 r238122  
     12018-11-12  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Network: show secure certificate details per-request
     4        https://bugs.webkit.org/show_bug.cgi?id=191447
     5        <rdar://problem/30019476>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        * http/tests/inspector/network/resource-response-security-expected.txt: Added.
     10        * http/tests/inspector/network/resource-response-security.html: Added.
     11
     12        * platform/gtk/TestExpectations:
     13        * platform/wincairo/TestExpectations:
     14        * platform/wpe/TestExpectations:
     15
    1162018-11-12  Matt Baker  <mattbaker@apple.com>
    217
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r238071 r238122  
    19781978
    19791979webkit.org/b/186847 http/tests/inspector/network/resource-sizes-memory-cache.html [ Pass Failure ]
     1980webkit.org/b/191497 http/tests/inspector/network/resource-response-security.html [ Skip ]
    19801981
    19811982webkit.org/b/186851 imported/w3c/web-platform-tests/xhr/formdata.htm [ Pass Failure ]
  • trunk/LayoutTests/platform/wincairo/TestExpectations

    r237941 r238122  
    998998
    999999http/tests/xmlviewer [ Skip ]
     1000
     1001webkit.org/b/191498 http/tests/inspector/network/resource-response-security.html [ Skip ]
    10001002
    10011003#///////////////////////////////////////////////////////////////////////////////
  • trunk/LayoutTests/platform/wpe/TestExpectations

    r237861 r238122  
    533533
    534534Bug(WPE) fast/dom/HTMLAnchorElement [ Skip ]
     535
     536webkit.org/b/191497 http/tests/inspector/network/resource-response-security.html [ Skip ]
    535537
    536538#////////////////////////////////////////////////////////////////////////////////////////
  • trunk/Source/JavaScriptCore/CMakeLists.txt

    r238016 r238122  
    10841084    ${JAVASCRIPTCORE_DIR}/inspector/protocol/Runtime.json
    10851085    ${JAVASCRIPTCORE_DIR}/inspector/protocol/ScriptProfiler.json
     1086    ${JAVASCRIPTCORE_DIR}/inspector/protocol/Security.json
    10861087    ${JAVASCRIPTCORE_DIR}/inspector/protocol/Timeline.json
    10871088    ${JAVASCRIPTCORE_DIR}/inspector/protocol/Worker.json
  • trunk/Source/JavaScriptCore/ChangeLog

    r238109 r238122  
     12018-11-12  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Network: show secure certificate details per-request
     4        https://bugs.webkit.org/show_bug.cgi?id=191447
     5        <rdar://problem/30019476>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        Add Security domain to hold security related protocol types.
     10
     11        * CMakeLists.txt:
     12        * DerivedSources.make:
     13        * inspector/protocol/Network.json:
     14        * inspector/protocol/Security.json: Added.
     15        * inspector/scripts/codegen/objc_generator.py:
     16        (ObjCGenerator):
     17
    1182018-11-12  Saam barati  <sbarati@apple.com>
    219
  • trunk/Source/JavaScriptCore/DerivedSources.make

    r238008 r238122  
    239239    $(JavaScriptCore)/inspector/protocol/Runtime.json \
    240240    $(JavaScriptCore)/inspector/protocol/ScriptProfiler.json \
     241    $(JavaScriptCore)/inspector/protocol/Security.json \
    241242    $(JavaScriptCore)/inspector/protocol/Timeline.json \
    242243    $(JavaScriptCore)/inspector/protocol/Worker.json \
  • trunk/Source/JavaScriptCore/inspector/protocol/Network.json

    r236995 r238122  
    7373                { "name": "statusText", "type": "string", "description": "HTTP response status text." },
    7474                { "name": "headers", "$ref": "Headers", "description": "HTTP response headers." },
    75                 { "name": "headersText", "type": "string", "optional": true, "description": "HTTP response headers text." },
    7675                { "name": "mimeType", "type": "string", "description": "Resource mimeType as determined by the browser." },
    7776                { "name": "source", "type": "string", "enum": ["unknown", "network", "memory-cache", "disk-cache", "service-worker"], "description": "Specifies where the response came from." },
    7877                { "name": "requestHeaders", "$ref": "Headers", "optional": true, "description": "Refined HTTP request headers that were actually transmitted over the network." },
    79                 { "name": "requestHeadersText", "type": "string", "optional": true, "description": "HTTP request headers text." },
    80                 { "name": "timing", "$ref": "ResourceTiming", "optional": true, "description": "Timing information for the given request." }
     78                { "name": "timing", "$ref": "ResourceTiming", "optional": true, "description": "Timing information for the given request." },
     79                { "name": "security", "$ref": "Security.Security", "optional": true, "description": "The security information for the given request." }
    8180            ]
    8281        },
  • trunk/Source/JavaScriptCore/inspector/scripts/codegen/objc_generator.py

    r236321 r238122  
    123123    # Generate ObjC types, command handlers, and event dispatchers for a subset of domains.
    124124
    125     DOMAINS_TO_GENERATE = ['CSS', 'DOM', 'DOMStorage', 'Network', 'Page', 'Automation', 'GenericTypes']
     125    DOMAINS_TO_GENERATE = ['CSS', 'DOM', 'DOMStorage', 'Network', 'Security', 'Page', 'Automation', 'GenericTypes']
    126126
    127127    def should_generate_types_for_domain(self, domain):
  • trunk/Source/WebCore/ChangeLog

    r238119 r238122  
     12018-11-12  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Network: show secure certificate details per-request
     4        https://bugs.webkit.org/show_bug.cgi?id=191447
     5        <rdar://problem/30019476>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        Test: http/tests/inspector/network/resource-response-security.html
     10
     11        * loader/ResourceLoader.h:
     12        (WebCore::ResourceLoader::shouldIncludeCertificateInfo const):
     13        * loader/ResourceLoader.cpp:
     14        (WebCore::ResourceLoader::shouldIncludeCertificateInfo const): Added.
     15        Always save certificate information when WebInspector is open.
     16
     17        * platform/network/CertificateInfoBase.h: Added.
     18        (WebCore::CertificateInfoBase::containsNonRootSHA1SignedCertificate const):
     19        (WebCore::CertificateInfoBase::summaryInfo const):
     20        (WebCore::CertificateInfoBase::isEmpty const):
     21        * platform/network/cf/CertificateInfo.h:
     22        (WebCore::CertificateInfo::summaryInfo const): Added.
     23        * platform/network/cf/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm.
     24        (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
     25        (WebCore::CertificateInfo::summaryInfo const): Added.
     26        * platform/network/curl/CertificateInfo.h:
     27        (WebCore::CertificateInfo::summaryInfo const): Added.
     28        (WebCore::CertificateInfo::isEmpty const): Added.
     29        * platform/network/soup/CertificateInfo.h:
     30        (WebCore::CertificateInfo::summaryInfo const): Added.
     31        (WebCore::CertificateInfo::isEmpty const): Added.
     32        Create base class for `CertificateInfo` so that `InspectorNetworkAgent` doesn't need to have
     33        platform-specific code in its implementation.
     34
     35        * platform/network/cocoa/CertificateInfoCocoa.mm: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm.
     36        * platform/network/curl/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/curl/CertificateInfo.cpp.
     37        * platform/network/soup/CertificateInfoSoup.cpp: Renamed from Source/WebCore/platform/network/soup/CertificateInfo.cpp.
     38
     39        * inspector/NetworkResourcesData.h:
     40        (WebCore::NetworkResourcesData::ResourceData::certificateInfo const): Added.
     41        (WebCore::NetworkResourcesData::ResourceData::setCertificateInfo): Added.
     42        * inspector/NetworkResourcesData.cpp:
     43        (WebCore::NetworkResourcesData::responseReceived):
     44
     45        * inspector/agents/InspectorNetworkAgent.cpp:
     46        (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
     47
     48        * PlatformAppleWin.cmake:
     49        * PlatformMac.cmake:
     50        * SourcesCocoa.txt:
     51        * WebCore.xcodeproj/project.pbxproj:
     52        * platform/Curl.cmake:
     53        * platform/SourcesSoup.txt:
     54
    1552018-11-12  Zalan Bujtas  <zalan@apple.com>
    256
  • trunk/Source/WebCore/PlatformAppleWin.cmake

    r237636 r238122  
    4848
    4949    platform/network/cf/AuthenticationCF.cpp
     50    platform/network/cf/CertificateInfoCFNet.cpp
    5051    platform/network/cf/CookieStorageCFNet.cpp
    5152    platform/network/cf/CredentialStorageCFNet.cpp
  • trunk/Source/WebCore/PlatformMac.cmake

    r237636 r238122  
    415415    platform/mediastream/mac/MockRealtimeVideoSourceMac.mm
    416416
     417    platform/network/cf/CertificateInfoCFNet.cpp
    417418    platform/network/cf/DNSResolveQueueCFNet.cpp
    418419    platform/network/cf/FormDataStreamCFNet.cpp
     
    434435    platform/network/mac/AuthenticationMac.mm
    435436    platform/network/mac/BlobDataFileReferenceMac.mm
    436     platform/network/mac/CertificateInfoMac.mm
    437437    platform/network/mac/CookieStorageMac.mm
    438438    platform/network/mac/CredentialStorageMac.mm
  • trunk/Source/WebCore/SourcesCocoa.txt

    r238014 r238122  
    495495platform/mock/MediaPlaybackTargetMock.cpp
    496496
     497platform/network/cf/CertificateInfoCFNet.cpp
    497498platform/network/cf/DNSResolveQueueCFNet.cpp
    498499platform/network/cf/FormDataStreamCFNet.cpp
     
    502503platform/network/cf/SocketStreamHandleImplCFNet.cpp
    503504
     505platform/network/cocoa/CertificateInfoCocoa.mm
    504506platform/network/cocoa/CookieCocoa.mm
    505507platform/network/cocoa/CookieStorageObserver.mm
     
    518520platform/network/mac/AuthenticationMac.mm
    519521platform/network/mac/BlobDataFileReferenceMac.mm
    520 platform/network/mac/CertificateInfoMac.mm
    521522platform/network/mac/CookieStorageMac.mm
    522523platform/network/mac/CredentialStorageMac.mm
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r238084 r238122  
    25612561                9001774112E0347800648462 /* OESStandardDerivatives.h in Headers */ = {isa = PBXBuildFile; fileRef = 9001773E12E0347800648462 /* OESStandardDerivatives.h */; };
    25622562                9001788112E0370700648462 /* JSOESStandardDerivatives.h in Headers */ = {isa = PBXBuildFile; fileRef = 9001787F12E0370700648462 /* JSOESStandardDerivatives.h */; };
     2563                91B8F0B521953D65000C2B00 /* CertificateInfoBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 91B8F0B321953D65000C2B00 /* CertificateInfoBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
    25632564                91B952241F58A58F00931DC2 /* RecordingSwizzleTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 91B952221F58A58000931DC2 /* RecordingSwizzleTypes.h */; };
    25642565                91C9F2F91AE3BEB00095B61C /* AXTextStateChangeIntent.h in Headers */ = {isa = PBXBuildFile; fileRef = 91C9F2F81AE3BE240095B61C /* AXTextStateChangeIntent.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    89688969                5EBB89301C7777E100C65D41 /* IceCandidate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IceCandidate.h; sourceTree = "<group>"; };
    89698970                5EBB89381C77BDA400C65D41 /* PeerMediaDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PeerMediaDescription.h; sourceTree = "<group>"; };
    8970                 5F2DBBE7178E332D00141486 /* CertificateInfoMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CertificateInfoMac.mm; sourceTree = "<group>"; };
     8971                5F2DBBE7178E332D00141486 /* CertificateInfoCFNet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CertificateInfoCFNet.cpp; sourceTree = "<group>"; };
    89718972                5F2DBBE8178E336900141486 /* CertificateInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CertificateInfo.h; sourceTree = "<group>"; };
    89728973                5FC7DC26CFE2563200B85AE5 /* JSEventTarget.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSEventTarget.h; sourceTree = "<group>"; };
     
    1037310374                9001787E12E0370700648462 /* JSOESStandardDerivatives.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSOESStandardDerivatives.cpp; sourceTree = "<group>"; };
    1037410375                9001787F12E0370700648462 /* JSOESStandardDerivatives.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSOESStandardDerivatives.h; sourceTree = "<group>"; };
     10376                91B8F0B321953D65000C2B00 /* CertificateInfoBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CertificateInfoBase.h; sourceTree = "<group>"; };
    1037510377                91B952221F58A58000931DC2 /* RecordingSwizzleTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RecordingSwizzleTypes.h; sourceTree = "<group>"; };
    1037610378                91C9F2F81AE3BE240095B61C /* AXTextStateChangeIntent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AXTextStateChangeIntent.h; sourceTree = "<group>"; };
     
    1960119603                                E43AF8E41AC5B7DD00CA717E /* CacheValidation.cpp */,
    1960219604                                E43AF8E51AC5B7DD00CA717E /* CacheValidation.h */,
     19605                                91B8F0B321953D65000C2B00 /* CertificateInfoBase.h */,
    1960319606                                7A56996E2086C618000E0433 /* CookieRequestHeaderFieldProxy.h */,
    1960419607                                E13F01EA1270E10D00DFBA71 /* CookieStorage.h */,
     
    1967419677                                514C76430CE9234E007EF3CD /* AuthenticationMac.mm */,
    1967519678                                E164A2EB191AE6350010737D /* BlobDataFileReferenceMac.mm */,
    19676                                 5F2DBBE7178E332D00141486 /* CertificateInfoMac.mm */,
    1967719679                                E13F01F01270E19000DFBA71 /* CookieStorageMac.mm */,
    1967819680                                E1B4CD2410B322E200BFFD7E /* CredentialStorageMac.mm */,
     
    2441924421                                7EE6844E12D26E3800E79415 /* AuthenticationChallenge.h */,
    2442024422                                5F2DBBE8178E336900141486 /* CertificateInfo.h */,
     24423                                5F2DBBE7178E332D00141486 /* CertificateInfoCFNet.cpp */,
    2442124424                                B2F34FE80E82F82700F648CD /* DNSResolveQueueCFNet.cpp */,
    2442224425                                7EE6845C12D26E3800FF9415 /* DNSResolveQueueCFNet.h */,
     
    2802828031                                CDE595971BF26E2100A1CBE8 /* CDMSessionMediaSourceAVFObjC.h in Headers */,
    2802928032                                5FA904CA178E61F5004C8A2D /* CertificateInfo.h in Headers */,
     28033                                91B8F0B521953D65000C2B00 /* CertificateInfoBase.h in Headers */,
    2803028034                                E1A8E56717552B2A007488E7 /* CFURLExtras.h in Headers */,
    2803128035                                FE36FD1516C7826500F887C1 /* ChangeVersionData.h in Headers */,
  • trunk/Source/WebCore/inspector/NetworkResourcesData.cpp

    r237567 r238122  
    165165    if (InspectorNetworkAgent::shouldTreatAsText(response.mimeType()))
    166166        resourceData->setDecoder(InspectorNetworkAgent::createTextDecoder(response.mimeType(), response.textEncodingName()));
     167
     168    if (auto& certificateInfo = response.certificateInfo())
     169        resourceData->setCertificateInfo(certificateInfo);
    167170}
    168171
  • trunk/Source/WebCore/inspector/NetworkResourcesData.h

    r234702 r238122  
    8585        void setBuffer(RefPtr<SharedBuffer>&& buffer) { m_buffer = WTFMove(buffer); }
    8686
     87        const std::optional<CertificateInfo>& certificateInfo() const { return m_certificateInfo; }
     88        void setCertificateInfo(const std::optional<CertificateInfo>& certificateInfo) { m_certificateInfo = certificateInfo; }
     89
    8790        CachedResource* cachedResource() const { return m_cachedResource; }
    8891        void setCachedResource(CachedResource* cachedResource) { m_cachedResource = cachedResource; }
     
    108111        RefPtr<SharedBuffer> m_dataBuffer;
    109112        RefPtr<SharedBuffer> m_buffer;
     113        std::optional<CertificateInfo> m_certificateInfo;
    110114        CachedResource* m_cachedResource { nullptr };
    111115        InspectorPageAgent::ResourceType m_type { InspectorPageAgent::OtherResource };
  • trunk/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp

    r236995 r238122  
    3939#include "CachedResourceRequestInitiators.h"
    4040#include "CachedScript.h"
     41#include "CertificateInfo.h"
    4142#include "Document.h"
    4243#include "DocumentLoader.h"
     
    322323        responseObject->setTiming(buildObjectForTiming(response.deprecatedNetworkLoadMetrics(), *resourceLoader));
    323324
     325    if (auto& certificateInfo = response.certificateInfo()) {
     326        auto securityPayload = Inspector::Protocol::Security::Security::create()
     327            .release();
     328
     329        if (auto certificateSummaryInfo = certificateInfo.value().summaryInfo()) {
     330            auto certificatePayload = Inspector::Protocol::Security::Certificate::create()
     331                .release();
     332
     333            certificatePayload->setSubject(certificateSummaryInfo.value().subject);
     334
     335            if (auto validFrom = certificateSummaryInfo.value().validFrom)
     336                certificatePayload->setValidFrom(validFrom.seconds());
     337
     338            if (auto validUntil = certificateSummaryInfo.value().validUntil)
     339                certificatePayload->setValidUntil(validUntil.seconds());
     340
     341            auto dnsNamesPayload = JSON::ArrayOf<String>::create();
     342            for (auto& dnsName : certificateSummaryInfo.value().dnsNames)
     343                dnsNamesPayload->addItem(dnsName);
     344            if (dnsNamesPayload->length())
     345                certificatePayload->setDnsNames(WTFMove(dnsNamesPayload));
     346
     347            auto ipAddressesPayload = JSON::ArrayOf<String>::create();
     348            for (auto& ipAddress : certificateSummaryInfo.value().ipAddresses)
     349                ipAddressesPayload->addItem(ipAddress);
     350            if (ipAddressesPayload->length())
     351                certificatePayload->setDnsNames(WTFMove(ipAddressesPayload));
     352
     353            securityPayload->setCertificate(WTFMove(certificatePayload));
     354        }
     355
     356        responseObject->setSecurity(WTFMove(securityPayload));
     357    }
     358
    324359    return WTFMove(responseObject);
    325360}
  • trunk/Source/WebCore/loader/ResourceLoader.cpp

    r237266 r238122  
    718718}
    719719
     720bool ResourceLoader::shouldIncludeCertificateInfo() const
     721{
     722    if (m_options.certificateInfoPolicy == CertificateInfoPolicy::IncludeCertificateInfo)
     723        return true;
     724    if (UNLIKELY(InspectorInstrumentation::hasFrontends()))
     725        return true;
     726    return false;
     727}
     728
    720729void ResourceLoader::didReceiveAuthenticationChallenge(ResourceHandle* handle, const AuthenticationChallenge& challenge)
    721730{
  • trunk/Source/WebCore/loader/ResourceLoader.h

    r237266 r238122  
    128128    bool shouldSniffContentEncoding() const { return m_options.sniffContentEncoding == ContentEncodingSniffingPolicy::Sniff; }
    129129    WEBCORE_EXPORT bool isAllowedToAskUserForCredentials() const;
    130     bool shouldIncludeCertificateInfo() const { return m_options.certificateInfoPolicy == CertificateInfoPolicy::IncludeCertificateInfo; }
     130    WEBCORE_EXPORT bool shouldIncludeCertificateInfo() const;
    131131
    132132    bool reachedTerminalState() const { return m_reachedTerminalState; }
  • trunk/Source/WebCore/platform/Curl.cmake

    r237118 r238122  
    55list(APPEND WebCore_SOURCES
    66    platform/network/curl/AuthenticationChallengeCurl.cpp
    7     platform/network/curl/CertificateInfo.cpp
     7    platform/network/curl/CertificateInfoCurl.cpp
    88    platform/network/curl/CookieJarCurlDatabase.cpp
    99    platform/network/curl/CookieJarDB.cpp
  • trunk/Source/WebCore/platform/SourcesSoup.txt

    r234376 r238122  
    2323
    2424platform/network/soup/AuthenticationChallengeSoup.cpp
    25 platform/network/soup/CertificateInfo.cpp
     25platform/network/soup/CertificateInfoSoup.cpp
    2626platform/network/soup/CookieSoup.cpp
    2727platform/network/soup/CookieStorageSoup.cpp
  • trunk/Source/WebCore/platform/network/CertificateInfoBase.h

    r238121 r238122  
    11/*
    2  * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2018 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 .content-view.resource-details {
    27     position: absolute;
    28     top: 0;
    29     left: 0;
    30     right: 0;
    31     bottom: 0;
     26#pragma once
    3227
    33     padding: 12px 20px 0 20px;
    34     overflow: scroll;
     28#include <wtf/Optional.h>
     29#include <wtf/Seconds.h>
     30#include <wtf/Vector.h>
     31#include <wtf/text/WTFString.h>
    3532
    36     -webkit-user-select: text;
    37     white-space: nowrap;
    38 }
     33namespace WebCore {
     34
     35class CertificateInfoBase {
     36public:
     37    bool containsNonRootSHA1SignedCertificate() const { return false; };
     38
     39    struct SummaryInfo {
     40        String subject;
     41        Seconds validFrom;
     42        Seconds validUntil;
     43        Vector<String> dnsNames;
     44        Vector<String> ipAddresses;
     45    };
     46    std::optional<SummaryInfo> summaryInfo() const { return std::nullopt; };
     47
     48    bool isEmpty() const { return true; };
     49};
     50
     51} // namespace WebCore
  • trunk/Source/WebCore/platform/network/cf/CertificateInfo.h

    r228483 r238122  
    2727#define CertificateInfo_h
    2828
     29#include "CertificateInfoBase.h"
    2930#include <wtf/RetainPtr.h>
    3031
     
    3536namespace WebCore {
    3637
    37 class CertificateInfo {
     38class CertificateInfo : public CertificateInfoBase {
    3839public:
    3940     CertificateInfo() = default;
     
    6667    WEBCORE_EXPORT bool containsNonRootSHA1SignedCertificate() const;
    6768
     69    std::optional<SummaryInfo> summaryInfo() const;
     70
    6871    bool isEmpty() const { return type() == Type::None; }
    6972
     
    7376
    7477#ifndef NDEBUG
     78#if PLATFORM(COCOA)
    7579    void dump() const;
     80#endif
    7681#endif
    7782
  • trunk/Source/WebCore/platform/network/cf/CertificateInfoCFNet.cpp

    r238121 r238122  
    2424 */
    2525
    26 #import "config.h"
    27 #import "CertificateInfo.h"
     26#include "config.h"
     27#include "CertificateInfo.h"
    2828
    29 #import "NotImplemented.h"
    30 #import <wtf/cf/TypeCastsCF.h>
    31 #import <wtf/spi/cocoa/SecuritySPI.h>
     29#include "NotImplemented.h"
     30#include <wtf/cf/TypeCastsCF.h>
     31
     32#if PLATFORM(COCOA)
     33#include <Security/SecCertificate.h>
     34#include <wtf/spi/cocoa/SecuritySPI.h>
    3235
    3336WTF_DECLARE_CF_TYPE_TRAIT(SecCertificate);
     37#endif
    3438
    3539namespace WebCore {
     
    8589#endif
    8690
     91#if PLATFORM(COCOA)
    8792    if (m_certificateChain) {
    8893        // Allow only the root certificate (the last in the chain) to be SHA1.
     
    9499        return false;
    95100    }
     101#endif
    96102
    97103    return false;
    98104}
    99105
    100 #ifndef NDEBUG
    101 void CertificateInfo::dump() const
     106std::optional<CertificateInfo::SummaryInfo> CertificateInfo::summaryInfo() const
    102107{
    103 #if HAVE(SEC_TRUST_SERIALIZATION)
    104     if (m_trust) {
    105         CFIndex entries = SecTrustGetCertificateCount(trust());
     108    auto chain = certificateChain();
     109    if (!chain)
     110        return std::nullopt;
    106111
    107         NSLog(@"CertificateInfo SecTrust\n");
    108         NSLog(@"  Entries: %ld\n", entries);
    109         for (CFIndex i = 0; i < entries; ++i) {
    110             RetainPtr<CFStringRef> summary = adoptCF(SecCertificateCopySubjectSummary(SecTrustGetCertificateAtIndex(trust(), i)));
    111             NSLog(@"  %@", (__bridge NSString *)summary.get());
     112    SummaryInfo summaryInfo;
     113
     114#if PLATFORM(COCOA) && !PLATFORM(IOS_FAMILY_SIMULATOR) && !PLATFORM(IOSMAC)
     115    auto leafCertificate = checked_cf_cast<SecCertificateRef>(CFArrayGetValueAtIndex(chain, 0));
     116
     117    auto subjectCF = adoptCF(SecCertificateCopySubjectSummary(leafCertificate));
     118    summaryInfo.subject = subjectCF.get();
     119#endif
     120
     121#if PLATFORM(MAC)
     122    if (auto certificateDictionary = adoptCF(SecCertificateCopyValues(leafCertificate, nullptr, nullptr))) {
     123        // CFAbsoluteTime is relative to 01/01/1970 00:00:00 GMT.
     124        const Seconds absoluteReferenceDate(978307200);
     125
     126        if (auto validNotBefore = checked_cf_cast<CFDictionaryRef>(CFDictionaryGetValue(certificateDictionary.get(), kSecOIDX509V1ValidityNotBefore))) {
     127            if (auto number = checked_cf_cast<CFNumberRef>(CFDictionaryGetValue(validNotBefore, CFSTR("value")))) {
     128                double numberValue;
     129                if (CFNumberGetValue(number, kCFNumberDoubleType, &numberValue))
     130                    summaryInfo.validFrom = absoluteReferenceDate + Seconds(numberValue);
     131            }
    112132        }
    113133
    114         return;
     134        if (auto validNotAfter = checked_cf_cast<CFDictionaryRef>(CFDictionaryGetValue(certificateDictionary.get(), kSecOIDX509V1ValidityNotAfter))) {
     135            if (auto number = checked_cf_cast<CFNumberRef>(CFDictionaryGetValue(validNotAfter, CFSTR("value")))) {
     136                double numberValue;
     137                if (CFNumberGetValue(number, kCFNumberDoubleType, &numberValue))
     138                    summaryInfo.validUntil = absoluteReferenceDate + Seconds(numberValue);
     139            }
     140        }
     141
     142        if (auto dnsNames = checked_cf_cast<CFDictionaryRef>(CFDictionaryGetValue(certificateDictionary.get(), CFSTR("DNSNAMES")))) {
     143            if (auto dnsNamesArray = checked_cf_cast<CFArrayRef>(CFDictionaryGetValue(dnsNames, CFSTR("value")))) {
     144                for (CFIndex i = 0, count = CFArrayGetCount(dnsNamesArray); i < count; ++i) {
     145                    if (auto dnsName = checked_cf_cast<CFStringRef>(CFArrayGetValueAtIndex(dnsNamesArray, i)))
     146                        summaryInfo.dnsNames.append(dnsName);
     147                }
     148            }
     149        }
     150
     151        if (auto ipAddresses = checked_cf_cast<CFDictionaryRef>(CFDictionaryGetValue(certificateDictionary.get(), CFSTR("IPADDRESSES")))) {
     152            if (auto ipAddressesArray = checked_cf_cast<CFArrayRef>(CFDictionaryGetValue(ipAddresses, CFSTR("value")))) {
     153                for (CFIndex i = 0, count = CFArrayGetCount(ipAddressesArray); i < count; ++i) {
     154                    if (auto ipAddress = checked_cf_cast<CFStringRef>(CFArrayGetValueAtIndex(ipAddressesArray, i)))
     155                        summaryInfo.ipAddresses.append(ipAddress);
     156                }
     157            }
     158        }
    115159    }
    116160#endif
    117     if (m_certificateChain) {
    118         CFIndex entries = CFArrayGetCount(m_certificateChain.get());
    119161
    120         NSLog(@"CertificateInfo (Certificate Chain)\n");
    121         NSLog(@"  Entries: %ld\n", entries);
    122         for (CFIndex i = 0; i < entries; ++i) {
    123             RetainPtr<CFStringRef> summary = adoptCF(SecCertificateCopySubjectSummary(checked_cf_cast<SecCertificateRef>(CFArrayGetValueAtIndex(m_certificateChain.get(), i))));
    124             NSLog(@"  %@", (__bridge NSString *)summary.get());
    125         }
    126 
    127         return;
    128     }
    129    
    130     NSLog(@"CertificateInfo (Empty)\n");
     162    return summaryInfo;
    131163}
    132 #endif
    133164
    134165} // namespace WebCore
  • trunk/Source/WebCore/platform/network/cocoa/CertificateInfoCocoa.mm

    r238121 r238122  
    2424 */
    2525
    26 #import "config.h"
    27 #import "CertificateInfo.h"
     26#include "config.h"
     27#include "CertificateInfo.h"
    2828
    29 #import "NotImplemented.h"
    30 #import <wtf/cf/TypeCastsCF.h>
    31 #import <wtf/spi/cocoa/SecuritySPI.h>
     29#include <Security/SecCertificate.h>
     30#include <wtf/cf/TypeCastsCF.h>
     31#include <wtf/spi/cocoa/SecuritySPI.h>
    3232
    3333WTF_DECLARE_CF_TYPE_TRAIT(SecCertificate);
    3434
    3535namespace WebCore {
    36 
    37 #if PLATFORM(COCOA)
    38 RetainPtr<CFArrayRef> CertificateInfo::certificateChainFromSecTrust(SecTrustRef trust)
    39 {
    40     auto count = SecTrustGetCertificateCount(trust);
    41     auto certificateChain = CFArrayCreateMutable(0, count, &kCFTypeArrayCallBacks);
    42     for (CFIndex i = 0; i < count; i++)
    43         CFArrayAppendValue(certificateChain, SecTrustGetCertificateAtIndex(trust, i));
    44     return adoptCF((CFArrayRef)certificateChain);
    45 }
    46 #endif
    47 
    48 CertificateInfo::Type CertificateInfo::type() const
    49 {
    50 #if HAVE(SEC_TRUST_SERIALIZATION)
    51     if (m_trust)
    52         return Type::Trust;
    53 #endif
    54     if (m_certificateChain)
    55         return Type::CertificateChain;
    56     return Type::None;
    57 }
    58 
    59 CFArrayRef CertificateInfo::certificateChain() const
    60 {
    61 #if HAVE(SEC_TRUST_SERIALIZATION)
    62     if (m_certificateChain)
    63         return m_certificateChain.get();
    64 
    65     if (m_trust)
    66         m_certificateChain = CertificateInfo::certificateChainFromSecTrust(m_trust.get());
    67 #endif
    68 
    69     return m_certificateChain.get();
    70 }
    71 
    72 bool CertificateInfo::containsNonRootSHA1SignedCertificate() const
    73 {
    74 #if HAVE(SEC_TRUST_SERIALIZATION)
    75     if (m_trust) {
    76         // Allow only the root certificate (the last in the chain) to be SHA1.
    77         for (CFIndex i = 0, size = SecTrustGetCertificateCount(trust()) - 1; i < size; ++i) {
    78             auto certificate = SecTrustGetCertificateAtIndex(trust(), i);
    79             if (SecCertificateGetSignatureHashAlgorithm(certificate) == kSecSignatureHashAlgorithmSHA1)
    80                 return true;
    81         }
    82 
    83         return false;
    84     }
    85 #endif
    86 
    87     if (m_certificateChain) {
    88         // Allow only the root certificate (the last in the chain) to be SHA1.
    89         for (CFIndex i = 0, size = CFArrayGetCount(m_certificateChain.get()) - 1; i < size; ++i) {
    90             auto certificate = checked_cf_cast<SecCertificateRef>(CFArrayGetValueAtIndex(m_certificateChain.get(), i));
    91             if (SecCertificateGetSignatureHashAlgorithm(certificate) == kSecSignatureHashAlgorithmSHA1)
    92                 return true;
    93         }
    94         return false;
    95     }
    96 
    97     return false;
    98 }
    9936
    10037#ifndef NDEBUG
     
    12764        return;
    12865    }
    129    
     66
    13067    NSLog(@"CertificateInfo (Empty)\n");
    13168}
  • trunk/Source/WebCore/platform/network/curl/CertificateInfo.h

    r233919 r238122  
    2626#pragma once
    2727
     28#include "CertificateInfoBase.h"
    2829#include "NotImplemented.h"
    2930#include <wtf/Vector.h>
     
    3132namespace WebCore {
    3233
    33 class CertificateInfo {
     34class CertificateInfo : public CertificateInfoBase {
    3435public:
    3536    using Certificate = Vector<uint8_t>;
     
    4445
    4546    bool containsNonRootSHA1SignedCertificate() const { notImplemented(); return false; }
     47
     48    std::optional<SummaryInfo> summaryInfo() const { notImplemented(); return std::nullopt; }
     49
     50    bool isEmpty() const { return m_certificateChain.isEmpty(); }
    4651
    4752    static Certificate makeCertificate(const char*, size_t);
  • trunk/Source/WebCore/platform/network/soup/CertificateInfo.h

    r185502 r238122  
    2828#define CertificateInfo_h
    2929
     30#include "CertificateInfoBase.h"
    3031#include "NotImplemented.h"
    3132#include <libsoup/soup.h>
     
    3738class ResourceResponse;
    3839
    39 class CertificateInfo {
     40class CertificateInfo  : public CertificateInfoBase {
    4041public:
    4142    CertificateInfo();
     
    5253    bool containsNonRootSHA1SignedCertificate() const { notImplemented(); return false; }
    5354
     55    std::optional<SummaryInfo> summaryInfo() const { notImplemented(); return std::nullopt; }
     56
     57    bool isEmpty() const { return !m_certificate; }
     58
    5459private:
    5560    GRefPtr<GTlsCertificate> m_certificate;
  • trunk/Source/WebInspectorUI/ChangeLog

    r238121 r238122  
     12018-11-12  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Network: show secure certificate details per-request
     4        https://bugs.webkit.org/show_bug.cgi?id=191447
     5        <rdar://problem/30019476>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        * UserInterface/Controllers/NetworkManager.js:
     10        (WI.NetworkManager.prototype.resourceRequestWasServedFromMemoryCache):
     11        (WI.NetworkManager.prototype.resourceRequestDidReceiveResponse):
     12
     13        * UserInterface/Models/Resource.js:
     14        (WI.Resource.prototype.get responseSecurity): Added.
     15        (WI.Resource.prototype.get loadedSecurely): Added.
     16        (WI.Resource.prototype.updateForResponse):
     17
     18        * UserInterface/Views/NetworkResourceDetailView.js:
     19        (WI.NetworkResourceDetailView):
     20        (WI.NetworkResourceDetailView.prototype.initialLayout):
     21        (WI.NetworkResourceDetailView.prototype.showContentViewForIdentifier):
     22        * UserInterface/Views/NetworkResourceDetailView.css:
     23        (.content-view.resource-details .go-to-arrow): Added.
     24        (.content-view.resource-details.showing-find-banner .search-highlight): Added.
     25
     26        * UserInterface/Views/ResourceSecurityContentView.js: Added.
     27        (WI.ResourceSecurityContentView):
     28        (WI.ResourceSecurityContentView.prototype.initialLayout):
     29        (WI.ResourceSecurityContentView.prototype.layout):
     30        (WI.ResourceSecurityContentView.prototype.closed):
     31        (WI.ResourceSecurityContentView.prototype.get supportsSearch):
     32        (WI.ResourceSecurityContentView.prototype.get numberOfSearchResults):
     33        (WI.ResourceSecurityContentView.prototype.get hasPerformedSearch):
     34        (WI.ResourceSecurityContentView.prototype.set automaticallyRevealFirstSearchResult):
     35        (WI.ResourceSecurityContentView.prototype.performSearch):
     36        (WI.ResourceSecurityContentView.prototype.searchCleared):
     37        (WI.ResourceSecurityContentView.prototype.revealPreviousSearchResult):
     38        (WI.ResourceSecurityContentView.prototype.revealNextSearchResult):
     39        (WI.ResourceSecurityContentView.prototype._refreshCetificateSection):
     40        (WI.ResourceSecurityContentView.prototype._perfomSearchOnKeyValuePairs):
     41        (WI.ResourceSecurityContentView.prototype._revealSearchResult):
     42        (WI.ResourceSecurityContentView.prototype._handleResourceResponseReceived):
     43        * UserInterface/Views/ResourceSecurityContentView.css: Added.
     44        (body[dir] .resource-security > section.certificate > .details):
     45        (.resource-security .details .key):
     46        (.resource-security .dns-name + .dns-name > .key,):
     47        (.resource-security .show-more):
     48        (@media (prefers-dark-interface) body[dir] .resource-security > section.certificate > .details):
     49        (@media (prefers-dark-interface) .resource-security .details .key):
     50
     51        * UserInterface/Views/ResourceCookiesContentView.js:
     52        (WI.ResourceCookiesContentView.prototype._refreshRequestCookiesSection):
     53        (WI.ResourceCookiesContentView.prototype._refreshResponseCookiesSection):
     54        (WI.ResourceCookiesContentView.prototype._markIncompleteSectionWithMessage): Deleted.
     55        (WI.ResourceCookiesContentView.prototype._markIncompleteSectionWithLoadingIndicator): Deleted.
     56        * UserInterface/Views/ResourceHeadersContentView.js:
     57        (WI.ResourceHeadersContentView.prototype._refreshSummarySection):
     58        (WI.ResourceHeadersContentView.prototype._refreshRedirectHeadersSections):
     59        (WI.ResourceHeadersContentView.prototype._refreshRequestHeadersSection):
     60        (WI.ResourceHeadersContentView.prototype._refreshResponseHeadersSection):
     61        (WI.ResourceHeadersContentView.prototype._refreshQueryStringSection):
     62        (WI.ResourceHeadersContentView.prototype._refreshRequestDataSection):
     63        (WI.ResourceHeadersContentView.prototype._markIncompleteSectionWithMessage): Deleted.
     64        (WI.ResourceHeadersContentView.prototype._markIncompleteSectionWithLoadingIndicator): Deleted.
     65        (WI.ResourceHeadersContentView.prototype._appendKeyValuePair): Deleted.
     66        * UserInterface/Views/ResourceHeadersContentView.css:
     67        (.resource-headers .h1-status > .key,):
     68        (body[dir] .resource-headers > section.error > .details): Deleted.
     69        (.resource-headers > section.error .key): Deleted.
     70        (.resource-headers .details): Deleted.
     71        (.resource-headers .details .pair): Deleted.
     72        (body[dir=rtl] .resource-headers .details .pair): Deleted.
     73        (.resource-headers .details .key): Deleted.
     74        (.resource-headers .value): Deleted.
     75        (.resource-headers .go-to-arrow): Deleted.
     76        (.resource-headers.showing-find-banner .search-highlight): Deleted.
     77        * UserInterface/Views/ResourceDetailsSection.js:
     78        (WI.ResourceDetailsSection.prototype.markIncompleteSectionWithMessage): Added.
     79        (WI.ResourceDetailsSection.prototype.markIncompleteSectionWithLoadingIndicator): Added.
     80        (WI.ResourceDetailsSection.prototype.appendKeyValuePair): Added.
     81        * UserInterface/Views/ResourceDetailsSection.css:
     82        (.resource-details > section > .details): Added.
     83        (.resource-details > section > .details > .pair): Added.
     84        (body[dir=rtl] .resource-details > section > .details > .pair): Added.
     85        (.resource-details > section > .details > .pair > .key): Added.
     86        (.resource-details > section > .details > .pair > .value): Added.
     87        (body[dir] .resource-details > section.error > .details): Added.
     88        (.resource-details > section.error > .details > .pair > .key): Added.
     89        Move commonly used functions/styles from container classes onto this object.
     90
     91        * UserInterface/Main.html:
     92        * Localizations/en.lproj/localizedStrings.js:
     93
    1942018-11-12  Matt Baker  <mattbaker@apple.com>
    295
  • trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js

    r237808 r238122  
    177177localizedStrings["Catch Variables"] = "Catch Variables";
    178178localizedStrings["Categories"] = "Categories";
     179localizedStrings["Certificate"] = "Certificate";
    179180localizedStrings["Character Data"] = "Character Data";
    180181localizedStrings["Charge ‘%s’ to Callers"] = "Charge ‘%s’ to Callers";
     
    462463localizedStrings["Highest: %s"] = "Highest: %s";
    463464localizedStrings["Host"] = "Host";
     465localizedStrings["IP"] = "IP";
    464466localizedStrings["IP Address"] = "IP Address";
    465467localizedStrings["Identity"] = "Identity";
     
    602604localizedStrings["No response cookies."] = "No response cookies.";
    603605localizedStrings["No response headers"] = "No response headers";
     606localizedStrings["No response security certificate."] = "No response security certificate.";
     607localizedStrings["No response security information."] = "No response security information.";
    604608localizedStrings["Node"] = "Node";
    605609localizedStrings["Node Removed"] = "Node Removed";
     
    767771localizedStrings["Search Resource Content"] = "Search Resource Content";
    768772localizedStrings["Secure"] = "Secure";
     773localizedStrings["Security"] = "Security";
    769774localizedStrings["Security Issue"] = "Security Issue";
    770775localizedStrings["Security Origin"] = "Security Origin";
     
    876881localizedStrings["Stylesheet"] = "Stylesheet";
    877882localizedStrings["Stylesheets"] = "Stylesheets";
     883localizedStrings["Subject"] = "Subject";
    878884localizedStrings["Subtree Modified"] = "Subtree Modified";
    879885localizedStrings["Summary"] = "Summary";
     
    888894localizedStrings["Text Node"] = "Text Node";
    889895localizedStrings["The page's content has changed"] = "The page's content has changed";
     896localizedStrings["The resource was requested insecurely."] = "The resource was requested insecurely.";
    890897localizedStrings["The “%s“ audit failed"] = "The “%s“ audit failed";
    891898localizedStrings["The “%s“ audit is unsupported"] = "The “%s“ audit is unsupported";
     
    946953localizedStrings["User Interface:"] = "User Interface:";
    947954localizedStrings["User Stylesheet"] = "User Stylesheet";
     955localizedStrings["Valid From"] = "Valid From";
     956localizedStrings["Valid Until"] = "Valid Until";
    948957localizedStrings["Value"] = "Value";
    949958localizedStrings["Variables"] = "Variables";
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js

    r238048 r238122  
    420420            initiatorNode: this._initiatorNodeFromPayload(initiator),
    421421        });
    422         resource.updateForResponse(cachedResourcePayload.url, response.mimeType, cachedResourcePayload.type, response.headers, response.status, response.statusText, elapsedTime, response.timing, responseSource);
     422        resource.updateForResponse(cachedResourcePayload.url, response.mimeType, cachedResourcePayload.type, response.headers, response.status, response.statusText, elapsedTime, response.timing, responseSource, response.security);
    423423        resource.increaseSize(cachedResourcePayload.bodySize, elapsedTime);
    424424        resource.increaseTransferSize(cachedResourcePayload.bodySize);
     
    482482            resource.legacyMarkServedFromDiskCache();
    483483
    484         resource.updateForResponse(response.url, response.mimeType, type, response.headers, response.status, response.statusText, elapsedTime, response.timing, response.source);
     484        resource.updateForResponse(response.url, response.mimeType, type, response.headers, response.status, response.statusText, elapsedTime, response.timing, response.source, response.security);
    485485    }
    486486
  • trunk/Source/WebInspectorUI/UserInterface/Main.html

    r237997 r238122  
    165165    <link rel="stylesheet" href="Views/ResourceHeadersContentView.css">
    166166    <link rel="stylesheet" href="Views/ResourceIcons.css">
     167    <link rel="stylesheet" href="Views/ResourceSecurityContentView.css">
    167168    <link rel="stylesheet" href="Views/ResourceSizesContentView.css">
    168169    <link rel="stylesheet" href="Views/ResourceSidebarPanel.css">
     
    726727    <script src="Views/ResourceDetailsSidebarPanel.js"></script>
    727728    <script src="Views/ResourceHeadersContentView.js"></script>
     729    <script src="Views/ResourceSecurityContentView.js"></script>
    728730    <script src="Views/ResourceSidebarPanel.js"></script>
    729731    <script src="Views/ResourceSizesContentView.js"></script>
  • trunk/Source/WebInspectorUI/UserInterface/Models/Resource.js

    r237151 r238122  
    7171        this._receivedNetworkLoadMetrics = false;
    7272        this._responseSource = WI.Resource.ResponseSource.Unknown;
     73        this._responseSecurity = null;
    7374        this._timingData = new WI.ResourceTimingData(this);
    7475        this._protocol = null;
     
    307308    get statusText() { return this._statusText; }
    308309    get responseSource() { return this._responseSource; }
     310    get responseSecurity() { return this._responseSecurity; }
    309311    get timingData() { return this._timingData; }
    310312    get protocol() { return this._protocol; }
     
    339341    }
    340342
     343    get loadedSecurely()
     344    {
     345        if (this.urlComponents.scheme !== "https" && this.urlComponents.scheme !== "wss" && this.urlComponents.scheme !== "sftp")
     346            return false;
     347        if (isNaN(this._timingData.secureConnectionStart) && !isNaN(this._timingData.connectionStart))
     348            return false;
     349        return true;
     350    }
     351
    341352    get displayName()
    342353    {
     
    676687    }
    677688
    678     updateForResponse(url, mimeType, type, responseHeaders, statusCode, statusText, elapsedTime, timingData, source)
     689    updateForResponse(url, mimeType, type, responseHeaders, statusCode, statusText, elapsedTime, timingData, source, security)
    679690    {
    680691        console.assert(!this._finished);
     
    704715        if (source)
    705716            this._responseSource = WI.Resource.responseSourceFromPayload(source);
     717
     718        if (security)
     719            this._responseSecurity = security;
    706720
    707721        const headerBaseSize = 12; // Length of "HTTP/1.1 ", " ", and "\r\n".
  • trunk/Source/WebInspectorUI/UserInterface/Views/NetworkResourceDetailView.css

    r237028 r238122  
    3737    white-space: nowrap;
    3838}
     39
     40.content-view.resource-details .go-to-arrow {
     41    vertical-align: top;
     42    bottom: 1px;
     43}
     44
     45.content-view.resource-details.showing-find-banner .search-highlight {
     46    color: var(--text-color);
     47    background-color: hsla(53, 83%, 53%, 0.2);
     48    border-bottom: 1px solid hsl(47, 82%, 60%);
     49}
  • trunk/Source/WebInspectorUI/UserInterface/Views/NetworkResourceDetailView.js

    r237028 r238122  
    3939        this._sizesContentView = null;
    4040        this._timingContentView = null;
     41        this._securityContentView = null;
    4142    }
    4243
     
    9091        this.createDetailNavigationItem("sizes", WI.UIString("Sizes"));
    9192        this.createDetailNavigationItem("timing", WI.UIString("Timing"));
     93        this.createDetailNavigationItem("security", WI.UIString("Security"));
    9294
    9395        super.initialLayout();
     
    129131            this._contentBrowser.showContentView(this._timingContentView, this._contentViewCookie);
    130132            break;
     133        case "security":
     134            if (!this._securityContentView)
     135                this._securityContentView = new WI.ResourceSecurityContentView(this.representedObject);
     136            this._contentBrowser.showContentView(this._securityContentView, this._contentViewCookie);
     137            break;
    131138        }
    132139
  • trunk/Source/WebInspectorUI/UserInterface/Views/ResourceCookiesContentView.js

    r234822 r238122  
    120120    // Private
    121121
    122     _markIncompleteSectionWithMessage(section, message)
    123     {
    124         section.toggleIncomplete(true);
    125 
    126         let p = section.detailsElement.appendChild(document.createElement("p"));
    127         p.textContent = message;
    128     }
    129 
    130     _markIncompleteSectionWithLoadingIndicator(section)
    131     {
    132         section.toggleIncomplete(true);
    133 
    134         let p = section.detailsElement.appendChild(document.createElement("p"));
    135         let spinner = new WI.IndeterminateProgressSpinner;
    136         p.appendChild(spinner.element);
    137     }
    138 
    139122    _dataSourceForTable(table)
    140123    {
     
    207190
    208191        if (this._resource.responseSource === WI.Resource.ResponseSource.MemoryCache) {
    209             this._markIncompleteSectionWithMessage(this._requestCookiesSection, WI.UIString("No request, served from the memory cache."));
     192            this._requestCookiesSection.markIncompleteSectionWithMessage(WI.UIString("No request, served from the memory cache."));
    210193            return;
    211194        }
     
    226209            if (this._requestCookiesTable.isAttached)
    227210                this.removeSubview(this._requestCookiesTable);
    228             this._markIncompleteSectionWithMessage(this._requestCookiesSection, WI.UIString("No request cookies."));
     211            this._requestCookiesSection.markIncompleteSectionWithMessage(WI.UIString("No request cookies."));
    229212        } else {
    230213            this._requestCookiesSection.toggleIncomplete(false);
     
    242225
    243226        if (!this._resource.hasResponse()) {
    244             this._markIncompleteSectionWithLoadingIndicator(this._responseCookiesSection);
     227            this._responseCookiesSection.markIncompleteSectionWithLoadingIndicator();
    245228            return;
    246229        }
     
    268251            if (this._responseCookiesTable.isAttached)
    269252                this.removeSubview(this._responseCookiesTable);
    270             this._markIncompleteSectionWithMessage(this._responseCookiesSection, WI.UIString("No response cookies."));
     253            this._responseCookiesSection.markIncompleteSectionWithMessage(WI.UIString("No response cookies."));
    271254        } else {
    272255            this._responseCookiesSection.toggleIncomplete(false);
  • trunk/Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSection.css

    r224769 r238122  
    3535.resource-details > section > .details {
    3636    -webkit-margin-start: 10px;
     37    white-space: normal;
     38    word-break: break-all;
    3739}
    3840
     
    5557    border-color: var(--console-secondary-text-color) !important;
    5658}
     59
     60.resource-details > section > .details > .pair {
     61    --resource-details-value-indent: 15px;
     62    -webkit-margin-start: var(--resource-details-value-indent);
     63}
     64
     65body[dir=rtl] .resource-details > section > .details > .pair {
     66    /* Don't include indents in RTL */
     67    --resource-details-value-indent: 0px;
     68}
     69
     70.resource-details > section > .details > .pair > .key {
     71    font-weight: 500;
     72    -webkit-margin-start: calc(var(--resource-details-value-indent) * -1);
     73}
     74
     75.resource-details > section > .details > .pair > .value {
     76    color: var(--text-color);
     77}
     78
     79body[dir] .resource-details > section.error > .details {
     80    border-color: var(--network-error-color);
     81}
     82
     83.resource-details > section.error > .details > .pair > .key {
     84    color: var(--network-error-color);
     85}
  • trunk/Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSection.js

    r224733 r238122  
    6060        this.element.classList.toggle("error", isError);
    6161    }
     62
     63    markIncompleteSectionWithMessage(message)
     64    {
     65        this.toggleIncomplete(true);
     66
     67        let p = this._detailsElement.appendChild(document.createElement("p"));
     68        p.textContent = message;
     69    }
     70
     71    markIncompleteSectionWithLoadingIndicator()
     72    {
     73        this.toggleIncomplete(true);
     74
     75        let p = this._detailsElement.appendChild(document.createElement("p"));
     76        let spinner = new WI.IndeterminateProgressSpinner;
     77        p.appendChild(spinner.element);
     78    }
     79
     80    appendKeyValuePair(key, value, className)
     81    {
     82        let p = this._detailsElement.appendChild(document.createElement("p"));
     83        p.className = "pair";
     84        if (className)
     85            p.classList.add(className);
     86
     87        let keyElement = p.appendChild(document.createElement("span"));
     88        keyElement.className = "key";
     89
     90        console.assert(typeof key === "string" || key instanceof Node);
     91        if (key instanceof Node)
     92            keyElement.appendChild(key);
     93        else {
     94            // Don't include a colon if no value.
     95            keyElement.textContent = key + (value ? ": " : "");
     96
     97            let valueElement = p.appendChild(document.createElement("span"));
     98            valueElement.className = "value";
     99            if (value instanceof Node)
     100                valueElement.appendChild(value);
     101            else
     102                valueElement.textContent = value;
     103        }
     104
     105        return p;
     106    }
    62107};
  • trunk/Source/WebInspectorUI/UserInterface/Views/ResourceHeadersContentView.css

    r237085 r238122  
    3232}
    3333
    34 body[dir] .resource-headers > section.error > .details {
    35     border-color: var(--network-error-color);
    36 }
    37 
    38 .resource-headers > section.error .key {
    39     color: var(--network-error-color);
    40 }
    41 
    42 .resource-headers .details {
    43     white-space: normal;
    44     word-break: break-all;
    45 }
    46 
    47 .resource-headers .details .pair {
    48     --resource-headers-value-indent: 15px;
    49     -webkit-margin-start: var(--resource-headers-value-indent);
    50 }
    51 
    52 body[dir=rtl] .resource-headers .details .pair {
    53     /* Don't include indents in RTL */
    54     --resource-headers-value-indent: 0px;
    55 }
    56 
    57 .resource-headers .details .key {
    58     font-weight: 500;
    59     -webkit-margin-start: calc(var(--resource-headers-value-indent) * -1);
    60 }
    61 
    62 .resource-headers .value {
    63     color: var(--text-color);
    64 }
    65 
    6634.resource-headers .url + .url > .key {
    6735    color: transparent;
     
    8048    color: var(--network-pseudo-header-color);
    8149}
    82 
    83 .resource-headers .go-to-arrow {
    84     vertical-align: top;
    85     bottom: 1px;
    86 }
    87 
    88 .resource-headers.showing-find-banner .search-highlight {
    89     color: var(--text-color);
    90     background-color: hsla(53, 83%, 53%, 0.2);
    91     border-bottom: 1px solid hsl(47, 82%, 60%);
    92 }
  • trunk/Source/WebInspectorUI/UserInterface/Views/ResourceHeadersContentView.js

    r236995 r238122  
    212212    // Private
    213213
    214     _markIncompleteSectionWithMessage(section, message)
    215     {
    216         section.toggleIncomplete(true);
    217 
    218         let p = section.detailsElement.appendChild(document.createElement("p"));
    219         p.textContent = message;
    220     }
    221 
    222     _markIncompleteSectionWithLoadingIndicator(section)
    223     {
    224         section.toggleIncomplete(true);
    225 
    226         let p = section.detailsElement.appendChild(document.createElement("p"));
    227         let spinner = new WI.IndeterminateProgressSpinner;
    228         p.appendChild(spinner.element);
    229     }
    230 
    231     _appendKeyValuePair(parentElement, key, value, className)
    232     {
    233         let p = parentElement.appendChild(document.createElement("p"));
    234         p.className = "pair";
    235         if (className)
    236             p.classList.add(className);
    237 
    238         // Don't include a colon if no value.
    239         console.assert(typeof key === "string");
    240         let displayKey = key + (value ? ": " : "");
    241 
    242         let keyElement = p.appendChild(document.createElement("span"));
    243         keyElement.className = "key";
    244         keyElement.textContent = displayKey;
    245 
    246         let valueElement = p.appendChild(document.createElement("span"));
    247         valueElement.className = "value";
    248         if (value instanceof Node)
    249             valueElement.appendChild(value);
    250         else
    251             valueElement.textContent = value;
    252     }
    253 
    254214    _responseSourceDisplayString(responseSource)
    255215    {
     
    277237
    278238        for (let redirect of this._resource.redirects)
    279             this._appendKeyValuePair(detailsElement, WI.UIString("URL"), redirect.url.insertWordBreakCharacters(), "url");
    280         this._appendKeyValuePair(detailsElement, WI.UIString("URL"), this._resource.url.insertWordBreakCharacters(), "url");
     239            this._summarySection.appendKeyValuePair(WI.UIString("URL"), redirect.url.insertWordBreakCharacters(), "url");
     240        this._summarySection.appendKeyValuePair(WI.UIString("URL"), this._resource.url.insertWordBreakCharacters(), "url");
    281241
    282242        let status = emDash;
    283243        if (!isNaN(this._resource.statusCode))
    284244            status = this._resource.statusCode + (this._resource.statusText ? " " + this._resource.statusText : "");
    285         this._appendKeyValuePair(detailsElement, WI.UIString("Status"), status);
     245        this._summarySection.appendKeyValuePair(WI.UIString("Status"), status);
    286246
    287247        // FIXME: <https://webkit.org/b/178827> Web Inspector: Should be able to link directly to the ServiceWorker that handled a particular load
    288248
    289249        let source = this._responseSourceDisplayString(this._resource.responseSource) || emDash;
    290         this._appendKeyValuePair(detailsElement, WI.UIString("Source"), source);
     250        this._summarySection.appendKeyValuePair(WI.UIString("Source"), source);
    291251
    292252        if (this._resource.remoteAddress)
    293             this._appendKeyValuePair(detailsElement, WI.UIString("Address"), this._resource.remoteAddress);
     253            this._summarySection.appendKeyValuePair(WI.UIString("Address"), this._resource.remoteAddress);
    294254    }
    295255
     
    304264
    305265            // FIXME: <https://webkit.org/b/190214> Web Inspector: expose full load metrics for redirect requests
    306             this._appendKeyValuePair(redirectRequestSection.detailsElement, `${redirect.requestMethod} ${redirect.urlComponents.path}`, null, "h1-status");
     266            redirectRequestSection.appendKeyValuePair(`${redirect.requestMethod} ${redirect.urlComponents.path}`, null, "h1-status");
    307267
    308268            for (let key in redirect.requestHeaders)
    309                 this._appendKeyValuePair(redirectRequestSection.detailsElement, key, redirect.requestHeaders[key], "header");
     269                redirectRequestSection.appendKeyValuePair(key, redirect.requestHeaders[key], "header");
    310270
    311271            referenceElement = this.element.insertBefore(redirectRequestSection.element, referenceElement.nextElementSibling);
     
    315275
    316276            // FIXME: <https://webkit.org/b/190214> Web Inspector: expose full load metrics for redirect requests
    317             this._appendKeyValuePair(redirectResponseSection.detailsElement, `${redirect.responseStatusCode} ${redirect.responseStatusText}`, null, "h1-status");
     277            redirectResponseSection.appendKeyValuePair(`${redirect.responseStatusCode} ${redirect.responseStatusText}`, null, "h1-status");
    318278
    319279            for (let key in redirect.responseHeaders)
    320                 this._appendKeyValuePair(redirectResponseSection.detailsElement, key, redirect.responseHeaders[key], "header");
     280                redirectResponseSection.appendKeyValuePair(key, redirect.responseHeaders[key], "header");
    321281
    322282            referenceElement = this.element.insertBefore(redirectResponseSection.element, referenceElement.nextElementSibling);
     
    333293        if (this._resource.statusCode !== 304) {
    334294            if (this._resource.responseSource === WI.Resource.ResponseSource.MemoryCache) {
    335                 this._markIncompleteSectionWithMessage(this._requestHeadersSection, WI.UIString("No request, served from the memory cache."));
     295                this._requestHeadersSection.markIncompleteSectionWithMessage(WI.UIString("No request, served from the memory cache."));
    336296                return;
    337297            }
    338298            if (this._resource.responseSource === WI.Resource.ResponseSource.DiskCache) {
    339                 this._markIncompleteSectionWithMessage(this._requestHeadersSection, WI.UIString("No request, served from the disk cache."));
     299                this._requestHeadersSection.markIncompleteSectionWithMessage(WI.UIString("No request, served from the disk cache."));
    340300                return;
    341301            }
     
    348308            // https://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1
    349309            let requestLine = `${this._resource.requestMethod} ${urlComponents.path} ${protocol.toUpperCase()}`;
    350             this._appendKeyValuePair(detailsElement, requestLine, null, "h1-status");
     310            this._requestHeadersSection.appendKeyValuePair(requestLine, null, "h1-status");
    351311        } else if (protocol === "h2") {
    352312            // HTTP/2 Request pseudo headers:
    353313            // https://tools.ietf.org/html/rfc7540#section-8.1.2.3
    354             this._appendKeyValuePair(detailsElement, ":method", this._resource.requestMethod, "h2-pseudo-header");
    355             this._appendKeyValuePair(detailsElement, ":scheme", urlComponents.scheme, "h2-pseudo-header");
    356             this._appendKeyValuePair(detailsElement, ":authority", WI.h2Authority(urlComponents), "h2-pseudo-header");
    357             this._appendKeyValuePair(detailsElement, ":path", WI.h2Path(urlComponents), "h2-pseudo-header");
     314            this._requestHeadersSection.appendKeyValuePair(":method", this._resource.requestMethod, "h2-pseudo-header");
     315            this._requestHeadersSection.appendKeyValuePair(":scheme", urlComponents.scheme, "h2-pseudo-header");
     316            this._requestHeadersSection.appendKeyValuePair(":authority", WI.h2Authority(urlComponents), "h2-pseudo-header");
     317            this._requestHeadersSection.appendKeyValuePair(":path", WI.h2Path(urlComponents), "h2-pseudo-header");
    358318        }
    359319
    360320        let requestHeaders = this._resource.requestHeaders;
    361321        for (let key in requestHeaders)
    362             this._appendKeyValuePair(detailsElement, key, requestHeaders[key], "header");
     322            this._requestHeadersSection.appendKeyValuePair(key, requestHeaders[key], "header");
    363323
    364324        if (!detailsElement.firstChild)
    365             this._markIncompleteSectionWithMessage(this._requestHeadersSection, WI.UIString("No request headers"));
     325            this._requestHeadersSection.markIncompleteSectionWithMessage(WI.UIString("No request headers"));
    366326    }
    367327
     
    372332
    373333        if (!this._resource.hasResponse()) {
    374             this._markIncompleteSectionWithLoadingIndicator(this._responseHeadersSection);
     334            this._responseHeadersSection.markIncompleteSectionWithLoadingIndicator();
    375335            return;
    376336        }
     
    383343            // https://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1
    384344            let responseLine = `${protocol.toUpperCase()} ${this._resource.statusCode} ${this._resource.statusText}`;
    385             this._appendKeyValuePair(detailsElement, responseLine, null, "h1-status");
     345            this._responseHeadersSection.appendKeyValuePair(responseLine, null, "h1-status");
    386346        } else if (protocol === "h2") {
    387347            // HTTP/2 Response pseudo headers:
    388348            // https://tools.ietf.org/html/rfc7540#section-8.1.2.4
    389             this._appendKeyValuePair(detailsElement, ":status", this._resource.statusCode, "h2-pseudo-header");
     349            this._responseHeadersSection.appendKeyValuePair(":status", this._resource.statusCode, "h2-pseudo-header");
    390350        }
    391351
     
    397357                console.assert(responseCookies.length > 0);
    398358                for (let cookie of responseCookies)
    399                     this._appendKeyValuePair(detailsElement, key, cookie.rawHeader, "header");
     359                    this._responseHeadersSection.appendKeyValuePair(key, cookie.rawHeader, "header");
    400360                continue;
    401361            }
    402362
    403             this._appendKeyValuePair(detailsElement, key, responseHeaders[key], "header");
     363            this._responseHeadersSection.appendKeyValuePair(key, responseHeaders[key], "header");
    404364        }
    405365
    406366        if (!detailsElement.firstChild)
    407             this._markIncompleteSectionWithMessage(this._responseHeadersSection, WI.UIString("No response headers"));
     367            this._responseHeadersSection.markIncompleteSectionWithMessage(WI.UIString("No response headers"));
    408368    }
    409369
     
    419379        let queryStringPairs = parseQueryString(queryString, true);
    420380        for (let {name, value} of queryStringPairs)
    421             this._appendKeyValuePair(detailsElement, name, value);
     381            this._queryStringSection.appendKeyValuePair(name, value);
    422382    }
    423383
     
    435395        if (requestDataContentType && requestDataContentType.match(/^application\/x-www-form-urlencoded\s*(;.*)?$/i)) {
    436396            // Simple form data that should be parsable like a query string.
    437             this._appendKeyValuePair(detailsElement, WI.UIString("MIME Type"), requestDataContentType);
     397            this._requestDataSection.appendKeyValuePair(WI.UIString("MIME Type"), requestDataContentType);
    438398            let queryStringPairs = parseQueryString(requestData, true);
    439399            for (let {name, value} of queryStringPairs)
    440                 this._appendKeyValuePair(detailsElement, name, value);
     400                this._requestDataSection.appendKeyValuePair(name, value);
    441401            return;
    442402        }
     
    447407        let encoding = mimeTypeComponents.encoding;
    448408
    449         this._appendKeyValuePair(detailsElement, WI.UIString("MIME Type"), mimeType);
     409        this._requestDataSection.appendKeyValuePair(WI.UIString("MIME Type"), mimeType);
    450410        if (boundary)
    451             this._appendKeyValuePair(detailsElement, WI.UIString("Boundary"), boundary);
     411            this._requestDataSection.appendKeyValuePair(WI.UIString("Boundary"), boundary);
    452412        if (encoding)
    453             this._appendKeyValuePair(detailsElement, WI.UIString("Encoding"), encoding);
     413            this._requestDataSection.appendKeyValuePair(WI.UIString("Encoding"), encoding);
    454414
    455415        let goToButton = detailsElement.appendChild(WI.createGoToArrowButton());
    456416        goToButton.addEventListener("click", () => { this._delegate.headersContentViewGoToRequestData(this); });
    457         this._appendKeyValuePair(detailsElement, WI.UIString("Request Data"), goToButton);
     417        this._requestDataSection.appendKeyValuePair(WI.UIString("Request Data"), goToButton);
    458418    }
    459419
  • trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSecurityContentView.css

    r238121 r238122  
    11/*
    2  * Copyright (C) 2018 Sony Interactive Entertainment Inc.
     2 * Copyright (C) 2018 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #include "config.h"
    27 #include "CertificateInfo.h"
    28 
    29 #include <wtf/CrossThreadCopier.h>
    30 
    31 #if USE(CURL)
    32 
    33 namespace WebCore {
    34 
    35 CertificateInfo::CertificateInfo(int verificationError, Vector<Certificate>&& certificateChain)
    36     : m_verificationError(verificationError)
    37     , m_certificateChain(WTFMove(certificateChain))
    38 {
     26body[dir] .resource-security > section.certificate > .details {
     27    border-color: var(--network-dns-color);
    3928}
    4029
    41 CertificateInfo CertificateInfo::isolatedCopy() const
    42 {
    43     return { m_verificationError, crossThreadCopy(m_certificateChain) };
     30.resource-security .details .key {
     31    color: var(--network-dns-color);
    4432}
    4533
    46 CertificateInfo::Certificate CertificateInfo::makeCertificate(const char* buffer, size_t size)
    47 {
    48     Certificate certificate;
    49     certificate.append(buffer, size);
    50     return certificate;
     34.resource-security .dns-name + .dns-name > .key,
     35.resource-security .ip-address + .ip-address > .key {
     36    color: transparent;
    5137}
    5238
     39.resource-security .show-more {
     40    text-decoration: underline;
     41    cursor: pointer;
     42    color: var(--text-color);
    5343}
    5444
    55 #endif
     45@media (prefers-dark-interface) {
     46    body[dir] .resource-security > section.certificate > .details {
     47        border-color: var(--network-pseudo-header-color);
     48    }
     49
     50    .resource-security .details .key {
     51        color: var(--network-pseudo-header-color);
     52    }
     53}
Note: See TracChangeset for help on using the changeset viewer.