-
{this.hostValue}
+ ?
+ {this.hostValue}
{this.hostValue && this.titleValue ? ' | ' : ''}
{this.titleValue}
@@ -623,23 +627,79 @@ class UrlBar extends React.Component {
}
const styles = StyleSheet.create({
+ urlbarForm: {
+ display: 'flex',
+ flexGrow: 1,
+ alignItems: 'center',
+ justifyContent: 'center',
+ height: globalStyles.navigationBar.urlbarForm.height,
+ padding: '0 10px 0 3px',
+ background: '#fff',
+
+ // PR #6485
+ position: 'relative',
+
+ // Fixes #4298
+ width: 0,
+
+ // allow the navigator to shrink
+ minWidth: 0
+ },
+
+ urlbarForm_wide: {
+ // cf: https://github.com/brave/browser-laptop/blob/b161b37cf5e9f59be64855ebbc5d04816bfc537b/less/navigationBar.less#L682-L684
+ maxWidth: '100%'
+ },
+
+ urlbarForm_titleMode: {
+ background: 'none'
+ },
+
+ // ref: navigator__buttonContainer_addPublisherButtonContainer on publisherToggle.js
+ // TODO: Convert 'urlbarForm' to remove !important
+ urlbarForm_isPublisherButtonEnabled: {
+ borderTopRightRadius: '0 !important',
+ borderBottomRightRadius: '0 !important'
+ },
+
+ // Create 25x25 square and place .urlbarIcon at the center of it
+ urlbarForm__urlbarIconContainer: {
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ height: globalStyles.navigationBar.urlbarForm.height,
+ width: globalStyles.navigationBar.urlbarForm.height,
+ minHeight: globalStyles.navigationBar.urlbarForm.height,
+ minWidth: globalStyles.navigationBar.urlbarForm.height
+ },
+
+ urlbarForm__titleBar: {
+ display: 'inline-block',
+ color: globalStyles.color.chromeText,
+ fontSize: globalStyles.spacing.defaultFontSize,
+ maxWidth: '100%',
+ overflowX: 'hidden',
+ textOverflow: 'ellipsis',
+ whiteSpace: 'nowrap'
+ },
+
+ urlbarForm__titleBar__host: {
+ fontWeight: 600
+ },
+
noScriptContainer: {
display: 'flex',
padding: '5px',
marginRight: '-8px',
WebkitAppRegion: 'drag'
},
+
noScriptButton: {
WebkitAppRegion: 'no-drag',
backgroundImage: `url(${iconNoScript})`,
width: '14px',
height: '14px',
border: '0px'
- },
-
- urlbarForm_wide: {
- // cf: https://github.com/brave/browser-laptop/blob/b161b37cf5e9f59be64855ebbc5d04816bfc537b/less/navigationBar.less#L682-L684
- maxWidth: '100%'
}
})
diff --git a/app/renderer/components/styles/commonStyles.js b/app/renderer/components/styles/commonStyles.js
index 0ffa4b810fa..7a9c3bdeb68 100644
--- a/app/renderer/components/styles/commonStyles.js
+++ b/app/renderer/components/styles/commonStyles.js
@@ -198,6 +198,21 @@ const styles = StyleSheet.create({
isCommonForm: {
fontSize: globalStyles.fontSize.flyoutDialog,
width: '100%'
+ },
+
+ // #9283
+ // Create 25x25 squares and place the buttons at the center of each container
+ navigator__buttonContainer: {
+ border: `1px solid ${globalStyles.color.urlBarOutline}`,
+ borderRadius: globalStyles.radius.borderRadiusURL,
+ boxSizing: 'border-box',
+ display: 'flex',
+ alignItems: 'center',
+ height: globalStyles.navigationBar.urlbarForm.height,
+ width: globalStyles.navigationBar.urlbarForm.height,
+ minHeight: globalStyles.navigationBar.urlbarForm.height,
+ minWidth: globalStyles.navigationBar.urlbarForm.height,
+ WebkitAppRegion: 'no-drag'
}
})
diff --git a/app/renderer/components/styles/global.js b/app/renderer/components/styles/global.js
index a99959bd7fd..b1d12c1c2bf 100644
--- a/app/renderer/components/styles/global.js
+++ b/app/renderer/components/styles/global.js
@@ -134,8 +134,6 @@ const globalStyles = {
switchNubTopMargin: '2px',
switchNubLeftMargin: '2px',
switchNubRightMargin: '2px',
- buttonHeight: '25px',
- buttonWidth: '25px',
navbarHeight: '36px',
downloadsBarHeight: '60px',
tabsToolbarHeight: '26px',
@@ -311,6 +309,13 @@ const globalStyles = {
background: '#ccc'
}
}
+ },
+
+ navigationBar: {
+
+ urlbarForm: {
+ height: '25px'
+ }
}
}
diff --git a/less/navigationBar.less b/less/navigationBar.less
index 80ed2e54957..9443e683025 100644
--- a/less/navigationBar.less
+++ b/less/navigationBar.less
@@ -16,7 +16,7 @@
// (macOS) We need to keep a padding left to avoid overlapping
// with the window buttons to close/maximize/minimize the window.
-.platform--darwin .navigatorWrapper .backforward {
+.platform--darwin .navigatorWrapper .topLevelStartButtons {
margin-left: @navbarLeftMarginDarwin;
&.fullscreen {
@@ -36,7 +36,7 @@
box-sizing: border-box;
}
- .backforward {
+ .topLevelStartButtons {
padding-left: 5px;
}
@@ -365,15 +365,6 @@
-webkit-app-region: drag;
}
}
-.navbarMenubarFlexContainer {
- display: flex;
- flex: 1;
- flex-direction: column;
- box-sizing: border-box;
- position: relative;
- overflow: visible;
- white-space: nowrap;
-}
// Window Caption Buttons (for use w/ slim titlebar)
.windowCaptionButtons {
@@ -454,10 +445,8 @@
@rightMargin: @navbarLeftMarginDarwin / 2;
- display: flex;
-
// Buttons on the left
- .backforward {
+ .topLevelStartButtons {
display: flex;
.backButton,
@@ -480,14 +469,13 @@
// Navigation bar at the center
#navigator {
- display: flex;
- flex-grow: 1;
- min-width: 0%; // allow the navigator to shrink
- max-width: 900px;
- margin-right: @rightMargin;
-
&.titleMode {
padding-right: @centerOffset;
+
+ @media (max-width: @breakpointNarrowViewport) {
+ transition: padding @transitionDuration ease-in-out;
+ padding-right: 0;
+ }
}
@media (max-width: @breakpointNarrowViewport) {
@@ -497,40 +485,10 @@
@media (max-width: @breakpointNarrowViewport) {
width: 100%;
}
-
- &.titleMode {
- @media (max-width: @breakpointNarrowViewport) {
- transition: padding @transitionDuration ease-in-out;
- padding-right: 0;
- }
- }
}
// Buttons on the right
.topLevelEndButtons {
- display: flex;
- flex-direction: row;
- margin-left: 3px;
- position: relative;
-
- .braveMenu {
- width: @navbarBraveButtonWidth;
- margin-right: @navbarButtonSpacing;
- -webkit-app-region: no-drag;
- user-select: none;
-
- &.braveShieldsDown {
- -webkit-filter: grayscale(100%);
- }
-
- &.braveShieldsDisabled {
- -webkit-filter: grayscale(100%);
- opacity: 0.4;
- }
- &.leftOfCaptionButton {
- margin-right: 3px;
- }
- }
@media (max-width: @breakpointWideViewport) {
.extraDragArea {
@@ -542,14 +500,6 @@
}
}
-.navigationButton {
- background-color: @buttonColor;
- display: inline-block;
- width: 100%;
- height: 100%;
- margin: 0 7px 0 0;
-}
-
.navigationButtonContainer {
border-radius: @borderRadius;
height: 24px;
@@ -573,42 +523,12 @@
}
}
-#navigator {
- .stopButton,
- .reloadButton,
- .homeButton {
- margin: 0;
- padding: 0;
- width: 100%;
- height: 100%;
- }
-
- .stopButton {
- background: url('../img/toolbar/stoploading_btn.svg') center no-repeat;
- background-size: 11px 11px;
- }
-
- .reloadButton {
- background: url('../img/toolbar/reload_btn.svg') center no-repeat;
- background-size: 13px 13px;
- }
-
- .homeButton {
- background: url('../img/toolbar/home_btn.svg') center no-repeat;
- background-size: 16px 16px;
- }
-}
-
.navigatorWrapper {
- justify-content: space-between;
- align-items: center;
- margin-top: @navbarMenubarMargin;
- box-sizing: border-box;
/**
* Left buttons
*/
- .backforward {
+ .topLevelStartButtons {
display: flex;
z-index: @zindexNavigationBar;
transition: margin @transitionDuration ease-in-out;
@@ -629,20 +549,7 @@
}
}
-@urlbarFormHeight: 25px;
-
.urlbarForm {
- position: relative; // PR #6485
- width: 0; // Fixes #4298
- align-items: center;
- justify-content: center;
- height: @urlbarFormHeight;
- padding: 0 10px 0 3px;
- background: @navigationBarBackgroundActive;
- display: flex;
- flex-grow: 1;
- min-width: 0%; // allow the navigator to shrink
-
*:not(legend) {
z-index: @zindexUrlbarNotLegend;
}
@@ -681,14 +588,6 @@
}
#navigator {
- font-size: 20px;
- align-items: center;
- justify-content: center;
- box-sizing: border-box;
- padding: 0;
- position: relative;
- user-select: none;
- z-index: @zindexNavigationBar;
// #6253 #6680
> * {
@@ -703,10 +602,6 @@
}
}
- .endButtons {
- display: flex;
- }
-
&:not(.titleMode) {
> * {
animation: fadeIn .6s;
@@ -714,50 +609,12 @@
}
.urlbarForm {
- &.noBorderRadius {
- border-radius: 0;
-
+ &.isPublisherButtonEnabled {
legend:before {
border-radius: 0;
}
}
}
-
- // Create 25x25 squares and place the buttons at the center of each container
- .bookmarkButtonContainer,
- .addPublisherButtonContainer {
- border: 1px solid @urlBarOutline;
- border-radius: @borderRadiusURL;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- height: @urlbarFormHeight;
- width: @urlbarFormHeight;
- min-height: @urlbarFormHeight;
- min-width: @urlbarFormHeight;
- -webkit-app-region: no-drag;
- }
-
- .bookmarkButtonContainer {
- border-right: none;
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
-
- .bookmarkButton {
- background: url('../img/toolbar/bookmark_btn.svg') center no-repeat;
- -webkit-mask-repeat: no-repeat;
- background-size: 14px 14px;
- margin: 0;
- height: 0;
- width: @urlbarFormHeight; // #6704
- height: @urlbarFormHeight; // #6704
-
- &.removeBookmarkButton {
- background: url('../img/toolbar/bookmark_marked.svg') center no-repeat;
- background-size: 14px 14px;
- }
- }
- }
}
&.titleMode {
@@ -767,37 +624,9 @@
// border-radius: @borderRadiusURL;
// box-shadow: inset 0 0 0 1px rgba(187, 187, 187, 1.0);
- .urlbarForm {
- background: none;
- }
-
- input {
- display: none;
- }
- #titleBar {
- display: inline-block;
- color: @chromeText;
- font-size: 13px;
- max-width: 100%;
- overflow-x: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- margin-left: 2px;
-
- strong {
- font-weight: 600;
- }
- }
-
- .endButtons {
- display: none;
- }
-
.urlbarIcon {
display: inline-block;
opacity: 0.5;
- position: relative;
- left: 2px;
min-width: 0;
&.insecure-color {
@@ -813,11 +642,6 @@
}
}
- #titleBar {
- display: none;
- text-overflow: ellipsis;
- }
-
.urlbarForm {
.loadTime {
color: @loadTimeColor;
@@ -866,16 +690,7 @@
}
}
- // Create 25x25 square and place .urlbarIcon at the center of it
.urlbarIconContainer {
- display: flex;
- align-items: center;
- justify-content: center;
- height: @urlbarFormHeight;
- width: @urlbarFormHeight;
- min-height: @urlbarFormHeight;
- min-width: @urlbarFormHeight;
-
.urlbarIcon {
color: @siteSecureColor;
font-size: 12px;
diff --git a/test/lib/selectors.js b/test/lib/selectors.js
index c4b8e9f1d85..38d643fe74f 100644
--- a/test/lib/selectors.js
+++ b/test/lib/selectors.js
@@ -19,8 +19,8 @@ module.exports = {
urlbarIcon: '.urlbarIcon',
urlBarSuggestions: '.urlBarSuggestions',
titleBar: '#titleBar',
- navigatorBookmarked: '#navigator .removeBookmarkButton',
- navigatorNotBookmarked: '#navigator .bookmarkButton',
+ navigatorBookmarked: '[data-test-id="bookmarked"]',
+ navigatorNotBookmarked: '[data-test-id="notBookmarked"]',
bookmarksToolbar: '[data-test-id="bookmarksToolbar"]',
bookmarkNameInput: '[data-test-id="bookmarkNameInput"]',
bookmarkLocationInput: '[data-test-id="bookmarkLocationInput"]',
@@ -62,9 +62,9 @@ module.exports = {
noScriptAllowTempButton: '[data-l10n-id="allowScriptsTemp"]',
noScriptAllowOnceButton: '[data-l10n-id="allowScriptsOnce"]',
noScriptAllowButton: '[data-l10n-id="allowScripts"]',
- backButton: '.backforward .backButton',
- forwardButton: '.backforward .forwardButton',
- reloadButton: '.reloadButton',
+ backButton: '.topLevelStartButtons .backButton',
+ forwardButton: '.topLevelStartButtons .forwardButton',
+ reloadButton: '[data-test-id="reloadButton"]',
homeButton: '[data-test-id="homeButton"]',
clearBrowsingDataButton: '[data-test-id="clearBrowsingDataButton"]',
clearBrowsingDataPanel: '[data-test-id="clearBrowsingDataPanel"]',