The stock market was largely flat on Friday, finishing a momentous week and moving into the final days of 2017. Major benchmarks were little changed, and a big decline in the price of bitcoin and the ongoing assessment of the just-passed tax reform package captured many investors' attention. Yet some companies enjoyed favorable tailwinds that sent their share prices moving substantially higher. XPO Logistics (XPO -1.54%), Westport Fuel Systems (WPRT -0.43%), and Party City Holdco (PRTY -60.00%) were among the best performers on the day. Below, we'll look more closely at these stocks to tell you why they did so well.

Is XPO getting bought out?

Shares of XPO Logistics jumped 14% during the afternoon hours after reports surfaced that home improvement retailer Home Depot (HD 1.25%) might consider buying the freight company. The reports suggest that Home Depot has discussed the idea internally, potentially seeing it as a defensive play to keep e-commerce rivals from seeking to take greater control of the shipment and logistics infrastructure industry. XPO gets a substantial amount of its business from e-commerce, and at this time of the year, investors tend to pay attention to the role that shipments play in retail. A Home Depot purchase could signal a big shift in the home-improvement giant's plans, with a potentially greater emphasis on delivery versus in-store pickup and other options for shoppers.

White semi truck on a highway, with XPO logo on side.

Image source: XPO Logistics.

Westport powers up

Westport Fuel Systems stock climbed nearly 14% after the maker of natural gas-powered engines announced two milestones. First, Westport obtained a $20 million loan from Export Development Canada to support its launch of its second-generation high-pressure direct-injection program. Westport also said that it had signed a memorandum of understanding with China's Weichai Power, under which Westport will finalize development, marketing, and commercialization of HPDI technology in China. The company's natural-gas emphasis hasn't produced the profits that investors had expected for Westport, but bullish shareholders are hopeful that the latest news could be the start of a turnaround.

Party City celebrates

Finally, shares of Party City Holdco finished 14% higher. The party-goods retailer said that it would spend $242 million to buy back 19.8 million shares of stock from major shareholder Advent-Party City Acquisition Limited Partnership. The partnership had held between 15% and 20% of Party City's outstanding shares, and shareholders were happy with CEO Jim Harrison's comments that the move "removes a share overhang associated with Advent's long-term shareholder interest in the business" while also being accretive to earnings on a per-share basis. Now that Advent is out, investors hope that Party City will be able to keep up positive momentum in 2018 and beyond.