Changeset 214864 in webkit
- Timestamp:
- Apr 3, 2017 8:30:30 PM (7 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r214863 r214864 1 2017-04-03 Brian Burg <bburg@apple.com> 2 3 Web Inspector: RTL: results in Search navigation sidebar have misplaced highlights 4 https://bugs.webkit.org/show_bug.cgi?id=170292 5 6 Reviewed by Timothy Hatcher. 7 8 * UserInterface/Models/SourceCodeSearchMatchObject.js: 9 (WebInspector.SourceCodeSearchMatchObject.prototype.get className): 10 * UserInterface/Views/SearchIcons.css: 11 (.source-code-match .icon): 12 (.source-code-match-icon .icon): Deleted. 13 Remove -icon suffix from the class name since the class is attached to a result 14 and is not specific to the icon displayed within the result <li>. 15 16 * UserInterface/Views/SearchResultTreeElement.js: 17 (WebInspector.SearchResultTreeElement.truncateAndHighlightTitle): 18 Flip the leading and trailing context in RTL so that the highlight is not overflowed 19 to the left when too much context is included on the right side. Less context must be 20 used in RTL because we must not overflow to the right, as it may hide the result. And, 21 we don't know the exact starting character either as it may be overflowed to the right 22 as the user resizes the expanded sidebar larger or smaller. So show less context to 23 be conservative about never overflowing the highlighted result string. 24 25 * UserInterface/Views/SearchSidebarPanel.css: 26 (.sidebar > .panel.navigation.search .item.source-code-match .title): 27 When in RTL, show source code matches as LTR with text-align to right. 28 1 29 2017-04-03 Devin Rousso <webkit@devinrousso.com> 2 30 -
trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodeSearchMatchObject.js
r204507 r214864 1 1 /* 2 * Copyright (C) 2013 Apple Inc. All rights reserved.2 * Copyright (C) 2013-2017 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 47 47 get className() 48 48 { 49 return WebInspector.SourceCodeSearchMatchObject.SourceCodeMatchIconStyleClassName;49 return "source-code-match"; 50 50 } 51 51 … … 60 60 }; 61 61 62 WebInspector.SourceCodeSearchMatchObject.SourceCodeMatchIconStyleClassName = "source-code-match-icon";63 64 62 WebInspector.SourceCodeSearchMatchObject.TypeIdentifier = "source-code-search-match-object"; 65 63 WebInspector.SourceCodeSearchMatchObject.URLCookieKey = "source-code-url"; -
trunk/Source/WebInspectorUI/UserInterface/Views/SearchIcons.css
r176358 r214864 1 1 /* 2 * Copyright (C) 2013 Apple Inc. All rights reserved.2 * Copyright (C) 2013-2017 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 48 48 } 49 49 50 .source-code-match -icon.icon {50 .source-code-match .icon { 51 51 content: url(../Images/ResultLine.svg); 52 52 } -
trunk/Source/WebInspectorUI/UserInterface/Views/SearchResultTreeElement.js
r213000 r214864 1 1 /* 2 * Copyright (C) 2013 , 2015Apple Inc. All rights reserved.2 * Copyright (C) 2013-2017 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 39 39 static truncateAndHighlightTitle(title, searchTerm, sourceCodeTextRange) 40 40 { 41 let isRTL = WebInspector.resolvedLayoutDirection() === WebInspector.LayoutDirection.RTL; 42 const charactersToShowBeforeSearchMatch = isRTL ? 20 : 15; 43 const charactersToShowAfterSearchMatch = isRTL ? 15 : 50; 44 41 45 // Use the original location, since those line/column offsets match the line text in title. 42 46 var textRange = sourceCodeTextRange.textRange; … … 50 54 // at the end of the string. 51 55 var modifiedTitle = null; 52 if (searchTermIndex > WebInspector.SearchResultTreeElement.CharactersToShowBeforeSearchMatch) {53 modifiedTitle = ellipsis + title.substring(searchTermIndex - WebInspector.SearchResultTreeElement.CharactersToShowBeforeSearchMatch);54 searchTermIndex = WebInspector.SearchResultTreeElement.CharactersToShowBeforeSearchMatch + 1;56 if (searchTermIndex > charactersToShowBeforeSearchMatch) { 57 modifiedTitle = ellipsis + title.substring(searchTermIndex - charactersToShowBeforeSearchMatch); 58 searchTermIndex = charactersToShowBeforeSearchMatch + 1; 55 59 } else 56 60 modifiedTitle = title; 57 61 58 62 // Truncate the tail of the title so the tooltip isn't so large. 59 modifiedTitle = modifiedTitle.trimEnd(searchTermIndex + searchTerm.length + WebInspector.SearchResultTreeElement.CharactersToShowAfterSearchMatch);63 modifiedTitle = modifiedTitle.trimEnd(searchTermIndex + searchTerm.length + charactersToShowAfterSearchMatch); 60 64 61 65 console.assert(modifiedTitle.substring(searchTermIndex, searchTermIndex + searchTerm.length).toLowerCase() === searchTerm.toLowerCase()); … … 87 91 } 88 92 }; 89 90 WebInspector.SearchResultTreeElement.CharactersToShowBeforeSearchMatch = 15;91 WebInspector.SearchResultTreeElement.CharactersToShowAfterSearchMatch = 50; -
trunk/Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.css
r202064 r214864 1 1 /* 2 * Copyright (C) 2013 Apple Inc. All rights reserved.2 * Copyright (C) 2013-2017 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 52 52 margin-right: 4px; 53 53 } 54 55 body[dir=rtl] .sidebar > .panel.navigation.search .item.source-code-match { 56 direction: ltr; 57 text-align: right; 58 }
Note: See TracChangeset
for help on using the changeset viewer.